From 5e771aa06431505c7cad6645131715787d9a8243 Mon Sep 17 00:00:00 2001 From: yhira Date: Sun, 31 Dec 2023 11:05:44 +0900 Subject: [PATCH] =?UTF-8?q?=E9=99=A4=E5=A4=96=E3=82=AB=E3=83=86=E3=82=B4?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=81=8C=E3=80=81=E6=8A=95=E7=A8=BF=E3=81=AE=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E8=A8=98=E4=BA=8B=E3=81=AB=E3=80=81=E9=99=A4=E5=A4=96=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA=E3=83=BC=E3=81=8C?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B=E4=B8=8D=E5=85=B7?= =?UTF-8?q?=E5=90=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/related-entries.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/related-entries.php b/lib/related-entries.php index 3504f3a68..a30f57e2a 100644 --- a/lib/related-entries.php +++ b/lib/related-entries.php @@ -122,6 +122,14 @@ function get_additional_related_wp_query_args($args) { } } + //除外カテゴリーの処理を追加 + $exclude_category_ids = get_archive_exclude_category_ids(); + if ($exclude_category_ids && is_array($exclude_category_ids)) { + $args += array( + 'category__not_in' => $exclude_category_ids, + ); + } + return apply_filters('get_additional_related_wp_query_args', $args); } endif;