Make WordPress Core

Ticket #55530: 55530.diff

File 55530.diff, 1.0 KB (added by andrija, 3 years ago)

Default use_desc_for_title set to false (0), category walker will always create <a title=""> attribute with category name (default) or category description if use_desc_for_title is set to true (1)

  • src/wp-includes/category-template.php

    diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php
    index 38c52a79a9..553c2fc7b8 100644
    a b function wp_list_categories( $args = '' ) { 
    545545                'style'               => 'list',
    546546                'taxonomy'            => 'category',
    547547                'title_li'            => __( 'Categories' ),
    548                 'use_desc_for_title'  => 1,
     548                'use_desc_for_title'  => 0,
    549549        );
    550550
    551551        $parsed_args = wp_parse_args( $args, $defaults );
  • src/wp-includes/class-walker-category.php

    diff --git a/src/wp-includes/class-walker-category.php b/src/wp-includes/class-walker-category.php
    index fcf54a333f..8f792361e0 100644
    a b class Walker_Category extends Walker { 
    123123                         * @param WP_Term $category    Category object.
    124124                         */
    125125                        $atts['title'] = strip_tags( apply_filters( 'category_description', $category->description, $category ) );
     126                } else {
     127            $atts['title'] = strip_tags( $category->name );
    126128                }
    127129
    128130                /**