pbs_save_content_data

A filter to modify the post data to be saved. This is called when a save was initiated from the PBS editor.

Parameters

$post_data

Array. The final post data to be saved, this is passed directly to wp_update_post() afterwards.

$_POST

Array. The raw post data sent from the editor for saving. This has already been nonce verified.

$post_id

Int. The post id which we are saving.

Example

add_filter( 'pbs_save_content_data', 'save_always_as_draft', 10, 3 );

function save_always_as_draft( $post_data, $_post, $post_id ) {

	// For some reason, we always want the post to be a draft.
	$post_data['post_status'] = 'draft';
	
	return $post_data;
}

Still need help? Contact Us Contact Us