Created
May 5, 2014 22:55
-
-
Save lightningspirit/b244fbbadfee7d44f893 to your computer and use it in GitHub Desktop.
How to change the admin menu Post labels
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
<?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