Home Forums Plugin Support WP User Frontend (Free Version) Google Maps – store address and coordinates

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  chrishanratty 5 years, 10 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #6382

    chrishanratty
    Participant
    Post count: 7

    Hi, Great plugin, I am loving it a lot. Thanks so much.

    I have a question about the google maps field.

    I need to store the address, not just the coordinates of the location. So that the address and corresponding map can be displayed in the post.

    Any ideas how I can do this. I could just store the address in a custom text field, and use another plugin to display the map, but I really like the map in the add post front-end.

    Is there a way to enter the address in a custom field, then have it pass the data to the google map field? Or is there a way to store both the address and the co-ordinates in the google map field?

    Any ideas would be appreciated. Thanks.

    #6391

    Tareq Hasan
    Keymaster
    Post count: 2831
    #6392

    chrishanratty
    Participant
    Post count: 7

    Thats brilliant. I added this code as advised;

    function wpufe_inesrt_address( $post_id ) {
    if ( isset( $_POST[‘find-address'] ) ) {
    update_post_meta( $post_id, ‘address', $_POST[‘find-address'] );
    }
    }
    add_action( ‘wpuf_add_post_after_insert', ‘wpufe_inesrt_address' );
    add_action( ‘wpuf_edit_post_after_update', ‘wpufe_inesrt_address' );

    and it works great. ๐Ÿ™‚ ๐Ÿ™‚ ๐Ÿ™‚

    One last little thing?

    Is there a way that I can populate the “find-address” field from the value stored in on the ‘address' field when the form loads in post-edit mode?

    That would be the finishing touch.

    Many Thanks for your speedy response.

    #6393

    Tareq Hasan
    Keymaster
    Post count: 2831

    Well, populating the address field isn't possible, as this was not meant for updating address. Its for finding a location only.

    #6395

    chrishanratty
    Participant
    Post count: 7

    Ok. I will try to work around that. Thanks for your help.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Google Maps – store address and coordinates’ is closed to new replies.