Skip to content

Instantly share code, notes, and snippets.

@isGabe
Last active February 25, 2019 21:28
Show Gist options
  • Star 30 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save isGabe/3094617 to your computer and use it in GitHub Desktop.
Save isGabe/3094617 to your computer and use it in GitHub Desktop.
WordPress: Custom placeholder text for custom post type title input box #snippet #WordPress
<?php
/*
replacing the default "Enter title here" placeholder text in the title input box
with something more descriptive can be helpful for custom post types
place this code in your theme's functions.php or relevant file
source: http://flashingcursor.com/wordpress/change-the-enter-title-here-text-in-wordpress-963
*/
function wpfstop_change_default_title( $title ){
$screen = get_current_screen();
if ( 'your_custom_post_type' == $screen->post_type ){
$title = 'Your custom placeholder text';
}
return $title;
}
add_filter( 'enter_title_here', 'wpfstop_change_default_title' );
?>
@brittanynavin
Copy link

Thank you! This saved me tons of time

@tripflex
Copy link

Here's one I adapted for the WP Editor placeholder: https://github.com/tripflex/wp-tinymce-placeholder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment