Hi!
You could use something like this:
function make_user_location_table() {
$users = get_users( array(
'fields' => array( 'id', 'display_name' ),
'meta_key' => 'whab_location_data'
));
$output = '<table><thead><tr><th>User</th><th>Location</th></tr></thead><tbody>';
foreach ( $users as $user ) {
$output .= '<tr><td>' . $user->display_name . '</td>';
$location = get_user_meta( $user->id, 'whab_location_data', true );
$output .= '<td>' . $location['location_name'] . '</td></tr>';
}
$output .= '</tbody></table>';
return $output;
}
add_shortcode( 'my_user_locations', 'make_user_location_table' );
Put this code into your theme’s functions.php
. Then use the shortcode my_user_locations
to display a table of all users that have set their location using Whereabouts.