How can get an array of the user ids of users who are level 1?
Array of level 1 user ids
I would delete this question but I don’t see any way to delete it.
Here is the answer
$args = array(‘role’ => ‘s2member_level1’,‘fields’ => array(‘id’));
$user_query = new WP_User_Query( $args );
// User Loop
if ( ! empty( $user_query->results ) ) {
foreach ( $user_query->results as $user ) {
$userids[]=$user->id;
}
} else {
echo ‘No users found.’;
}
$userids now has all the ids that are level 1.