/**
* Changes Label of Admin Menu items
* @global array $menu
* @global array $submenu
*/
function change_post_menu_label() {
global $menu;
global $submenu;
$menu[2][0] = 'Home';
$menu[5][0] = 'Articles';
$submenu['edit.php'][5][0] = "All Articles";
// var_dump($submenu);
// var_dump($menu);
echo '';
}
if(!is_super_admin()){
add_action( 'admin_menu', 'change_post_menu_label' );
}
You can print the array
echo "<pre>";
print_r($menu);
echo "</pre>"; //remove this code after, it is just used to check the index of element in Menu to rename it.
and see elements index to change name for whatever item you’would like to rename. Like in above function I’m renaming the “Posts” in menu to “Articles”.
To rename the child of Menu item use
$submenu
array. For renaming Dashboard to “Home”
$menu[2][0] = 'Home';
add this line to previous function, confirm the index “2” in $menu array for Dashboard.