I had one more look at the code and I realized the save function was missing couple of checks. So replace meta_boxes.php:366 with this,
if ( empty( $_POST['nonce_car_details'] ) ) {
return;
}
check_admin_referer( 'save_car_details_meta', 'nonce_car_details' );
if ( ! current_user_can( 'edit_post', $post_id ) ) {
return;
}
if ( wp_is_post_autosave( $post_id ) ) {
return;
}
if ( wp_is_post_revision( $post_id ) ) {
return;
}
The key thing here is the empty
check for nonce. Nonce value is probably not set when the post is trashed, which causes check_admin_referer
to fail thus printing the error message. My apologies, this was my bad.
You could also switch to using the post type specific save action so the metabox saving functions gets only fired when the correct post type in question.
add_action('save_post_listings', 'wpt_save_details_meta', 1, 2);
P.S. on custom-taxonomies.php lines 3-29 should probably be inside create_listings_taxonomies()
along with the other register_taxonomy
calls.