Last active
October 10, 2015 22:58
-
-
Save jaredatch/3764489 to your computer and use it in GitHub Desktop.
Change post title placeholder text for 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 | |
/** | |
* Change post title placeholder text for custom post type | |
* | |
* @author Jared Atchison | |
* @link http://jaredatchison.com/code/ | |
* @global array $post | |
* @param string $translation | |
* @return string Customized string for title | |
*/ | |
function ja_title_placeholder( $translation ) { | |
global $post; | |
if ( isset( $post ) ) { | |
switch( $post->post_type ){ | |
case 'portfolio' : | |
if ( $translation == 'Enter title here' ) return 'Enter Project Name Here'; | |
break; | |
} | |
} | |
return $translation; | |
} | |
add_action( 'gettext', 'ja_title_placeholder' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment