WordPress.org

Make WordPress Core

Ticket #5726: rand.diff

File rand.diff, 498 bytes (added by fitztrev, 8 years ago)
  • wp-includes/category-template.php

     
    373373 
    374374        if ( 'DESC' == $order ) 
    375375                $counts = array_reverse( $counts, true ); 
     376        elseif ( 'RAND' == $order ) { 
     377                $keys = array_rand( $counts, count($counts) ); 
     378                foreach ( $keys as $key ) 
     379                        $temp[$key] = $counts[$key]; 
     380                $counts = $temp; 
     381        } 
    376382 
    377383        $a = array(); 
    378384