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
This commit is contained in:
parent
daf0d9a7e9
commit
e5879ea923
|
@ -374,6 +374,13 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
|
||||||
|
|
||||||
if ( 'DESC' == $order )
|
if ( 'DESC' == $order )
|
||||||
$counts = array_reverse( $counts, true );
|
$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();
|
$a = array();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue