Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

users

// WP_User_Query arguments
$args = array(
	'role'           => 'Subscriber',
	'order'          => 'DESC',
	'orderby'        => 'user_registered',
	'meta_query'     => array(
		array(
			'key'     => 'wh_onboarding_group',
			'value'   => 'digital-pass',
		),
	),
);

// The User Query
$applicants = new WP_User_Query( $args );

// The User Loop
if ( ! empty( $applicants->results ) ) {
	foreach ( $applicants->results as $user ) {
		// do something
	}
} else {
	// no users found
}