From 2da269e4d2aa92fb6b88c72ca18af187001605ec Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 6 Jun 2023 00:28:54 +0000 Subject: [PATCH] Coding Standards: Use strict comparison in `wp-includes/class-walker-category.php`. Follow-up to [3033], [3704], [4576], [4580], [5530], [15847], [36008]. Props aristath, poena, afercia, SergeyBiryukov. See #57839. git-svn-id: https://develop.svn.wordpress.org/trunk@55883 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-walker-category.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/class-walker-category.php b/src/wp-includes/class-walker-category.php index dd7252cffe..36f631c1b2 100644 --- a/src/wp-includes/class-walker-category.php +++ b/src/wp-includes/class-walker-category.php @@ -182,6 +182,7 @@ class Walker_Category extends Walker { } else { $link .= "'; } + $link .= ''; if ( empty( $args['feed_image'] ) ) { @@ -192,6 +193,7 @@ class Walker_Category extends Walker { if ( ! empty( $args['show_count'] ) ) { $link .= ' (' . number_format_i18n( $category->count ) . ')'; } + if ( 'list' === $args['style'] ) { $output .= "\tterm_id == $_current_term->term_id ) { + if ( $category->term_id === $_current_term->term_id ) { $css_classes[] = 'current-cat'; $link = str_replace( 'term_id == $_current_term->parent ) { + } elseif ( $category->term_id === $_current_term->parent ) { $css_classes[] = 'current-cat-parent'; } + while ( $_current_term->parent ) { - if ( $category->term_id == $_current_term->parent ) { + if ( $category->term_id === $_current_term->parent ) { $css_classes[] = 'current-cat-ancestor'; break; } + $_current_term = get_term( $_current_term->parent, $category->taxonomy ); } }