Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Last active October 10, 2015 22:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/3764489 to your computer and use it in GitHub Desktop.
Save jaredatch/3764489 to your computer and use it in GitHub Desktop.
Change post title placeholder text for custom post type
<?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