Last active
June 9, 2018 21:13
-
-
Save patric-boehner/9275ae49fe9b61244741e196a6dc199f to your computer and use it in GitHub Desktop.
Change the title placeholder text for a custom post type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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