From 144cb531fcd40beb5f9db2d448e224b2a091a3d2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 26 Aug 2019 16:59:53 +0000 Subject: [PATCH] Docs: Reference `WP_Term_Query::__construct()` in `wp_list_categories()` DocBlock for additional accepted arguments. Clarify that `wp_dropdown_categories()` always returns a string, regardless of the `echo` parameter. See #47896, #47110. git-svn-id: https://develop.svn.wordpress.org/trunk@45895 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/category-template.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php index dab8187bce..6bc47e2684 100644 --- a/src/wp-includes/category-template.php +++ b/src/wp-includes/category-template.php @@ -288,7 +288,7 @@ function category_description( $category = 0 ) { * @since 4.2.0 Introduced the `value_field` argument. * @since 4.6.0 Introduced the `required` argument. * - * @param string|array $args { + * @param array|string $args { * Optional. Array or string of arguments to generate a categories drop-down element. See WP_Term_Query::__construct() * for information on additional accepted arguments. * @@ -321,7 +321,7 @@ function category_description( $category = 0 ) { * @type bool $required Whether the `\n"; } + /** * Filters the taxonomy drop-down output. * @@ -459,6 +460,7 @@ function wp_dropdown_categories( $args = '' ) { if ( $parsed_args['echo'] ) { echo $output; } + return $output; } @@ -466,12 +468,12 @@ function wp_dropdown_categories( $args = '' ) { * Display or retrieve the HTML list of categories. * * @since 2.1.0 - * @since 4.4.0 Introduced the `hide_title_if_empty` and `separator` arguments. The `current_category` argument was modified to - * optionally accept an array of values. + * @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. * - * @param string|array $args { - * Array of optional arguments. See get_categories(), get_terms(), and WP_Tax_Query::construct() - * for full lists of arguments that can be passed in `$args`. + * @param array|string $args { + * Array of optional arguments. See get_categories(), get_terms(), and WP_Term_Query::__construct() + * for information on additional accepted arguments. * * @type int|array $current_category ID of category, or array of IDs of categories, that should get the * 'current-cat' class. Default 0. @@ -503,7 +505,7 @@ function wp_dropdown_categories( $args = '' ) { * @type bool|int $use_desc_for_title Whether to use the category description as the title attribute. * Default 1. * } - * @return false|string HTML content only if 'echo' argument is 0. + * @return false|string HTML list of categories only if 'echo' argument is 0. */ function wp_list_categories( $args = '' ) { $defaults = array(