I’m building a plugin that requires its own set of admin pages. I know how to create the top-level link and how to add sub-menus to it. However, what seems to happen is when I create the top-level link, it also automatically adds a submenu page of the same name if I add another submenu page to it.
I’m simply looking for a way to change the name of my first submenu page so that it is different from the parent name. (i.e. in the admin panel, expanding the “Links” menu shows an “All Links” submenu page. Mine would instead say “Links” on top and then “Links” instead of “All Links”)
You just have set the name of the
$menu_slug
exactly the same as the parent slug.This is how I solved the parent menu item also being listed as a submenu item: