<?php
add_filter( 'enter_title_here', 'prefix_change_title_placeholder_text' );
/**
* Change the placeholder text for the post title field.
*
* @param string $title Default placeholder text.
* @return string
*/
function prefix_title_placeholder_text( $title ) {
$post_type_object = get_post_type_object( get_post_type() );
if ( empty( $post_type_object->title_placeholder ) ) {
return $title;
}
return $post_type_object->title_placeholder;
}
<?php
// Add 'title_placeholder' to the array of arguments when registering the custom post type.
$cpt_args = array(
'title_placeholder' => 'Team member name',
);
register_post_type( 'team_members', $cpt_args );