Last active
June 25, 2018 12:20
-
-
Save patilswapnilv/5cffbf8396e3d2e86b4f77a1f3f1232f to your computer and use it in GitHub Desktop.
Change the “Enter title here” placeholder text to make it fit your content. https://swapnil.blog/change-the-enter-title-here-placeholder-text-to-make-it-fit-your-content
This file contains hidden or 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 | |
// Change placeholder text for post titles | |
add_filter( 'enter_title_here', 'my_title_placeholders' ); | |
function my_title_placeholders( $placeholder ){ | |
$screen = get_current_screen(); | |
switch ( $screen->post_type ) { | |
case 'people': | |
$placeholder = __( 'Enter full name' ); | |
break; | |
case 'course': | |
$placeholder = __( 'Enter course title' ); | |
break; | |
case 'facility': | |
$placeholder = __( 'Enter building name and number' ); | |
break; | |
case 'research': | |
$placeholder = __( 'Enter research project title' ); | |
break; | |
case 'publication': | |
$placeholder = __( 'Enter publication title' ); | |
break; | |
default: break; | |
} | |
return $placeholder; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment