Make WordPress Core

Changeset 53392


Ignore:
Timestamp:
05/12/2022 02:04:59 PM (6 weeks ago)
Author:
audrasjb
Message:

Taxonomy: Set use_desc_for_title to false by default in wp_list_categories()

This change removes the default title attribute of category links returned by wp_list_categories(), for better accessibility.

Props just0nequestion, joyously, andrija, audrasjb, sabernhardt.
Fixes #55530.
See #24766.

File:
1 edited

Legend:

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

    r53318 r53392  
    484484 * @since 4.4.0 Introduced the `hide_title_if_empty` and `separator` arguments.
    485485 * @since 4.4.0 The `current_category` argument was modified to optionally accept an array of values.
     486 * @since 6.1.0 Default value of the 'use_desc_for_title' argument was changed from 1 to 0.
    486487 *
    487488 * @param array|string $args {
     
    520521 *                                               to disable. Default 'Categories'.
    521522 *     @type bool|int     $use_desc_for_title    Whether to use the category description as the title attribute.
    522  *                                               Accepts 0, 1, or their bool equivalents. Default 1.
     523 *                                               Accepts 0, 1, or their bool equivalents. Default 0.
    523524 *     @type Walker       $walker                Walker object to use to build the output. Default empty which results
    524525 *                                               in a Walker_Category instance being used.
     
    550551        'taxonomy'            => 'category',
    551552        'title_li'            => __( 'Categories' ),
    552         'use_desc_for_title'  => 1,
     553        'use_desc_for_title'  => 0,
    553554    );
    554555
Note: See TracChangeset for help on using the changeset viewer.