When editing a post, the title field displays the placeholder “Enter title here” (it’s actually a label element that’s made to look like a placeholder attribute, but whatever). I have a custom post type where I’m using the title for something specific and I want to make it clearer what it is. Is there any way to modify this field or the way it’s outputted?

I couldn’t find any filter for this. I could hook after it with edit_form_after_title, but I want to modify the field itself. I could remove the title field and use my own, but I want it to have the appearance of WordPress’s title field.

1 Answer
1

You can add following code to your functions.php in the Theme-folder.
Change the Custom Post Type(movie) name and the title to your wishes.

function wpse213979_new_title_text( $title, $post ){ 
   if  ( 'movie' == $post->post_type ) { // Movie is the cpt name
      $title="Enter movie name"; // The text you want to be shown
   }

   return $title;
}
add_filter( 'enter_title_here', 'wpse213979_new_title_text', 10, 2 );

The code
reference

Hope this is what you where looking for.

Leave a Reply

Your email address will not be published. Required fields are marked *