0

In wordpress how to sort data when I use WP_User_Query.

this is code:

$query_args = array('role' => 'dc_sub_vendor');
$meta_query = array(
    'relation' => 'AND',
                    array(
                        'key' => ($is_vendor) ? '_vendor_term_id' : '_vendor_division_id',
                        'value' => ($is_vendor) ? get_user_meta($current_vendor->ID, '_vendor_term_id', true) : get_user_meta($current_vendor->ID, '_vendor_division_id', true),
                        'compare' => '=',
                    ),
                );
if (!$is_vendor)
    //array_push($meta_query, array('key' => $wpdb->prefix.'capabilities','value' => '"bsly_sup_master_division"','compare' => '!=',));
    $query_args['role__not_in'] = 'bsly_sup_master_division';
    $query_args['meta_query'] = $meta_query;
    $user_query = new WP_User_Query($query_args);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.