Skip to content

Instantly share code, notes, and snippets.

@patric-boehner
Last active June 9, 2018 21:13
Show Gist options
  • Save patric-boehner/9275ae49fe9b61244741e196a6dc199f to your computer and use it in GitHub Desktop.
Save patric-boehner/9275ae49fe9b61244741e196a6dc199f to your computer and use it in GitHub Desktop.
Change the title placeholder text for a custom post type
<?php
// Don't include opening php tag
//* Change Post Editor Placeholder Text
//**********************
add_filter( 'enter_title_here', 'pb_change_placeholder_title_text' );
function pb_change_placeholder_title_text( $title ){
$screen = get_current_screen();
if( isset( $screen->post_type ) ) {
if ( 'testimonials' == $screen->post_type ) {
$title = 'Clients name';
} elseif ( 'portfolios' == $screen->post_type ) {
$title = 'Portfolio name';
}
}
return $title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment