Is it possible to use wp_query to create a list of all the WordPress users for a site and their data? If so, how?
I want to be able to list ALL the users (the site is open to new registrations) and all their details such as name, username etc as well as some custom meta’s that I’ve added in the format:
function my_user_contactmethods($user_contactmethods) {
$user_contactmethods['Address'] = __('Address');
$user_contactmethods['Website'] = __('Website');
$user_contactmethods['Phone'] = __('Phone');
$user_contactmethods['Nationality'] = __('Nationality');
$user_contactmethods['Registering as'] = __('Registering as');
$user_contactmethods['Submit work'] = __('Submit work?');
$user_contactmethods['Attend'] = __('Attend?');
$user_contactmethods['Volunteer'] = __('Volunteer?');
// etc for each field you want to appear
return $user_contactmethods;
}
Or if there’s another way to do it then I’m completely open.
If you are okay with not using
wp_query, you can useget_usersandget_user_metato retrieve list of all users and their custom data.For example,
You can retrieve the fields that you want. Or you can just add all data and attach your custom fields with them.