Title: Update when post updated WPUF
Last modified: February 5, 2020

---

# Update when post updated WPUF

 *  Resolved [Michael](https://wordpress.org/support/users/bazzarello/)
 * (@bazzarello)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/update-when-post-updated-wpuf/)
 * Hello, how are you?
 * I am using the code below to integrate GEO my WP with the WP User Frontend plugin.
 * When a new post is created it works very well. But when editing the post the 
   address does not update automatically. In the field of WPUF it is updated, but
   in the field of GEO my WP, the first registered address always remains.
 * Can you help me with that?
 * =======
    CODE
 * function gmw_update_location_via_wpuf( $post_id ) {
 *  // make sure post ID exists.
    if ( ! $post_id ) { return; }
 *  // verify updater function.
    if ( function_exists( ‘gmw_update_post_location’)){
 *  // change meta_field_name to the custom field of the address field.
    $address
   = get_post_meta( $post_id, ‘cf_address’, true );
 *  //run geocoder function
    gmw_update_post_location( $post_id, $address ); } }//
   update data of new post add_action(‘wpuf_add_post_after_insert’, ‘gmw_update_location_via_wpuf’,
   10, 1 ); //update data when post updated add_action(‘wpuf_add_post_after_updated’,‘
   gmw_update_location_via_wpuf’, 10, 1 );

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Michael](https://wordpress.org/support/users/bazzarello/)
 * (@bazzarello)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/update-when-post-updated-wpuf/#post-12400380)
 * I managed to solve it by replacing the last line with this one:
 * add_action( ‘wpuf_edit_post_after_update’, ‘gmw_update_location_via_wpuf’, 10,
   1 );
 * see –> wpuf_EDIT
 * thanks
 *  [DenisCGN](https://wordpress.org/support/users/deniscgn/)
 * (@deniscgn)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/update-when-post-updated-wpuf/#post-12400541)
 * The Address Field of Wedevs changes.
    You need to split it before using the hook.
 * The field is now, address, lat, lng
 * Cheers,
    Denis
 *  Thread Starter [Michael](https://wordpress.org/support/users/bazzarello/)
 * (@bazzarello)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/update-when-post-updated-wpuf/#post-12402925)
 * Very Thanks!!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Update when post updated WPUF’ is closed to new replies.

 * ![](https://ps.w.org/geo-my-wp/assets/icon-256x256.gif?rev=2803407)
 * [GEO my WP](https://wordpress.org/plugins/geo-my-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geo-my-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geo-my-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/geo-my-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geo-my-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geo-my-wp/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/bazzarello/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/update-when-post-updated-wpuf/#post-12402925)
 * Status: resolved