From 85641103920a050b6fb497f55c6a7b87def770e4 Mon Sep 17 00:00:00 2001 From: KAWANISHI Kazuhiro Date: Mon, 19 Jan 2026 17:03:17 +0900 Subject: [PATCH] When no large image, output small image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・DMM/FANZA で imageURL->large が存在しない場合は imageURL->small を表示するように ・FANZA に REST リクエストする際の site を 'FANZA' に変更 (DMM.R18 でも強制的に FANZA でリクエスト) --- app/Hametuha/WpHamazon/Service/Dmm.php | 7 +++---- template-parts/dmm-single.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Hametuha/WpHamazon/Service/Dmm.php b/app/Hametuha/WpHamazon/Service/Dmm.php index d8cc1b7..0dcd52b 100644 --- a/app/Hametuha/WpHamazon/Service/Dmm.php +++ b/app/Hametuha/WpHamazon/Service/Dmm.php @@ -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' ) ) ), ); } @@ -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 ); }, ), ); @@ -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 diff --git a/template-parts/dmm-single.php b/template-parts/dmm-single.php index 64bcc3e..aea00e1 100644 --- a/template-parts/dmm-single.php +++ b/template-parts/dmm-single.php @@ -13,7 +13,7 @@

- +