When an admin saves a post from my custom post type jobs
, i do not want the content field(the large 'description' field) from saving.
To explain - when an admin saves a post from the jobs
post type all the custom fields, date field etc. should save but the standard content field should stay the same without being saved.
I've found the pre_post_update
hook, but i do not know what to do now.
This is my code so far.
add_action( 'pre_post_update', 'prefix_prevent_job_description_admin_save' );
function prefix_prevent_job_description_admin_save( $post_id, $data ) {
if ( 'jobs' !== get_post_type( $post_id ) ) return;
// Here i should probably use the $data array to get the content and prevent it from saving, but i do not know how to go from here.
}
Thanks in advance.