if ( !
empty( $this->meta_query->queries
) ) { $clauses =
$this->meta_query->
get_sql( 'post',
$wpdb->posts, 'ID',
$this );
$join .=
$clauses['join'
];
$where .=
$clauses['where'
];
} $rand =
( isset( $q['orderby'
] ) && 'rand' ===
$q['orderby'
] );
if ( !
isset( $q['order'
] ) ) { $q['order'
] =
$rand ? '' : 'DESC';
} else { $q['order'
] =
$rand ? '' :
$this->
parse_order( $q['order'
] );
} // These values of orderby should ignore the 'order' parameter.
$force_asc = array
( 'post__in', 'post_name__in', 'post_parent__in'
);
if ( isset( $q['orderby'
] ) &&
in_array( $q['orderby'
],
$force_asc, true
) ) { $q['order'
] = '';
} // Order by.
if ( empty( $q['orderby'
] ) ) { /*
* Boolean false or empty array blanks out ORDER BY,
* while leaving the value unset or otherwise empty sets the default.
*/