WP Geo

A- A+

This is an integration with WP Geo plugin.

Paste this snippet in your themes and insert a Google Maps field with a meta keylocation_map. If you want to put a geo title, insert a custom text field with the meta key in the form.

[php] function wpufe_update_wp_geo( $post_id ) {
if ( isset( $_POST[‘location_map'] ) ) {
list( $lat, $long ) = explode(‘,', $_POST[‘location_map']);

update_post_meta( $post_id, WPGEO_LATITUDE_META, $lat );
update_post_meta( $post_id, WPGEO_LONGITUDE_META, $long );
}

if ( isset( $_POST[‘geo_title'] ) ) {
update_post_meta( $post_id, WPGEO_TITLE_META, $_POST[‘geo_title'] );
}
}

add_action( ‘wpuf_add_post_after_insert', ‘wpufe_update_wp_geo' );
add_action( ‘wpuf_edit_post_after_update', ‘wpufe_update_wp_geo' );
[/php]