How to remove the submenu with the same name as mainmenu in wordpress plugin
Posted by navaneeth on Jan 30, 2013 in Php, Wordpress | No comments yet
During wordpress plugin development, Sometimes we need to remove the submenu with the same name as the mainmenu from sidebar
for example see the image
And in-order to remove the menu which repeats and to look like this
we need to add this code to the plugin file or to the functions.php
add_menu_page('page_title','menu_title','manage_options','menu_slug','function'); add_submenu_page('menu_slug','','','manage_options','menu_slug','function'); add_submenu_page('menu_slug','Submenu','Submenu','manage_options','submenu_slug','function');
Leave a Reply