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

  • Hello Kidcajes,

    If you use the get_field method, you will get the fields as an array. For some reason I can’t remember, we decided to serialize into json when saving, instead of as an array, like most other plugins does, so if you want to use get_the_author_meta, then you’ll have to json_decode($raw_data, true) to get it out as an array. But I would suggest sticking with the official get_field()-method from ACF. It does support fetching author meta, so there’s no reason to fetch it straight out of WordPress. Using the official ACF-API ensures that any additional data/parsing/restructuring, will be passed along to your functions.

    In your case, the working code would be something like:

    $var = get_field('locations', 'user_'.get_current_user_id());

    and then the $var would contain an array like you expect.

    Kind regards,<br />Morten Skyt