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.
Built from https://develop.svn.wordpress.org/trunk@55883


git-svn-id: http://core.svn.wordpress.org/trunk@55395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-06-06 00:30:20 +00:00
parent 8c533a8442
commit 02009f6df2
2 changed files with 8 additions and 4 deletions

View File

@ -182,6 +182,7 @@ class Walker_Category extends Walker {
} else {
$link .= "<img src='" . esc_url( $args['feed_image'] ) . "'$alt" . ' />';
}
$link .= '</a>';
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 .= "\t<li";
$css_classes = array(
@ -210,17 +212,19 @@ class Walker_Category extends Walker {
);
foreach ( $_current_terms as $_current_term ) {
if ( $category->term_id == $_current_term->term_id ) {
if ( $category->term_id === $_current_term->term_id ) {
$css_classes[] = 'current-cat';
$link = str_replace( '<a', '<a aria-current="page"', $link );
} elseif ( $category->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 );
}
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.3-alpha-55882';
$wp_version = '6.3-alpha-55883';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.