updating with new condition to avoid mistakes in single news editor

This commit is contained in:
Antoine M 2023-10-26 17:50:42 +02:00
parent 066bbadc0a
commit c4bcfc3c79

View File

@ -263,9 +263,9 @@ function wpdocs_admin_classes($classes)
$thematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null; $thematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null;
$thematiqueParent = getParentThematique($thematique); $thematiqueParent = getParentThematique($thematique);
$thematiqueColorSlug = getThematiqueFamilySlug($thematiqueParent->slug) ?? null; $thematiqueColorSlug = getThematiqueFamilySlug($thematiqueParent->slug) ?? null;
$postType = get_post_type($post->ID);
if (in_array($pagenow, array('post.php', 'post-new.php'), true) && $thematiqueColorSlug && ($postType == 'conseils' || $postType == 'questions')) {
if (in_array($pagenow, array('post.php', 'post-new.php'), true) && $thematiqueColorSlug) {
$classes .= ' ' . $thematiqueParent->slug; $classes .= ' ' . $thematiqueParent->slug;
} }