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
This commit is contained in:
Andrew Ozz 2009-02-23 09:12:59 +00:00
parent 05d5a09814
commit 90787e8823
1 changed files with 4 additions and 1 deletions

View File

@ -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 );
}