Last active
August 29, 2015 14:09
-
-
Save steppohub/394fe79528a76af22a02 to your computer and use it in GitHub Desktop.
Re-name posts to something different
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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