From 90787e88230b78a40718456f96fa65775c32cd11 Mon Sep 17 00:00:00 2001 From: Andrew Ozz 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: https://develop.svn.wordpress.org/trunk@10636 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 ); }