[wp-testers] Custom fields are deleted from custom post types with "Quick Edit"

Brennan brenjt at gmail.com
Wed Jun 23 00:25:37 UTC 2010


Hello,

What you need to do is in your custom meta 
box function add a hidden field as such 

<input type="hidden" name="custom_field_name" id="custom_field_name_noncename"
value="' . wp_create_nonce( plugin_basename(__FILE__) ) . '" />

then in your save_post hook add this:

if ( !wp_verify_nonce( $_POST['page_post_caption_noncename'],
plugin_basename(__FILE__) )) {
return $post_id;
}
	
// verify if this is an auto save routine. If it is our form has not been
submitted, 
//so we dont want to do anything
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) 
return $post_id;

Brennan




More information about the wp-testers mailing list