update_post_meta problem. Don`t work with save_post action
-
Ive got a problem.
My code isn`t work inside functions.phpadd_action( 'save_post', 'createupdate_coords' ); function createupdate_coords($post_id = false, $post = false) { if ( !wp_is_post_revision( $post_id ) ) { $item_adress = get_post_meta($post_id, 'item_adress', true); if ($item_adress) { $lat_long_coords = getLatLong($item_adress); $lng = $lat_long_coords['long']; $lat = $lat_long_coords['lat']; update_post_meta($post_id, "item_google_lng", "$lng" ); update_post_meta($post_id, "item_google_lat", "$lat" ); } } }
“update_post_meta” function do nothing. Can somebody help me?
- The topic ‘update_post_meta problem. Don`t work with save_post action’ is closed to new replies.