I have a custom post type with no Title field. These are short status messages, where only the content matters. The RSS feed and permalink display the title as Auto Draft, which is not very useful. Ideally, it would have the post content, or at least the first 10 or so words.
I’ve tried this function, but it still appears as Auto Draft:
add_filter('title_save_pre', 'save_title');
function save_title($my_post_title) {
    if ($_POST['post_type'] == 'servicestatus') :
     $new_title = wp_trim_words( $_POST['content'], $num_words = 10, $more = null )
     $my_post_title = $new_title;
    endif;
    return $my_post_title;
}
add_filter('name_save_pre', 'save_name');
function save_name($my_post_name) {
    if ($_POST['post_type'] == 'servicestatus') :
     $new_name = wp_trim_words( $_POST['content'], $num_words = 10, $more = null )
     $my_post_name = $new_name;
    endif;
    return $my_post_name;
}
I think
save_post
action hook is the proper one. Maybe you’ll want to insert some checking if the post title is already set ($post_object->post_title
), as this code always update the title according to the content.