Conversation
- Add addon bootstrap, activator, and app layer for admin menu editing - Load per-role menu rules and integrate with Members addon system Made-with: Cursor
- Register members-admin-menus in addon catalog with title and excerpt - Register members-admin-menus script handle with dependencies and filemtime - Fall back to General settings view when the requested view slug is missing Made-with: Cursor
- Add sidebar editor layout, drag handles, and form styling in admin.css - Add admin-menus.js for the visual menu editor UI and interactions Made-with: Cursor
- Refresh minified output for settings page script (no source change) Made-with: Cursor
- Add support for custom image icons in the admin menu editor, including auto-detection of icon types (image, SVG, FontAwesome). - Implement image preview functionality for selected icons. - Update styles for custom icons to ensure proper display in the admin sidebar. - Improve color override functionality for menu items.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'Admin Menus' add-on for the Members plugin, providing a visual interface to hide, reorder, rename, and customize admin menu items per role. My review identified several areas for improvement: the menu URL override logic needs to account for submenu keying, the promotion of submenu items requires a more robust callback handling, the export function should check if headers are sent, the JavaScript save function needs a failure handler, and Font Awesome versioning should be consistent and defined via constants.
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'Admin Menus' add-on for the Members plugin, providing a visual interface to hide, reorder, rename, and customize admin menu items per role. My review highlights several critical issues: overwriting menu slugs can break WordPress core functionality, promoting menu items without a callback will cause broken links, and the redirect logic for hidden pages could lead to infinite loops. Additionally, I have suggested using consistent capability checks, optimizing user search queries to avoid performance issues, and implementing static caching for user configuration lookups to improve efficiency.
…lity and improved submenu management
…ing settings in admin menus
…r saving settings
…proved item visibility
…cy in admin menus
…ror handling in admin menus
…nt screen for improved menu navigation accuracy
|
Thanks @omaraelhawary The code looks good now. The only issue I noticed is UI, but I'll leave it to Paul to decide if we need any changes here. |
|
@ThemeGravity I work on some improvements |
… with additional tools and improved accessibility
|
@ThemeGravity I added this more tools to expand the menu and moved some options in that area:
After Expand
|
…sibility and interaction in admin menus
|
@omaraelhawary Looks better. Thanks. Let's also fix up arrow position:
|
…n and adjust styling for better alignment and spacing
…decoration rules for improved visual consistency
|
Resolved, please let me know if it ready to merge so I can solve any conflict with develop branch if needed. |
|
@omaraelhawary It looks good to me, so it's ready to merge, but I'll leave it to Paul to decide if we need any changes in UI. |
|
@ThemeGravity can you resolve the conflicts here? I think you just need to run the gulp or whatever minifies the CSS again... Or maybe just merge in develop.. idk @omaraelhawary before I merge, can you get me one more video of this full feature with these final changes in place? Also we'll need to ensure the readme.txt is updated to mention the new feature, and our docs at members-plugin.com also. |
|
@cartpauj I've resolved merge conflicts so everything should be ready. |
…bilities for category managers
…ability checks in admin menus
|
Hi @cartpauj here's a video for the new addon: https://screenrec.com/share/DHZ3Fz7axA I'm working on fixing Make Parent for Custom Menu Item and I will push changes soon. I will keep you posted once I done. |
…nu item visibility logic
|
All fixed and works on some improvements. |
…some and Dashicons validation functions
…menus, including UI for adding/removing exempt users and related functionality





Admin Menus (Members add-on)
The Admin Menus add-on extends the Members plugin so site administrators can customize the WordPress admin sidebar per role and user: reorder items, hide screens, override labels/icons/URLs/colors, add custom links, and gate menu visibility by capability.
Settings are stored in the WordPress option
members_admin_menus_settings(OPTION_KEYin code).Where to configure
admin.php?page=members-admin-menus)The UI loads a snapshot of the current admin menu tree (captured on first load) and uses AJAX for save, reset, export, import, and user search.
Who is affected
members/addons/admin_menus/is_user_exempt.How configuration is resolved
settings['custom_items']) and global capability map (settings['capabilities']) are included from stored settings.settings['users'][ user_id ]), if present, replace whole blocks for:hidden,order,submenu_order,overrides,custom_items, andcapabilities.Feature areas
Menu order
menu_orderfilter (priority 999) and a physical reorder of the global$menuarray.sep-*tokens in the order list; these become realwp-menu-separatorentries.submenu_order.Visibility: hide by role / user
remove_menu_page/remove_submenu_page.parent_slug::child_slug.admin_init(unless exempt): users are redirected (default: dashboard; filtermembers/addons/admin_menus/redirect_url).members-settingsorpage=members) cannot be hidden, to avoid locking the site out of Members configuration.Capability-based visibility
settings['capabilities']map (or the whole map replaced by a per-user block); it does not merge per-role capability maps fromsettings['roles']in PHP—those may still exist in stored data for the editor UI.Overrides (labels, icons, URLs, badges, colors)
parent::child.admin_head).parentset to__promote__can be promoted to a top-level menu page.parentoverride.Custom menu items
pagehook and redirect to the configured URL via a small callback (no blank admin page).Import / export
members_admin_menus), with sanitization on import (seefunctions-admin.php).Safety notes
edit.php) also ties into blocking related edit screens for default post types where applicable.In progress
Planned UX and reliability improvements for the Admin Menus editor:
beforeunloadpromptwindow.prompt('Parent slug')— users must type raw slugs (e.g.edit.php)alert()for success/errorssaveSettings()lacks a.fail()handler