The problem is that users for whom votes_total
doesn’t exist are getting skipped. See below:
$args = array(
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'votes_total',
'compare' => '>',
'value' => 0,
),
array(
'key' => 'votes_total',
'compare' => 'NOT EXISTS',
'value' => 0,
),
),
'meta_key' => 'votes_total',
'orderby' => 'meta_value_num',
'order' => 'DESC'
);
$users = get_users($args);