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.

Built from https://develop.svn.wordpress.org/trunk@53392


git-svn-id: http://core.svn.wordpress.org/trunk@52981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2022-05-12 14:06:21 +00:00
parent f4d9778c98
commit 96c26acafd
2 changed files with 4 additions and 3 deletions

View File

@ -483,6 +483,7 @@ function wp_dropdown_categories( $args = '' ) {
* @since 2.1.0
* @since 4.4.0 Introduced the `hide_title_if_empty` and `separator` arguments.
* @since 4.4.0 The `current_category` argument was modified to optionally accept an array of values.
* @since 6.1.0 Default value of the 'use_desc_for_title' argument was changed from 1 to 0.
*
* @param array|string $args {
* Array of optional arguments. See get_categories(), get_terms(), and WP_Term_Query::__construct()
@ -519,7 +520,7 @@ function wp_dropdown_categories( $args = '' ) {
* @type string $title_li Text to use for the list title `<li>` element. Pass an empty string
* to disable. Default 'Categories'.
* @type bool|int $use_desc_for_title Whether to use the category description as the title attribute.
* Accepts 0, 1, or their bool equivalents. Default 1.
* Accepts 0, 1, or their bool equivalents. Default 0.
* @type Walker $walker Walker object to use to build the output. Default empty which results
* in a Walker_Category instance being used.
* }
@ -549,7 +550,7 @@ function wp_list_categories( $args = '' ) {
'style' => 'list',
'taxonomy' => 'category',
'title_li' => __( 'Categories' ),
'use_desc_for_title' => 1,
'use_desc_for_title' => 0,
);
$parsed_args = wp_parse_args( $args, $defaults );

View File

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