Populate Post Title with ACF field value
//Auto add and update Title field:
function my_post_title_updater( $post_id ) {
$my_post = array();
$my_post['ID'] = $post_id;
// custom post type
if ( get_post_type() == 'case_study' ) {
$my_post['post_title'] = get_field('case_study_title');
}
// Update the post into the database
wp_update_post( $my_post );
}
// run after ACF saves the $_POST['fields'] data
add_action('acf/save_post', 'my_post_title_updater', 20);
//END Auto add and update Title field: