diff --git a/wp-includes/category.php b/wp-includes/category.php index 07bc0d1e0a..0e671ffa89 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -280,10 +280,14 @@ function sanitize_category_field( $field, $value, $cat_id, $context ) { * Retrieves all post tags. * * @since 2.3.0 - * @see get_terms() For list of arguments to pass. * - * @param string|array $args Tag arguments to use when retrieving tags. - * @return WP_Term[]|int $tags Array of 'post_tag' term objects, or a count thereof. + * @param string|array $args { + * Optional. Arguments to retrieve tags. See get_terms() for additional options. + * + * @type string $taxonomy Taxonomy to retrieve terms for. Default 'post_tag'. + * } + * @return WP_Term[]|int|WP_Error $tags Array of 'post_tag' term objects, a count thereof, + * or WP_Error if any of the taxonomies do not exist. */ function get_tags( $args = '' ) { $defaults = array( 'taxonomy' => 'post_tag' ); @@ -292,20 +296,20 @@ function get_tags( $args = '' ) { $tags = get_terms( $args ); if ( empty( $tags ) ) { - $return = array(); - return $return; + $tags = array(); + } else { + /** + * Filters the array of term objects returned for the 'post_tag' taxonomy. + * + * @since 2.3.0 + * + * @param WP_Term[]|int|WP_Error $tags Array of 'post_tag' term objects, a count thereof, + * or WP_Error if any of the taxonomies do not exist. + * @param array $args An array of arguments. @see get_terms() + */ + $tags = apply_filters( 'get_tags', $tags, $args ); } - /** - * Filters the array of term objects returned for the 'post_tag' taxonomy. - * - * @since 2.3.0 - * - * @param WP_Term[]|int $tags Array of 'post_tag' term objects, or a count thereof. - * @param array $args An array of arguments. @see get_terms() - */ - $tags = apply_filters( 'get_tags', $tags, $args ); - return $tags; } diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 1693bad778..c8f2d4efa1 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1133,11 +1133,11 @@ function get_term_to_edit( $id, $taxonomy ) { * * @param array|string $args Optional. Array or string of arguments. See WP_Term_Query::__construct() * for information on accepted arguments. Default empty. - * @param array|string $deprecated Argument array, when using the legacy function parameter format. If present, this - * parameter will be interpreted as `$args`, and the first function parameter will - * be parsed as a taxonomy or array of taxonomies. - * @return WP_Term[]|int|WP_Error List of WP_Term instances and their children. Will return WP_Error, if any of taxonomies - * do not exist. + * @param array|string $deprecated Argument array, when using the legacy function parameter format. If present, + * this parameter will be interpreted as `$args`, and the first function parameter + * will be parsed as a taxonomy or array of taxonomies. + * @return WP_Term[]|int|WP_Error Array of WP_Term instances, a count thereof, + * or WP_Error if any of the taxonomies do not exist. */ function get_terms( $args = array(), $deprecated = '' ) { $term_query = new WP_Term_Query(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 10d7f15fe3..08dee928b9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47929'; +$wp_version = '5.5-alpha-47930'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.