Skip to content

Pronamic Google Maps

If you like Pronamic Google Maps and want to use them along with WP User Frontend PRO, then there is a solution. You can still use the WP User Frontend's Google Map custom field, and use the function below, which would also update the pronamic plugin's Google Map latitude and longitude and work seamlessly.

[php] function wpuf_pronamic_location( $post_id ) {
$custom_field = ‘address';

if ( !class_exists(‘Pronamic_Google_Maps_Post') ) {
return;
}

if ( isset( $_POST[$custom_field] ) ) {
$address = $_POST[$custom_field];

list( $def_lat, $def_long ) = explode( ‘,', $address );

if ( $def_lat ) {
update_post_meta( $post_id, Pronamic_Google_Maps_Post::META_KEY_LATITUDE, $def_lat );
}

if ( $def_long ) {
update_post_meta( $post_id, Pronamic_Google_Maps_Post::META_KEY_LONGITUDE, $def_long );
}

if ( $def_lat && $def_long ) {
update_post_meta( $post_id, Pronamic_Google_Maps_Post::META_KEY_ACTIVE, true );
}
}
}

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

WAIT! Don’t Miss Our Biggest Sale of the Year!

BlackFriday

EarlyDeals

Save Up To

81%

on weDevs Products

Hurry! This massive deal disappears when the timer runs out.

00Days00Hour00Min00Sec
Claim Yours & Save Up To 81%