Support

Account

Home Forums ACF PRO Save certain Google Maps data into custom field

Unread

Save certain Google Maps data into custom field

  • Hi all

    I have a google maps field with the name “location”, everytime somebody changes that field, I want that the a specific part of the google maps data (state_short) is saved to another ACF field with the name state_short.

    I tried doing it this way, but doesnt work.

    
    function update_state_short( $value, $post_id, $field ) {
    
        update_post_meta( $post_id, 'state_short', $value['state_short'] );
        return $value;
    }
    add_action('acf/update_value/key=field_5e5a38be195bc', 'update_state_short', 10, 3  );
    

    How is that possible?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.