Skip to content

Instantly share code, notes, and snippets.

@Pamps
Last active November 1, 2019 08:23
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 Pamps/0c7a32f846ae6dfde5489ae59b9f2655 to your computer and use it in GitHub Desktop.
Save Pamps/0c7a32f846ae6dfde5489ae59b9f2655 to your computer and use it in GitHub Desktop.
Change the WordPress New Post title placeholder
<?php
// Add this to your theme functions.php file, or in a plugin file
// This example shows how to change the title field placeholder
// Post types titles
function cpm_change_default_title( $title ) {
$screen = get_current_screen();
if ( 'product' == $screen->post_type ) { // Change product for your post_type (.e.g post, page, etc)
$title = "Enter product name";
}
return $title;
}
add_filter( 'enter_title_here', 'cpm_change_default_title' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment