Support

Account

Home Forums General Issues New free Google Maps-plugin Reply To: New free Google Maps-plugin

  • This is one of the very useful plugin in ACF. But I’m just wondering why can’t I pull the values from the field into the front-end. I added the field locations to the user profile.

    I tried using this:

    $values = get_field(‘locations’);
    $lat = $values[‘lat’];
    $lng = $values[‘lng’];
    $address = $values[‘address’];

    tried echoing $address, but to no avail.

    So what I did was replace get_field with get_the_author_meta, to make it work like this:

    $values = get_the_author_meta(‘locations’);
    echo $values;

    I echoed out $values and returns:
    {“address”:”beverly hills”,”lat”:34.072856123839486,”lng”:-118.40037775767212,”zoom”:16}

    But my problem is when i used this;
    $lat = $values[‘lat’];
    $lng = $values[‘lng’];
    $address = $values[‘address’];
    echo $address;

    Nothing is returned. What could be the problem? Can you help with this?

    Or how am i suppose to break the returned
    {“address”:”beverly hills”,”lat”:34.072856123839486,”lng”:-118.40037775767212,”zoom”:16}
    into three attributes (address, lat, lng)?

    I’m looking forward to hear from you.

    Cheers!