Support

Account

Home Forums ACF PRO Is it possible to programmatically update a google map acf by lat/lang? Reply To: Is it possible to programmatically update a google map acf by lat/lang?

  • You are using WP all import, as I said, if you have the ACF extension for this plugin then it will handle the import for you and then there is no need to call any ACF function.

    If you want to do this yourself then update_field() https://www.advancedcustomfields.com/resources/update_field/ would be used, just like any other field. Make sure to read the important notes about using the field key vs. the field name when updating fields that do not exist. The value for using this function would be a value that matches what ACF normally stores in the database. In the case of a GM field it would be an array. Exactly what needs to be in the array I can’t really answer, I’ve never used a GM field or needed to update them if I did. You can figure this out by saving a value to a map field and looking at the value that is stored in the database, or you can run a test on the front end of the site.

    
    echo '<pre>'; print_r(get_field('your-field-name', false, false)); echo '</pre>';