user list with reputation

Solved2.21K viewsGeneral
0

Hi, is this code still works for display list of user order by reputation?

<?php

// Thsi query will order users by reputation by default.

$user_args = array(

‘ap_query’ => true,

‘role__not_in’ => [ ‘administrator’, ‘ap_moderator’ ],

‘number’ => $number,

);

$ap_user_query = get_users( $user_args );

Thanks.

Question is closed for new answers.
Selected answer as best
0

My solution to this:

<?php
       $user_args = array(
        'ap_query' => true,
        'role__not_in' => [ 'administrator', 'ap_moderator' ],
        'number' => $number,
        'orderby'      => 'meta_value_num',
              'meta_key'     => 'ap_reputations', 
        'order'        => 'DESC',
       );
        $loop = get_users( $user_args );

Selected answer as best