Clarify the return value of wp_generate_tag_cloud().
props SergeyBiryukov, DrewAPicture. fixes #27487. Built from https://develop.svn.wordpress.org/trunk@27708 git-svn-id: http://core.svn.wordpress.org/trunk@27547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f9fd129f28
commit
bc6f50d09a
|
@ -665,7 +665,7 @@ function default_topic_count_scale( $count ) {
|
||||||
*
|
*
|
||||||
* @param array $tags List of tags.
|
* @param array $tags List of tags.
|
||||||
* @param string|array $args Optional, override default arguments.
|
* @param string|array $args Optional, override default arguments.
|
||||||
* @return string
|
* @return string|array Tag cloud as a string or an array, depending on 'format' argument.
|
||||||
*/
|
*/
|
||||||
function wp_generate_tag_cloud( $tags, $args = '' ) {
|
function wp_generate_tag_cloud( $tags, $args = '' ) {
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
|
@ -678,8 +678,11 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
|
||||||
$args = wp_parse_args( $args, $defaults );
|
$args = wp_parse_args( $args, $defaults );
|
||||||
extract( $args, EXTR_SKIP );
|
extract( $args, EXTR_SKIP );
|
||||||
|
|
||||||
if ( empty( $tags ) )
|
$return = ( 'array' === $format ) ? array() : '';
|
||||||
return;
|
|
||||||
|
if ( empty( $tags ) ) {
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
// Juggle topic count tooltips:
|
// Juggle topic count tooltips:
|
||||||
if ( isset( $args['topic_count_text'] ) ) {
|
if ( isset( $args['topic_count_text'] ) ) {
|
||||||
|
@ -791,9 +794,11 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
|
||||||
*
|
*
|
||||||
* @see wp_generate_tag_cloud()
|
* @see wp_generate_tag_cloud()
|
||||||
*
|
*
|
||||||
* @param string $return Generated HTML output of the tag cloud.
|
* @param array|string $return String containing the generated HTML tag cloud output
|
||||||
* @param array $tags An array of terms used in the tag cloud.
|
* or an array of tag links if the 'format' argument
|
||||||
* @param array $args An array of wp_generate_tag_cloud() arguments.
|
* equals 'array'.
|
||||||
|
* @param array $tags An array of terms used in the tag cloud.
|
||||||
|
* @param array $args An array of wp_generate_tag_cloud() arguments.
|
||||||
*/
|
*/
|
||||||
return apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args );
|
return apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue