Skip to content

Instantly share code, notes, and snippets.

@mikemanger
Created February 6, 2014 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikemanger/8848670 to your computer and use it in GitHub Desktop.
Save mikemanger/8848670 to your computer and use it in GitHub Desktop.
Add to WordPress theme's functions.php or plugin. Changes the 'Enter title here' text for certain post types (most examples don't realise you can get the post type from the filter.
/**
* Change the title placeholder text
*/
function my_plugin_change_default_title( $title, $post ){
if ( 'posttype' == $post->post_type ) {
$title = 'Enter new title here';
}
return $title;
}
add_filter( 'enter_title_here', 'my_plugin_change_default_title', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment