0

I need to create a dropdown with all available admin pages in Wordpress:

Dashboard -> /wp-admin/index.php
Posts -> /wp-admin/edit.php
Media -> /wp-admin/upload.php
...
etc
...

I can do it manually but I would like get the specific plugins links that have first order menu:

My plugin -> /wp-admin/admin.php?page=my-plugin
Igor Parra
  • 10,214
  • 10
  • 69
  • 101

1 Answers1

0

That information is stored in the global $menu and $submenu variables (though they're only available in the admin screens, of course).

Have a look at the _wp_menu_output function in menu-header.php to see how WordPress uses them.

You'll need to consider the user's permissions too. See the usages of the current_user_can function in _wp_menu_output.

Hobo
  • 7,536
  • 5
  • 40
  • 50