Wordpress

WordPress customization part 2 – Renaming dashboard menus

Dashboard Menu Link Rename
12 / 100

This is the part 2 of wordpress customization series. Sometimes guys you need to rename your wordpress dashboard menus as your convenience. Like if you want to change your Posts menu to Blog posts, you can do it easily with admin_menu hook.

First of all we go to functions.php  and create a custom function as follow.

Function rename_top_level_menus(){

global $menu;

$menu[5][0]="Blog Posts";

}

add_action('admin_menu',’ 'rename_top_level_menus');

 

In the above function we declare a global variable $menu which holds the all top level menus in the form of array.Associate this function with add_action hook with admin_menu action tag.

Renaming Sub menus

Function rename_sub_menus(){

global $menu;

global $submenu;

$menu[5][0]="Blog Posts";

$submenu['edit.php'][5][0]="All Blog Posts";

}

add_action('admin_menu','rename_sub_menus');

Menus and sub menus name, key, and slug Chart

chart

WordPress customization part 3- Changing the order of dashboard menus

 

Please follow and like us:

About Viren-Dra Yadav

Tech Enthusiast | Open Source Lover | WordPress Explorer | Mad for Speed | DevOps Engineer | AgriTech
View all posts by Viren-Dra Yadav →

Leave a Reply

Your email address will not be published. Required fields are marked *