wearerequired / admin-menu-manager

Manage the WordPress admin menu using a simple drag & drop interface.
https://wordpress.org/plugins/admin-menu-manager/
GNU General Public License v2.0
61 stars 6 forks source link

Permission error after moving sub menu item #14

Closed swissspidy closed 9 years ago

swissspidy commented 9 years ago

Scenario:

  1. Install a plugin like Google Analytics by Yoast or Jetpack
  2. Move a random sub item of that plugin to the top level
  3. Visit that page
  4. Permission error occurs. :cry:
swissspidy commented 9 years ago

The current implementation uses add_menu_page and add_submenu_page for elements that were moved from top to sub or vice-versa. This lets WordPress do the rest. However, it forces me to re-add various hooks, currently:

Where $hook is the get_plugin_page_hookname() of the old menu item.

But there are probably many other hooks that exist for a menu page, so this is not bulletproof.

swissspidy commented 9 years ago

Probably quite safe now after 8c3c4567cfe15dd2f84ea64141f4ecfa59c76f03. Let's close this for now...