Skip to content

Instantly share code, notes, and snippets.

@dhigginbotham
Created March 30, 2013 06:16
Show Gist options
  • Save dhigginbotham/5275602 to your computer and use it in GitHub Desktop.
Save dhigginbotham/5275602 to your computer and use it in GitHub Desktop.
function change_post_menu_label() {
global $menu;
global $submenu;
$menu[5][0] = 'News';
$submenu['edit.php'][5][0] = 'News';
$submenu['edit.php'][10][0] = 'Add News';
$submenu['edit.php'][16][0] = 'News Tags';
echo '';
}
function change_post_object_label() {
global $wp_post_types;
$rewrite = &$wp_post_types['post']->rewrite;
$rewrite->slug = 'some-slug';
$rewrite->with_front = false;
# $labels->add_new = 'Add News';
# $labels->add_new_item = 'Add News';
# $labels->edit_item = 'Edit News';
# $labels->new_item = 'News';
# $labels->view_item = 'View News';
# $labels->search_items = 'Search News';
# $labels->not_found = 'No News found';
# $labels->not_found_in_trash = 'No News found in Trash';
}
add_action( 'init', 'change_post_object_label' );
add_action( 'admin_menu', 'change_post_menu_label' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment