Up to 50 percent off

Google Maps – store address and coordinates

This topic contains 4 reply and 2 voices, and was last updated by chrishanratty 11 years, 3 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
July 27, 2013 at 7:28 pm 6382
chrishanratty 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.
July 28, 2013 at 12:56 am 6391
Tareq Hasan Tareq Hasan

Check here

July 28, 2013 at 1:22 am 6392
chrishanratty chrishanratty

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.

July 28, 2013 at 1:26 am 6393
Tareq Hasan Tareq Hasan

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

July 28, 2013 at 1:45 am 6395
chrishanratty chrishanratty

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

Viewing 4 Posts - 1 through 4 (of 4 total)