From c4bcfc3c795869e97817d937bf3874aabe585bac Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 26 Oct 2023 17:50:42 +0200 Subject: [PATCH] updating with new condition to avoid mistakes in single news editor --- includes/admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin.php b/includes/admin.php index d0aea85..5c1f4e7 100644 --- a/includes/admin.php +++ b/includes/admin.php @@ -263,9 +263,9 @@ function wpdocs_admin_classes($classes) $thematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null; $thematiqueParent = getParentThematique($thematique); $thematiqueColorSlug = getThematiqueFamilySlug($thematiqueParent->slug) ?? null; + $postType = get_post_type($post->ID); - - if (in_array($pagenow, array('post.php', 'post-new.php'), true) && $thematiqueColorSlug) { + if (in_array($pagenow, array('post.php', 'post-new.php'), true) && $thematiqueColorSlug && ($postType == 'conseils' || $postType == 'questions')) { $classes .= ' ' . $thematiqueParent->slug; }