Oxygen is installed but I am testing without using Oxygen Templates - just viewing the pages from the page editor.
1) Using the updated Front End Submission plugin
2) I want to update these AS the post is either saved or updated
3) I am using this code to update these two items AS the post is saved
function update_post_data ( $data ) {
if ( get_post_type( get_the_ID() ) == 'announcements-cpt' ) {
$user_object = get_user_by( 'login', 'staff' );
$data['post_author'] = $user_object->ID;
$data['post_title'] = $_POST['announcements_title'];
}
return $data;
}
add_filter( 'wp_insert_post_data', 'update_post_data', 10, 3 );
It works as expected for posts saved on the Back End but not Front End
How can I update these two items when using the Front End Submission form?