Add "rand" option to orderby

This commit is contained in:
pauloiankoski 2013-12-05 10:53:22 -02:00
parent 1f5f163916
commit 09d50a04c8
1 changed files with 3 additions and 0 deletions

View File

@ -485,6 +485,9 @@ class WC_Query {
$args['meta_key'] = '';
switch ( $orderby ) {
case 'rand' :
$args['orderby'] = 'rand';
break;
case 'date' :
$args['orderby'] = 'date';
$args['order'] = $order == 'ASC' ? 'ASC' : 'DESC';