我试图在查询时显示用户,但我想按用户角色显示订单。假设我们有两个用户角色,Gold和Free。我想先显示黄金用户,然后显示自由用户。
$args = array(
\'order\' => \'ASC\',
\'orderby\' => \'display_name\',
\'role__not_in\' => \'administrator\',
\'posts_per_page\' => 10,
\'meta_query\' => array(
\'relation\' => \'OR\',
array(
\'key\' => \'pin_code\',
\'value\' => sanitize_text_field($_GET[\'pin_code\']),
\'compare\' => \'LIKE\'
),
array(
\'key\' => \'city\',
\'value\' => sanitize_text_field($_GET[\'pin_code\']),
\'compare\' => \'LIKE\'
),
array(
\'key\' => \'county\',
\'value\' => sanitize_text_field($_GET[\'pin_code\']),
\'compare\' => \'LIKE\'
),
)
);
// Create the WP_User_Query object
$wp_user_query = new WP_User_Query($args);
我不知道如何在query arg中实现这一点。