display Wordpress query results from array not working

hello,

I am trying to echo the results of a Wordpress query in a loop. My query seems to be working because if I do a var_dump I get pages and page of results, but I can't seem to echo the first name

$user_query = new WP_User_Query( array( 'meta_key' => 'member_level', 'meta_value' => 'full' ) );

foreach ( $user_query as $my_users ) {
echo $my_users->first_name;
}

Open in new window

LVL 1
jblayneyAsked:
Who is Participating?
 
Jan LouwerensSoftware EngineerCommented:
Do you need to call the get_results() method of the WP_User_Query object, instead of treating it like a "loop"?
0
 
jblayneyAuthor Commented:
thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.