Implemeting orderby array with numeric meta values
-
Hi all
I need to order the results of this query by multiple meta key values. Firstly by wpum_total_fb_reviews and then by wpum_curr_fb_rating. In the near future, I’ll need to add a third orderby meta value as well. I can get the orderby to work with just one meta key value, but not by any more. I have tried the recently introduced orderby array function, but can’t get that to work at all. The results still display, but in no desired order. Can anyone help me here?
$args = array( 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'wpum_select_cat', 'value' => $cat, 'compare' => 'LIKE', ), array( 'key' => 'wpum_metro_region', 'value' => $loc, 'compare' => 'LIKE', ), array( 'key' => 'wpum_curr_fb_rating', 'value' => '4.0', 'type' => 'numeric', 'compare' => '>=', ), array( 'key' => 'wpum_total_fb_reviews', 'value' => '4', 'type' => 'numeric', 'compare' => '>=', ) ), 'orderby' => 'meta_value_num', 'order' => 'DESC', 'meta_key' => 'wpum_total_fb_reviews', ); $user_query = new WP_User_Query( $args );
Thank you in advance.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Implemeting orderby array with numeric meta values’ is closed to new replies.