From 67871ba641cc03cb75de7e3e866e158b2a6b5f66 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 3 Nov 2014 18:48:50 +0000 Subject: [PATCH] Improve docblocks for `get_the_taxonomies()` and `the_taxonomies()`. * In `the_taxonomies()`, only document those arguments that are specific to the function. Arguments shared with `get_the_taxonomies()` should be documented in the later function's docblock. * Add $args hash documentation to `get_the_taxonomies()`. * Remove the redundant default argument definition in `the_taxonomies()`. Fixes #27238. git-svn-id: https://develop.svn.wordpress.org/trunk@30210 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/taxonomy.php | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index c9feb504da..75e5c6a08e 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -4134,17 +4134,15 @@ function get_term_link( $term, $taxonomy = '') { * @since 2.5.0 * * @param array $args { - * Arguments about which post to use and how to format the output. + * Arguments about which post to use and how to format the output. Shares all of the arguments supported by + * {@link get_the_taxonomies()}, in addition to the following. * - * @type int|WP_Post $post Post ID or object to get taxonomies of. Default current post. - * @type string $before Displays before the taxonomies. Default empty string. - * @type string $sep Separates each taxonomy. Default is a space. - * @type string $after Displays after the taxonomies. Default empty string. - * @type string $template Template for displaying a taxonomy label and list of - * terms. Default is "Label: Terms." - * @type string $term_template Template for displaying a single term in the list. - * Default is the term name linked to its archive. + * @type int|WP_Post $post Post ID or object to get taxonomies of. Default current post. + * @type string $before Displays before the taxonomies. Default empty string. + * @type string $sep Separates each taxonomy. Default is a space. + * @type string $after Displays after the taxonomies. Default empty string. * } + * @param array $args See {@link get_the_taxonomies()} for a description of arguments and their defaults. */ function the_taxonomies( $args = array() ) { $defaults = array( @@ -4152,10 +4150,6 @@ function the_taxonomies( $args = array() ) { 'before' => '', 'sep' => ' ', 'after' => '', - /* translators: %s: taxonomy label, %l: list of terms formatted as per $term_template */ - 'template' => __( '%s: %l.' ), - /* translators: %1$s: term link, %2$s: term name */ - 'term_template' => '%2$s', ); $r = wp_parse_args( $args, $defaults ); @@ -4172,7 +4166,14 @@ function the_taxonomies( $args = array() ) { * @since 2.5.0 * * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. - * @param array $args Override the defaults. + * @param array $args { + * Arguments about how to format the list of taxonomies. + * + * @type string $template Template for displaying a taxonomy label and list of terms. + * Default is "Label: Terms." + * @type string $term_template Template for displaying a single term in the list. Default is the term name + * linked to its archive. + * } * @return array List of taxonomies. */ function get_the_taxonomies( $post = 0, $args = array() ) {