Skip to content

Instantly share code, notes, and snippets.

@certainlyakey
Created March 16, 2018 09:56
Show Gist options
  • Save certainlyakey/23b5cf929dc66ced6c847cbcb8679e81 to your computer and use it in GitHub Desktop.
Save certainlyakey/23b5cf929dc66ced6c847cbcb8679e81 to your computer and use it in GitHub Desktop.
Add a placeholder to post title in admin (Wordpress)
<?
// Add placeholder text to an office title
function change_placeholder_text_offices($title){
$screen = get_current_screen();
if ( $screen->post_type == 'office' ) {
$title = 'Enter city name here';
}
return $title;
}
add_filter( 'enter_title_here', 'change_placeholder_text_offices' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment