--- a/wp/wp-includes/class-walker-category.php Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/class-walker-category.php Fri Sep 05 18:40:08 2025 +0200
@@ -182,6 +182,7 @@
} else {
$link .= "<img src='" . esc_url( $args['feed_image'] ) . "'$alt" . ' />';
}
+
$link .= '</a>';
if ( empty( $args['feed_image'] ) ) {
@@ -192,6 +193,7 @@
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 @@
);
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 );
}
}
@@ -271,5 +275,4 @@
$output .= "</li>\n";
}
-
}