Google Maps Field Question

Support General Google Maps Field Question

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #40214
    Donna EnrightDonna Enright
    Participant

    Hi Folks,

    We have a use case where CPT posts are being created via Formidable Forms submissions and that plugin's create post action. The CPT in question has a Google Map field attached to it.

    When Formidable creates the posts, all of the other custom fields that are mapped to the CPT are populating fine. But the Google Map does not. At this point, we have to manually go into each newly created post and click the update button for that to happen.

    I'm familiar with the rwmb_{custom-field}_after_save_field hook.

    Is there a way using that hook to get the Google Map field to parse the associated address field data and populate the database entry for the field?

    Thanks.

    #40231
    PeterPeter
    Moderator

    Hello Donna,

    The map fields (Google map and OSM) save the location in the following format latitude,longitude,zoom (you can also check it in the database). You can contact Formidable Forms to ask them which data is processed after submitting the form. Then you can use the function rwmb_set_meta() or update_post_meta() to set/update the field value with the correct format.

    Please read more on the documentation
    https://docs.metabox.io/fields/map/#data
    https://docs.metabox.io/functions/rwmb-set-meta/
    https://developer.wordpress.org/reference/functions/update_post_meta/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.