Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Anh Tran

    (@rilwis)

    Currently it’s not possible.

    I’d suggest you create a new field which inherits from map, but save LAT and LNG into 2 more fields. I wrote a documetation for creating a custom field, please take a look.

    To do what you want, I think all you need is just add save method, like this:

    function save( $new, $old, $post_id, $field )
    {
        parent::save( $new, $old, $post_id, $field );
    
        list( $lat, $lng, $zoom ) = explode( ',', $new . ',' );
        add_post_meta( $post_id, $field['id'] . '_lat', $lat );
        add_post_meta( $post_id, $field['id'] . '_lng', $lng );
    }

    It will save LAT, LNG in 2 custom fields: $field['id'] . '_lat' and $field['id'] . '_lng'.

    Thread Starter nattila

    (@nattila)

    Thank you very much. It’s great.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Save maps gps into separate meta fields’ is closed to new replies.