Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions app/Hametuha/WpHamazon/Service/Dmm.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected function filter_data( $data ) {
'key' => $key,
'label' => $value,
);
}, array( 'DMM.com', 'DMM.R18' ), array( __( 'General', 'hamazon' ), __( 'Adult', 'hamazon' ) ) ),
}, array( 'DMM.com', 'DMM.R18', 'FANZA' ), array( __( 'General', 'hamazon' ), __( 'Adult', 'hamazon' ) ) ),
);
}

Expand Down Expand Up @@ -152,7 +152,7 @@ public function get_rest_arguments() {
'required' => true,
'description' => __( 'Site to search. DMM.com or DMM.R18', 'hamazon' ),
'validation_callback' => function ( $site ) {
return in_array( $site, array( 'DMM.com', 'DMM.R18' ), true );
return in_array( $site, array( 'DMM.com', 'DMM.R18', 'FANZA' ), true );
},
),
);
Expand All @@ -177,8 +177,7 @@ public function handle_rest_request( \WP_REST_Request $request ) {
) );
return $search_result;
}
$site = $request['site'];
$site = 'DMM.R18' === $request['site'] ? $request['site'] : 'DMM.com';
$site = 'DMM.R18' === $request['site'] ? 'FANZA' : 'DMM.com';
// Check if items exist and is an array
$items = isset( $search_result->result->items ) && is_array( $search_result->result->items )
? $search_result->result->items
Expand Down
2 changes: 1 addition & 1 deletion template-parts/dmm-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="tmkm-amazon-view wp-hamazon-dmm" data-store="dmm">
<p class="tmkm-amazon-img">
<a href="<?php echo esc_url( $item->affiliateURL ); ?>" target="_blank" rel="sponsored noreferrer noopener">
<img class="tmkm-amazon-image" src="<?php echo isset( $item->imageURL->large ) ? $item->imageURL->large : hamazon_no_image(); ?>" alt=""/>
<img class="tmkm-amazon-image" src="<?php echo isset( $item->imageURL->large ) ? $item->imageURL->large : ( isset( $item->imageURL->small ) ? $item->imageURL->small : hamazon_no_image() ); ?>" alt=""/>
</a>
</p>
<p class="tmkm-amazon-title">
Expand Down