Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('save_post','heymap_post_save');
- function heymap_post_save($post_id) {
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
- return;
- if ( !wp_verify_nonce( $_POST['heymap_post_class_nonce'], plugin_basename(dirname(__FILE__)) ) )
- return;
- if ( !current_user_can( 'edit_post', $post_id ) )
- return;
- if ( is_numeric( $_POST["heymap-position-lat"] )) update_post_meta($post_id, "heymap-position-lat", $_POST["heymap-position-lat"]);
- if ( is_numeric( $_POST["heymap-position-lon"] )) update_post_meta($post_id, "heymap-position-lon", $_POST["heymap-position-lon"]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement