I dont understand what is wrong my code is just not working, I have tried with different $args but still no user displays.

Following is my code:

$args = array(
    'role__in' => array('Subcriber', 'Editor','Administrator'),
$user_query = new WP_User_Query( $args );
$reslult = $user_query->results;
// User Loop
if ( ! empty( $user_query->results ) ) {
    foreach ( $user_query->results as $user ) {
        echo '<p>' . $user->display_name . '</p>';
} else {
    echo 'No users found.';

Result is always no user found.

closed as off-topic by RRikesh, Max Yudin, Christine Cooper, cjbj, Rarst Oct 26 '17 at 10:27

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?" – RRikesh, Max Yudin, Christine Cooper, Rarst
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Subcriber is spelt wrong. Needs to be Subscriber. Does that help? – Jacob Peattie Oct 15 '17 at 7:28

See the example code on this URL

Correct the spelling Subscriber

Not the answer you're looking for? Browse other questions tagged or ask your own question.