Skip to content

Instantly share code, notes, and snippets.

@steppohub
Last active August 29, 2015 14:09
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 steppohub/394fe79528a76af22a02 to your computer and use it in GitHub Desktop.
Save steppohub/394fe79528a76af22a02 to your computer and use it in GitHub Desktop.
Re-name posts to something different
function revcon_change_post_label() {
global $menu;
global $submenu;
$menu[5][0] = 'Books';
$submenu['edit.php'][5][0] = 'Books';
$submenu['edit.php'][10][0] = 'Add Books';
$submenu['edit.php'][16][0] = 'Books Tags';
echo '';
}
function revcon_change_post_object() {
global $wp_post_types;
$labels = &$wp_post_types['post']->labels;
$labels->name = 'Book';
$labels->singular_name = 'Book';
$labels->add_new = 'Add Book';
$labels->add_new_item = 'Add Book';
$labels->edit_item = 'Edit Book';
$labels->new_item = 'Book';
$labels->view_item = 'View Book';
$labels->search_items = 'Search Books';
$labels->not_found = 'No Books found';
$labels->not_found_in_trash = 'No Books found in Trash';
$labels->all_items = 'All Books';
$labels->menu_name = 'Books';
$labels->name_admin_bar = 'Book';
}
add_action( 'admin_menu', 'revcon_change_post_label' );
add_action( 'init', 'revcon_change_post_object' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment