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 5 forks source link

Global default menu #32

Open swissspidy opened 9 years ago

swissspidy commented 9 years ago

As per this request:

Ideally I would like to see the option to apply across to all users, like a default menu and then the user can overwrite the menu organization how they want, but that would just apply to them and no one else.

See also https://github.com/wearerequired/admin-menu-manager/issues/25#issuecomment-107943652

NickHeurter commented 8 years ago

This would be a very cool function!

blogmom commented 7 years ago

yes, user-specific customization of admin panel would be a dream come true. But.......... can you do this: for any New Item added by a user, append their userID and a unique number to the page slug of the new item, so that the ScreenID is unique. (i.e., toplevelpage{page_slug} would be toplevel_page_userID_uniqnum https://codex.wordpress.org/Plugin_API/Admin_Screen_Reference Why? Then we could use add_meta_box to send widgets directly to that screen. By doing this, a user could create multiple unique dashboard pages (and move them around anywhere using your magic plugin) instead of having just one dashboard/Home page. Granted, there would need to be a clever way to give users a way to drag widgets onto the New Items, but we could probably find a way. The key is having unique ScreenIds.

swissspidy commented 7 years ago

@blogmom Sounds like that's worth a new issue.

for any New Item added by a user, append their userID and a unique number to the page slug of the new item, so that the ScreenID is unique. (i.e., toplevelpage{page_slug} would be toplevel_page_userID_uniqnum

Perhaps we could, but I suspect this would break many things like stylesheets, capability checks, the menu item mapping, etc.

The key is having unique screen ids.

Can't you do something like if ( 123 === get_current_user_id() ) { add_meta_box(); } to set meta boxes per user?

blogmom commented 7 years ago

I suppose... but I want my users to freely choose their dashboard widgets (which they can do now) but with one of my clients, users also want ability to create multiple Dashboard pages (it would be like having vertical "tabs"). I have dreamed of this too, since the Dashboard was invented. But adding stuff to Dashboard is usually done with hard-coding to affect all users, until I discovered your magic AMM plugin. Wow, now users can Order their Admin Panel and create New Items, just wow!. But... how can they create a New Dashboard Page and add widgets to it? My idea is to have a unique ScreenID (similar to what happens with I create a new page using add_menu_page), but maybe I don't understand the solution you pasted....

swissspidy commented 7 years ago

OK, I think now I got what you mean. Right now, the new items created by the plugin are simply external links. To make them real pages within the admin, AMM needs to use add_menu_page(). I now created a new issue #39 for that. Let's continue the discussion there.

Note that add_menu_page() is only half of the deal. To make a new dashboard page possible with widgets etc. you'd have to do much, much more. Nothing this plugin should do.

blogmom commented 7 years ago

Totally understand that AMM should not expand its scope to add widgets to pages. But it would be HUGE (for me) to give users ability to add Admin Menu Pages! I could try creating a plugin or a fancy page in the Admin Top bar to add widgets to the pages.

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? I am totally stuck, spent hours tinkering. I can only get add_menu_page to work within functions.php, I can't figure out how to trigger it from other pages after the site is rendered. If I could figure out how to give users a way to create a dashboard page themselves, then AMM could be used for just sorting the Menu items (assuming AMM can have an option to toggle between "full mode" and "sort only" modes).

On 10/9/2016 4:16 AM, Pascal Birchler wrote:

OK, I think now I got what you mean. Right new, the new items created by the plugin are simply external links. To make them real pages within the admin, AMM needs to use |add_menu_page()|. I now created a new issue #39 https://github.com/wearerequired/admin-menu-manager/issues/39 for that. Let's continue the discussion there.

Note that |add_menu_page()| is only half of the deal. To make a new dashboard page possible with widgets etc. you'd have to do much, much more. Nothing this plugin should do.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wearerequired/admin-menu-manager/issues/32#issuecomment-252474845, or mute the thread https://github.com/notifications/unsubscribe-auth/AVq2ycfdbUxa36b_mY-AfiC1UidYNPgAks5qyLD3gaJpZM4GJj2u.