WordPress Change the Order of Admin Menu Items
- Article
- Comment
WordPress Change the Order of Admin Menu Items is useful, when your client asks to rearrange the menu items. Its useful certain situations to avoid confusions and sometimes takes time to find the options for new users and non technical peoples. So changing the order based on the project requirement helps to added advantage.
The following function will help you to rearrange the order of the admin menu items.
function kv_custom_menu_order($menu_ord) { if (!$menu_ord) return true; return array( //array of the order ); } add_filter('kv_custom_menu_order', 'kv_custom_menu_order'); add_filter('menu_order', 'kv_custom_menu_order');
now, you can add your array to change the order of the admin menu items. Example here I just changed two menu orders.
array( 'index.php', // this represents the dashboard link 'themes.php', 'plugins.php' );
The above one will help you to place the order of index.php(Dashboard, Themes, Plugins).
Likewise you can change your desired order, even custom menu items too.