From e7962e19ad3e91e708e380f771bd03924559beb0 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Thu, 12 May 2022 14:04:59 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@53392 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/category-template.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php index 8c34b0e985..250c5d378f 100644 --- a/src/wp-includes/category-template.php +++ b/src/wp-includes/category-template.php @@ -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 `
  • ` 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 );