Make WordPress Core

Changeset 55883


Ignore:
Timestamp:
06/06/2023 12:28:54 AM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-walker-category.php

    r52652 r55883  
    183183                                $link .= "<img src='" . esc_url( $args['feed_image'] ) . "'$alt" . ' />';
    184184                        }
     185
    185186                        $link .= '</a>';
    186187
    … …  
    193194                        $link .= ' (' . number_format_i18n( $category->count ) . ')';
    194195                }
     196
    195197                if ( 'list' === $args['style'] ) {
    196198                        $output     .= "\t<li";
    … …  
    211213
    212214                                foreach ( $_current_terms as $_current_term ) {
    213                                         if ( $category->term_id == $_current_term->term_id ) {
     215                                        if ( $category->term_id === $_current_term->term_id ) {
    214216                                                $css_classes[] = 'current-cat';
    215217                                                $link          = str_replace( '<a', '<a aria-current="page"', $link );
    216                                         } elseif ( $category->term_id == $_current_term->parent ) {
     218                                        } elseif ( $category->term_id === $_current_term->parent ) {
    217219                                                $css_classes[] = 'current-cat-parent';
    218220                                        }
     221
    219222                                        while ( $_current_term->parent ) {
    220                                                 if ( $category->term_id == $_current_term->parent ) {
     223                                                if ( $category->term_id === $_current_term->parent ) {
    221224                                                        $css_classes[] = 'current-cat-ancestor';
    222225                                                        break;
    223226                                                }
     227
    224228                                                $_current_term = get_term( $_current_term->parent, $category->taxonomy );
    225229                                        }
Note: See TracChangeset for help on using the changeset viewer.