title: Set default title for Wordpress Custom Post Types?
body: <p>I have a Wordpress custom post type "Featured Book", which uses a subtitle to specify title of the book. Eg: "Featured Book: The Hunger Games"</p>
  
  <p>Is it possible to automatically set the title of the post as "Featured Book" ?</p>
  
  <p>I found this code through Googling but it does not work (Wordpress backend returns a blank page/white screen of death)</p>
  
  <p>Is there some syntax error in the code, or is this just not possible?</p>
  
  <pre><code>function add_custom_title( $data, $postarr ) {
    if($data['post_type'] == 'featured-book') {
      if(empty($data['post_title'])) {
        $data['post_title'] = 'Featured Book';
      }
    }
    return $data;
  }
  add_filters('wp_insert_post_data', 'add_custom_title', 10, 2 );
  </code></pre>