You need to check for autosave
and avoid that , also check if you are in the right post type as save_post
works on all posts:
function save_custom_details( $post_id ) {
global $post;
//skip auto save
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return $post_id;
}
//check for you post type only
if( $post->post_type == "sorbets" ) {
if( isset($_POST['proddescr']) ) { update_post_meta( $post->ID, 'proddescr', $_POST['proddescr'] );}
if( isset($_POST['ingredients']) ) { update_post_meta( $post->ID, 'ingredients', $_POST['ingredients'] );}
}
}
WOW you guys are fast 🙂