diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-includes/class-walker-category.php --- a/wp/wp-includes/class-walker-category.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-includes/class-walker-category.php Tue Dec 15 13:49:49 2020 +0100 @@ -53,7 +53,7 @@ * value is 'list'. See wp_list_categories(). Default empty array. */ public function start_lvl( &$output, $depth = 0, $args = array() ) { - if ( 'list' != $args['style'] ) { + if ( 'list' !== $args['style'] ) { return; } @@ -74,7 +74,7 @@ * value is 'list'. See wp_list_categories(). Default empty array. */ public function end_lvl( &$output, $depth = 0, $args = array() ) { - if ( 'list' != $args['style'] ) { + if ( 'list' !== $args['style'] ) { return; } @@ -97,11 +97,7 @@ */ public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { /** This filter is documented in wp-includes/category-template.php */ - $cat_name = apply_filters( - 'list_cats', - esc_attr( $category->name ), - $category - ); + $cat_name = apply_filters( 'list_cats', esc_attr( $category->name ), $category ); // Don't generate an element if the category name is empty. if ( '' === $cat_name ) { @@ -143,7 +139,7 @@ $attributes = ''; foreach ( $atts as $attr => $value ) { - if ( ! empty( $value ) ) { + if ( is_scalar( $value ) && '' !== $value && false !== $value ) { $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); $attributes .= ' ' . $attr . '="' . $value . '"'; } @@ -165,7 +161,7 @@ $link .= 'count ) . ')'; } - if ( 'list' == $args['style'] ) { + if ( 'list' === $args['style'] ) { $output .= "\ttaxonomy, array( + 'taxonomy' => $category->taxonomy, 'include' => $args['current_category'], 'hide_empty' => false, ) @@ -210,6 +206,7 @@ foreach ( $_current_terms as $_current_term ) { if ( $category->term_id == $_current_term->term_id ) { $css_classes[] = 'current-cat'; + $link = str_replace( 'term_id == $_current_term->parent ) { $css_classes[] = 'current-cat-parent'; } @@ -261,7 +258,7 @@ * to output. See wp_list_categories(). Default empty array. */ public function end_el( &$output, $page, $depth = 0, $args = array() ) { - if ( 'list' != $args['style'] ) { + if ( 'list' !== $args['style'] ) { return; }