• Hello I am trying to count users in a specific role.
    I used the example and it works fine but how would I go about just counting one specific role. In the case the role id is “rlgw”

    <?php
    $result = count_users();
    echo 'There are ', $result['total_users'], ' total users';
    foreach($result['avail_roles'] as $role => $count)
        echo ', ', $count, ' are ', $role, 's';
    echo '.';
    ?>

    Thanks in advance!.

  • The topic ‘Count users by specific role.’ is closed to new replies.