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

Allow creating custom menu items using add_menu_page() #39

Closed swissspidy closed 6 years ago

swissspidy commented 7 years ago

This would allow creating a new, internal admin page that could be used as a second dashboard or something like that. See discussion in #32.

swissspidy commented 7 years ago

Question by @blogmom:

Actually..... I know you have bigger fish to fry with AMM right now. Let me please ask you this. I created a "New Page" button in the admin top bar. When clicked, it can open a link. But what code would I need to add in that link, to run "add_menu_page" and allow users to create a new page themselves?

Let me wrap my head around this.

blogmom commented 7 years ago

Thank you for adding this as a possible Enhancement!

I don't intend to distract attention from bug-fixing, but if you're interested, here is code from a php file that I created: http://pastebin.com/s1sVHpqr When opened, it seems to work, and add_menu_page() returns "top_level_zdashboard-tabxxx" as expected, but the page never appears in admin panel. I even enumerate print_r($GLOBALS['menu']); and it's not there. Only if I run add_menu_page() from within functions.php can I get something to appear. I will be interested to see how you pull it off using AMM, if this enhancement is accepted.