The post object is passed by reference as the second parameter of the save_post
action (do_action ( 'save_post', int $post_ID, WP_Post $post, bool $update )
. You can use this post object to get the post date and author from.
You can try the following: (NOTE: The code is untested)
add_action( 'save_post', 'wpse_214927_alter_title', 10, 2 );
function wpse_214927_alter_title ( $post_id, $post_object )
{
// Target only specific post type
if ( 'my_specific_post_type' !== $post_object->post_type
&& 'my_other_specific_post_type' !== $post_object->post_type
)
return;
// Remove the current action
remove_action( current_filter(), __FUNCTION__ );
$post_date = $post_object->post_date;
$format_date = DateTime::createFromFormat( 'Y-m-d H:i:s', $post_date );
$date_formatted = $format_date->format( 'Y-m-d' ); // Set correct to display here
$post_author = $post_object->post_author;
$author_name = get_the_author_meta( 'display_name', $post_author ); // Adjust as needed
$my_post = [
'ID' => $post_id,
'post_title' => $author_name . ' Job ' . $date_formatted // Change as needed
];
wp_update_post( $my_post );
}
Just an important note, you should add validation and sanitation where needed