Skip to content

Instantly share code, notes, and snippets.

@josh-taylor
Last active December 18, 2015 02:49
Show Gist options
  • Save josh-taylor/5713957 to your computer and use it in GitHub Desktop.
Save josh-taylor/5713957 to your computer and use it in GitHub Desktop.
Changes the placeholder text for custom post types.
<?php
if (!function_exists('get_input_text')):
function get_input_text($input) {
global $post_type;
if (is_admin() && $input == 'Enter title here') {
switch ($post_type) {
case 'my_post_type':
return 'Enter full name here';
case 'my_post_type_2':
return 'Enter half name here';
}
}
return $input;
}
add_filter('gettext', 'get_input_text');
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment