How to Set a default Title for the custom post?

[php]
function wpl_lc_add_custom_title( $data, $postarr ) {
if($data[‘post_type’] == ‘wpl_lcp_shortcodes’) {
if(empty($data[‘post_title’])) {
$data[‘post_title’] = ‘Untitled Carousel’;
}
}
return $data;
}
add_filter(‘wp_insert_post_data’, ‘wpl_lc_add_custom_title’, 10, 2 );
[/php]

Now use the function
[php]
the_title();
[/php]