From e5879ea923d8388ebca2024b5856eb8c98ff3d2a Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 13 Feb 2008 19:12:46 +0000 Subject: [PATCH] Add RAND order option to wp_tag_cloud(). Props fitzrev. fixes #5726 git-svn-id: http://svn.automattic.com/wordpress/trunk@6824 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 86a2c4042..4b780b8af 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -374,6 +374,13 @@ function wp_generate_tag_cloud( $tags, $args = '' ) { if ( 'DESC' == $order ) $counts = array_reverse( $counts, true ); + elseif ( 'RAND' == $order ) { + $keys = array_rand( $counts, count($counts) ); + foreach ( $keys as $key ) + $temp[$key] = $counts[$key]; + $counts = $temp; + unset($temp); + } $a = array();