Hello
I need help by pulling data of google maps created by ACF and showing its address or lng lat.
this is the code to pull the data of the users
<?php
// The Query
$user_query = new WP_User_Query( array( ‘role’ => ‘Dj’ ) );
$map_location = get_field( ‘map_pin’ );
echo $map_location;
// User Loop
if ( ! empty( $user_query->results ) ) {
foreach ( $user_query->results as $user ) {
echo ‘<p>’ . $user->display_name . ‘</p>’;
}
} else {
echo ‘No users found.’;
}
?>
i tried to add the meta called acf slug “map-pin” and put it like this but i am getting error
echo ‘<p>’ . $user->map-pin[‘address’] . ‘</p>’;
any suggestions ?