Customize Admin Area for WordPress
Wordpress provides a great power to customize most of the things via wordpress, like curd operations on admin menu’s, customizing admin bar (which will be covered in my coming posts).
So today we would work with one of the awesome functionality by wordpress itself, like removing the unwanted menus from admin area. You might be thinking that we could simply hide it why to use the function, correct that’s also the way but remember always do the right way where ever you can.
We just need to call the following function to remove any menu you want to
remove_menu_page( $menu_slug );
$menu_slug is the file name which is called on clicking of the menu, like for user operation wordpress call’s users.php. So if you pass users.php as a “menu slug” then it will remove the entire “Users” menu from admin area. Now you may be wondering that how will i remove the sub menu from the admin area. Simple, just use the following function with the php file name and the parent file name as specified below.
remove_submenu_page( $menu_slug, $submenu_slug )
So say you need to remove some menu’s for author then you may just use the above function’s on admin init. That will make your life more simpler 🙂 … Also do not forget to check the user rights… For details you may visit remove menu & remove sub menu
Hope this helps.. Stay tuned for more ….
Top Posts & Pages
- 5,073 hits