diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 647e651ed5..dd0c71949a 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -321,10 +321,16 @@ function wp_tag_cloud( $args = '' ) { return; $return = wp_generate_tag_cloud( $tags, $args ); // Here's where those top tags get sorted according to $args + if ( is_wp_error( $return ) ) return false; - else - echo apply_filters( 'wp_tag_cloud', $return, $args ); + + $return = apply_filters( 'wp_tag_cloud', $return, $args ); + + if ( 'array' == $args['format'] ) + return $return; + + echo $return; } // $tags = prefetched tag array ( get_tags() )