Skip to content

Instantly share code, notes, and snippets.

@lightningspirit
Created May 5, 2014 22:55
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 lightningspirit/b244fbbadfee7d44f893 to your computer and use it in GitHub Desktop.
Save lightningspirit/b244fbbadfee7d44f893 to your computer and use it in GitHub Desktop.
How to change the admin menu Post labels
<?php
function change_post_menu_label() {
global $menu, $submenu;
$menu[5][0] = __( 'News' );
$submenu['edit.php'][5][0] = __( 'News' );
$submenu['edit.php'][10][0] = __( 'Add News' );
}
add_action( 'admin_menu', 'change_post_menu_label' );
function change_post_object_label() {
global $wp_post_types;
$labels = &$wp_post_types['post']->labels;
$labels->name = __( 'News' );
$labels->singular_name = __( 'News' );
$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' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment