I have a custom post type, called 'status' and I have disabled 'title' in the post type. Right now it's setting all posts to have the title "Auto Draft". I want to set up a way to set the title to be the post's date. I think I should be using 'wp_insert_post_data". Right now I am using the following code but it is not working:
function status_title_filter( $data , $postarr )
{
if ($postarr['post_type'] == 'status'){
$date = $data['post_date'];
$data['post_title'] = $date;
}
return $data;
}
add_filter( 'wp_insert_post_data' , 'status_title_filter' , '99' );
Thanks in advance for solving my simple problem. I'm a sort of novice when it comes to this kind of things.