Last active
January 15, 2019 14:26
-
-
Save tiborp/8a9b00cb1ceeafffb179c7cc7d75df61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// WP_User_Query arguments | |
$args = array( | |
'role' => 'subscriber', | |
'number' => '10', | |
'order' => 'ASC', | |
'orderby' => 'id', | |
); | |
// The User Query | |
$user_query = new WP_User_Query( $args ); | |
// The User Loop | |
if ( ! empty( $user_query->results ) ) { | |
foreach ( $user_query->results as $user ) { | |
// do something | |
} | |
} else { | |
// no users found | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment