From b8b2f2115b0845b9651956d19a8c0dc3e5d18bda Mon Sep 17 00:00:00 2001 From: azaozz Date: Mon, 23 Feb 2009 09:12:59 +0000 Subject: [PATCH] Fix wp_tag_cloud 'RAND' when only one tag, props DD32, fixes #9214 git-svn-id: http://svn.automattic.com/wordpress/trunk@10636 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index d84e016dac..b385216c22 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -659,10 +659,13 @@ function wp_generate_tag_cloud( $tags, $args = '' ) { if ( 'DESC' == $order ) $tags = array_reverse( $tags, true ); elseif ( 'RAND' == $order ) { - $keys = array_rand( $tags, count( $tags ) ); + $keys = (array) array_rand( $tags, count( $tags ) ); + $temp = array(); foreach ( $keys as $key ) $temp[$key] = $tags[$key]; + $tags = $temp; + $temp = null; unset( $temp ); }