Hi all,
Im stuck with the saving of custom meta for my custom post type.
When the meta is filled with content it will save just fine but if I deleted the content of the meta it wont delete in the database/meta, so it can not be empty.
Here is the code.
add_action('save_post', 'save_details');
function save_details($post_id){
global $post;
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
return $post_id;
if (isset($_POST["subtitle"]) && $_POST["subtitle"] <> '') update_post_meta($post->ID, "subtitle", $_POST["subtitle"]);
if (isset($_POST["youtube"]) && $_POST["youtube"] <> '') update_post_meta($post->ID, "youtube", $_POST["youtube"]);
if (isset($_POST["call_in"]) && $_POST["call_in"] <> '') update_post_meta($post->ID, "call_in", $_POST["call_in"]);
}
Can does some one know how to fix this?