Support Forum
I was looking at this link: and I am able to set the title to the field with this code BUT when I look at the URL for the post, the URL is ending with no-title when I look at the post from the back end.
Also, I want the post to have the title set to the same field when I save from the back end.
My code for the filter looks like this:
function set_member_title( $data ) {
if($data['post_type'] === 'announcement-cpt') {
$newPostTitle = $_POST['announcement_title'];
$data['post_title'] = $newPostTitle;
return $data;
}
}
add_filter( 'wp_insert_post_data' , 'set_member_title' , '99', 2 );