=== Admin Menu Editor Pro ===
Contributors: whiteshadow
Tags: admin, dashboard, menu, security, wpmu
Requires at least: 5.9
Tested up to: 7.1.2
Stable tag: 2.37.1
Requires PHP: 7.4

Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more.

== Description ==
Pro version of the Admin Menu Editor plugin. Lets you manually edit the Dashboard menu. You can reorder the menus, show/hide specific items, change access rights, and more. 

[Get the latest version here.](http://adminmenueditor.com/updates/)

**Pro Version Features**

- Import/export custom menus.
- Set menu items to open in a new window or IFrame.
- Improved, role-based menu permissions interface.
- Use shortcodes in menu fields.
- Create menus accessible only to a specific user (by setting extra capability to "user:username").

**Other Features**

- Change menu title, access rights, URL and more. 
- Create custom menus.
- Sort items using a simple drag & drop interface.
- Move items to a different submenus.
- Hide any menu or submenu item.
- Supports WordPress MultiSite/WPMU.

**Requirements**

- WordPress 5.9 or later

_For maximum compatibility and security, using a modern web browser such as Firefox, Opera, Chrome or Safari is recommended. Certain advanced features (e.g. menu import) may not work reliably or at all in Internet Explorer and other outdated browsers._

**Credits**

This plugin uses some icons from the ["Silk" icon set](http://fortawesome.github.io/Font-Awesome/) by Mark James. These icons are licensed under the [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/).

== Installation ==

_If you already have the free version of Admin Menu Editor installed, deactivate it before installing the Pro version._

**Normal installation**

1. Download the admin-menu-editor-pro.zip file to your computer.
1. Unzip the file.
1. Upload the `admin-menu-editor-pro` directory to your `/wp-content/plugins/` directory.
1. Activate the plugin through the 'Plugins' menu in WordPress.

That's it. You can access the the menu editor by going to _Settings -> Menu Editor Pro_. The plugin will automatically load your current menu configuration the first time you run it.

**WP MultiSite installation**

If you have WordPress set up in multisite ("Network") mode, you can also install Admin Menu Editor as a global plugin. This will enable you to edit the Dashboard menu for all sites and users at once.

1. Download the admin-menu-editor-pro.zip file to your computer.
1. Unzip the file.
1. Create a new directory named `mu-plugins` in your site's `wp-content` directory (unless it already exists).
1. Upload the `admin-menu-editor-pro` directory to `/wp-content/mu-plugins/`.
1. Move `admin-menu-editor-mu.php` from `admin-menu-editor-pro/includes` to `/wp-content/mu-plugins/`.

Plugins installed in the `mu-plugins` directory are treated as "always on", so you don't need to explicitly activate the menu editor. Just go to _Settings -> Menu Editor_ and start customizing your admin menu :)

_Notes_

- Instead of installing Admin Menu Editor in `mu-plugins`, you can also install it normally and then activate it globally via "Network Activate". However, this will make the plugin visible to normal users when it is inactive (e.g. during upgrades).
- When Admin Menu Editor is installed in `mu-plugins` or activated via "Network Activate", only the "super admin" user can access the menu editor page. Other users will see the customized Dashboard menu, but be unable to edit it.
- It is currently not possible to install Admin Menu Editor as both a normal and global plugin on the same site.

== Notes ==
Here are some usage tips and other things that can be good to know when using the menu editor : 

- WordPress uses the concept of [roles and capabilities](http://codex.wordpress.org/Roles_and_Capabilities "An overview of roles and capabilities") to manage access rights. Each Dashboard menu item has an associated capability setting, and only the users that possess that capability can see and use that menu item.

- "Hidden" menus are invisible to everyone - including the administrator - but they can still be accessed via the direct page URL. To make a menu inaccessible to certain users, edit its permissions.

- If you delete any of the default menus they will reappear after saving. This is by design. To get rid of a menu for good, either hide it or set it's access rights to a higher level.

== Changelog ==

[Get the latest version here.](http://adminmenueditor.com/updates/)

= 2.37.1 (2026-10-03) =
* Added optional checksum and signature verification for plugin updates. It's currently optional because there hasn't been sufficient real-world testing done, but you can switch it to "required" in the "Settings" tab, under "Update verification". The default setting will also be changed to "required" eventually, in a future release.
* Added a "Block URLs" section to the "Tweaks" tab. It lets you block access to certain URLs by role(s). It works both with admin dashboard URLs and frontend URLs. This only affects logged-in users since anonymous visitors don't have any roles.
* Tested up to WP 7.1.2.

= 2.37 (2026-09-19) =
* This version should be identical to 2.34 except for the version number and this changelog entry. After [the September 14 security incident](https://adminmenueditor.com/blog/security-incident-affecting-customers-2026-09-14/), 2.34 was the last known safe version. This release has a higher version number so that it overrides any cached updates that are  compromised and malicious (2.35) or potentially compromised (2.36). The different version number should also help distinguish sites that stayed on 2.34 from those that had an update installed later.

= 2.34 (2026-08-17) =

##### Added
* Quick Search: Added search by post ID.

##### Fixed
* Fixed a conflict with Flatsome 3.20.8 where Flatsome UX Builder would get stuck on the "Loading UX Builder" screen if the "Content Permissions" module was enabled.
* Fixed "Hide Sidebars" and "Hide Sidebar Widgets" panels missing from the "Tweaks" tab.

##### Changed
* Various internal changes in the "Tweaks" tab that shouldn't affect functionality.
* Tested up to WP 7.1-RC3.

= 2.33.4 (2026-05-22) =
##### Fixed
* Fixed a bug in "Settings -> Easy Hide" where checking and then unchecking an admin menu item could cause it to become  visible even if it's normally hidden by default. Now unchecking a menu item should either reset it to its default permissions (which depend on the role), or leave it as-is (if it was already explicitly enabled in the menu editor).
* Fixed insufficient escaping for the "Admin CSS" setting in the "Tweaks" tab.

##### Changed
* Access to the "Tweaks" tab now requires the `edit_theme_options` capability, in addition to other AME permissions. This shouldn't affect most users since administrators normally have this capability by default.

= 2.33.3 (2026-05-20) =
##### Fixed
* WP 7.0 compatibility: Fixed invisible buttons in the license information screen.
* Fixed a potential issue with upgrading from 2.33 where, if you had previously enabled the "Bottom border" option for menu headings, the headings would get all four borders in 2.33.2, not just a bottom border. Now the widths of other borders should correctly default to zero.
* Fixed long role names making the role sidebar in the "Roles" tab very wide when a user is selected.
* Fixed a minor conflict with Elementor that made the allow/deny icons in the "Content Permissions" panel blue.
* Fixed a number of PHP 8.5 deprecation notices about `SplObjectStorage`.

= 2.33.2 (2026-05-17) =
* Hotfix for a cache invalidation bug that caused pre-existing menu heading styles to stop working on sites that also had other custom styles for the admin menu.

= 2.33.1 (2026-05-17) =
##### Added
* Added default role capability data for WP 7.0.

##### Fixed
* Fixed the "Menu Headings" dialog not opening on the first click on some existing installations. This was caused by an outdated version of a module being cached in the browser.

= 2.33 (2026-05-17) =
##### Added
* Reworked and significantly expanded menu heading styles. If you've previously set up custom heading styles, you may need to review and update those settings.
* Added the ability to hide more table elements like row actions and the "Bulk Actions" box. You can find these new settings in the "Tables" tab. The plugin detects available elements when you visit the relevant admin page, so if you don't see the new settings, go to the page that shows the table, then go back to the "Tables" tab. 
* Added improved SVG menu icon support. It was already possible to use SVG icons for admin menu items, but you had to manually encode them in the format that WordPress expects. Now the icon selector has a new "SVG" tab, and you can just paste the SVG code in the text box and click "Apply".
* Added a letter spacing setting to various "Font" panels.
* Added visual side indicators to border width controls.

##### Fixed
* WP 7.0 compatibility: Fixed a number of layout issues and visual bugs that only appeared in WordPress 7.0.
* Fixed the `[ame-count-bubble]` shortcode not displaying the "WooCommerce -> Orders" bubble from WooCommerce 10.6.0.
* Fixed automatic menu heading text hover color assignment sometimes not working correctly when using a non-default admin color scheme.
* Fixed a few PHP notices like "Using null as an array offset is deprecated, use an empty string instead".
* Fixed a PHP deprecation notice when saving some forms without a role/user selected.
* Fixed the "Priority" dropdown in the "Dashboard Widgets" tab not expanding to the full width of the widget.

##### Changed
* Renamed the "Columns" tab to "Tables" because it now shows more admin table settings, not just table columns.
* Tested up WP 7.0-RC4.

= 2.32 (2026-02-20) =
##### Added
* In the "Roles" tab, the number of enabled capabilities is now shown as a colorful badge, with a tiny progress bar for partially-enabled categories. You can turn this new style on/off by clicking the gear icon next to the "All" category and toggling these boxes: "Show as badges" and "Show progress bars".
* Added inset and outset separator styles.

##### Fixed
* Fixed role names (e.g. "editor") showing up in the "Capabilities" field in user profiles.
* Fixed the "Other Roles" field not showing up for roles that have permission to edit users but can't access the menu editor.
* Fixed user profile extension scripts and styles loading on all admin pages. Now they should only be loaded on pages like "Edit User" and "Add User".
* Fixed menu separator left and right margins not being previewable in the "Menu Style" dialog. They worked correctly when the configuration was saved, but didn't apply in the preview.
* Partially fixed some screens in the "Columns" tab getting incorrectly flagged as "probably doesn't exist" when there is no saved admin menu configuration.
* Fixed some users showing as "missing" in the "Redirects" tab when the site has more than 50 users.
* Fixed a PHP notice about enqueueing a style before registering the "menu-editor-base-style" dependency.
* Fixed a PHP compatibility issue where using PHP versions older than 8.1 could lead to errors like "Fatal error: Uncaught Error: Cannot unpack Traversable with string keys".
* Fixed a PHP 8.5 deprecation notice: "Using null as an array offset is deprecated, use an empty string instead".
* Fixed a PHP 8.5 deprecation notice: "Non-canonical cast (boolean) is deprecated, use the (bool) cast instead".
* Fixed conflicts with "WooCommerce Product Options" and "WooCommerce Quantity Manager" where menu items that link to setup wizards would become visible when AME is active.
* Added a workaround for a bug in ActivityPub 7.8.5 that could cause a PHP fatal error by returning an invalid value from the "user_has_cap" filter.
* Added a workaround for an unidentified issue with meta cap detection that could cause the "Admin Menu" tab to be blank in some cases.

##### Changed
* Removed the special URL parameter that admins could use to manually reset the admin menu configuration.
* Removed some metadata files like `package.json` and `composer.json` from the plugin's ZIP file.

= 2.31 (2026-01-22) =
##### Breaking Changes
* Further increased required PHP version from 7.1 to 7.4.

##### Added
* Added role export/import. The import option ("Roles and capabilities") is disabled by default since accidentally importing the wrong role data can mess up user permissions. When you enable it, you can click "Show settings" to choose which roles to import.
* Added an option to export/import active modules ("Enabled modules"). This is also disabled by default when importing settings since deactivating modules can make parts of the plugin temporarily inaccessible.
* Added separate Toolbar visibility settings for the dashboard and the front end.
* Added default role capabilities for WP 6.9. These are used by the "Reset roles" feature in the "Roles" tab.
* Added an "Other Roles" field and an "Edit" link to user profiles, and a "Capabilities" link to users in the "Users" table. If you want to disable these (e.g. because another plugin already adds similar links), go to the "Roles" tab and click the new "User screens" button on the right.

##### Fixed
* Fixed WooCommerce Orders not being included in Quick Search results even when explicitly enabled in settings.
* Fixed WooCommerce Orders being rendered as `Order &ndash; ...`. That dash should now appear as an actual dash. 
* Removed the deprecated "type" attribute from style tags generated by admin CSS tweaks.

##### Changed
* Increased minimum required WP version to 5.9.
* Tested up to WP 6.9.
* Various internal changes.

= 2.30 (2025-09-08) =
##### Breaking Changes
* Increased the minimum required PHP version from 5.6 to 7.1.

##### Added
* New Quick Search features:
  * You can now search posts (by title) and users (by login, email, or display name). You can configure enabled post types in the "Quick Search" settings tab, under "Search scopes".
  * You can press Ctrl + Enter to open the selected search result in a new window or tab.
  * Quick Search remembers recently used items for each user. Previously, it would preload the same recent items for all users.
* Added a tweak that disables the Gutenberg Welcome Guide.

##### Fixed
* Fixed import error messages not being shown in the widget import popup.
* Fixed PHP 8.4 deprecation notices like "Implicitly marking parameter $foo as nullable is deprecated, the explicit nullable type must be used instead".
* Fixed repeated re-crawling of menu items where the URL contains a "#fragment".
* Fixed a bug where the plugin would unexpectedly hide the top-level "Profile" menu from non-admin users in some configurations.
* Fixed long menu titles wrapping to the next line and inconsistent field label spacing in the menu editor.
* Fixed a conflict with "FunnelKit Funnel Builder" where "WooFunnels" would permanently stay highlighted as a new menu because its "Upgrade to Pro" submenu item could not be correctly marked as seen.
* Fixed a conflict with Forminator Forms where the "Forminator" menu would always be highlighted as a new menu.
* Fixed a PHP warning "fgetcsv(): escape must be character" in PHP versions older than 7.4.
* Fixed a dropdown potentially extending outside its parent dialog/popup when one of the items is very long.
* Fixed the "Copy Permissions" button state not being updated when dropdown values were changed using the keyboard instead of the mouse.
* Fixed improper sanitization of the "placeholder" attribute for the "ame-user-info" shortcode.
* Fixed the "admin_menu_editor-menu_url_blacklist" filter being called too early, before most other plugins have been loaded. Now other plugins should be able to actually use this filter to modify the menu blacklist.
* Fixed a conflict with "Advanced Responsive Video Embedder" (ARVE) that prevented the contents of the ARVE settings tabs from displaying.
* Improved profile field detection by ignoring hidden fields and nested tables. This slightly improves compatibility with plugins like "Store Toolkit for Woocommerce" and "Dokan".
* Improved detection and handling of non-hardcoded meta capabilities in the menu editor. The plugin should now display their status more accurately, and enabling menu items that use meta capabilities should work more reliably. However, meta capability support remains incomplete since plugins can implement them in arbitrarily complex ways.

= 2.29.1 (2025-05-22) =
* Hotfix for a bug in version 2.29 that could cause it to crash with a fatal error upon activation. If you've encountered that bug on your site, you will likely need to upload this update manually because the regular update mechanism won't work while the plugin is deactivated.

= 2.29 (2025-05-22) =
##### Added
* Added a new settings tab: "Columns". It lets you hide and reorder table columns used in various admin tables, like on "Posts -> All Posts". Plugin-created tables are also supported as long as they use the same API.
* Added two new Gutenberg tweaks: disable block locking and disable access to the Code Editor.
  * "Disable block locking and unlocking": the user can't lock or unlock blocks. This doesn't affect previously locked blocks; they stay locked.
  * "Disable access to the Code Editor and "Edit as HTML"": the user can't switch to the "Code editor" mode that normally lets you view and edit the underlying block markup for a post or page. This also removes the "Edit as HTML" option from the block context menu.
* Added two new tweaks for customizing the "Plugins" page: one moves active plugins to the top of the plugin list, the other selects the "Active" filter by default.
* The plugin now automatically detects user profile fields so they can be hidden in the "Tweaks" tab. Previously, the "Hide Profile Fields" section only showed a limited set of predefined options.

##### Fixed
* Fixed "That option is currently not allowed" errors when trying to change font weight in the Admin Customizer.
* Fixed PHP 8.4 deprecation notice "fgetcsv(): the $escape parameter must be provided as its default value will change".
* Fixed a conflict with the "Bricks" theme/site builder that could cause the fatal error "Uncaught TypeError: Illegal offset type in isset or empty".
* Fixed a minor visual issue where some box backgrounds could overflow box borders when using rounded corners and custom background colors.

##### Changed
* In most AME settings tabs, the role/user list will now stick to the top when scrolling the page. This currently doesn't apply to the "Admin Menu" tab.
* Added an "About" tab to the "Content Permissions (AME)" meta box. Some users reported they found it difficult to figure out which plugin added this box.

= 2.28 (2025-04-01) =
##### Added
* Added a "Reset Roles" feature to the role editor. It can reset the default roles to their default capabilities. Unlike some similar plugins, you can choose which roles to reset, and you don't lose custom roles. However, the downside is that it uses predefined defaults, which may eventually become outdated. Before resetting roles, check the WordPress version number shown in the "Reset roles to defaults" screen.

##### Fixed
* Fixed a conflict with Toolset Types and Toolset Blocks 1.6.18 that prevented the content template editor and several other Toolset pages from working.
* Fixed Quick Search treating headings inside admin notices as sections.
* Added a workaround for plugins and themes that could crash in the "Content Permissions (AME)" meta box due to how AME detects post type capabilities. On new installations, the workaround will be applied automatically if the meta box runs into a fatal error the first time AME tries to display it. In other cases, you can apply it manually by going to the "Settings" tab and unchecking this option: "Detect post type capabilities by checking them with a non-existent user".

##### Changed
* The role list is now sorted. The default roles like "Administrator", "Editor", etc, are shown in a predefined order, while the rest are sorted alphabetically. Previously, roles were shown in the order they were created.

= 2.27.4 (2025-03-13) =
##### Fixed
* Fixed the "Disable Customizations" -> "Admin menu content" tweak not working on sites without plugins. It had a bug that was masked by having specific other plugins installed (e.g. "Classic Editor"), so it would work only on sites that were also using those plugins.
* Fixed a potential crash in the Admin Customizer.

= 2.27.3 (2025-03-13) =
##### Fixed
* Fixed the inability to disable the new "Search" item that's shown in the Toolbar / Admin Bar.
* Fixed certain menu style settings such as separator colors, menu logo, menu width, etc no longer being saved on some sites.
* Fixed a conflict with the Visualizer plugin (version 3.11.9) that stopped the edit chart feature from working due to a fatal PHP error in an AJAX handler. 
* Fixed a minor conflict with the Post SMTP plugin that caused the hidden menu items "Dashboard -> Welcome" and "Dashboard -> Credits" to become visible.

= 2.27.2 (2025-03-07) =
* Improved reliability of the 'Hide the "Patterns" tab' and the 'Hide the "Media" tab' tweaks. It appears that the block inserter tabs can have different IDs on different sites (even on sites running the same WP version) so it's difficult to hide them consistently.

= 2.27.1 (2025-03-06) =
* Fixed an issue with HTTP request method validation that could cause some of the new "Quick Search" features to fail in some server configurations (e.g. old PHP versions).

= 2.27 (2025-03-06) =
##### Added
* Added a way to control access to specific posts and pages. The new "Content Permissions" box in the post editor lets you choose which roles will be able to see a post. It also has an "Advanced" tab where you can enable or disable individual permissions like read/edit/delete for each role. Finally, you can control what happens when someone who doesn't have permission tries to view a post: you can replace the post content with something else, show a custom error, simulate a "404 Not Found" error, or redirect the user to a custom URL.
* Added "Quick Search": a pop-up search box that searches admin menus. Optionally, it can also search admin pages for specific settings, tabs, filter links, and a few more things. You can open the search box by pressing the Shift key twice or clicking the search icon in the Toolbar/Admin Bar. You can configure this feature in the new "Quick Search" tab or turn it off in the "Settings" tab (under "Modules").
* Added margin settings for menu headings.
* Added "Disable Customizations" tweaks that you can use to disable the custom admin menu, custom metabox visibility, and a few other things for specific roles or users.
* Added a filter that can be used to turn off admin menu customizations. Basic example: `add_filter('admin_menu_editor-disable_customizations-admin_menu_structure', '__return_true');`
* Added an option to highlight unsaved changes (i.e. enabled/disabled capabilities) in the "Roles" tab.
* Added an "Optimize menu configuration size" option to the "Settings" tab. It makes the plugin store the admin menu configuration in a more space-efficient format, which should reduce the size of the "ws_menu_editor_pro" database entry. This option is enabled by default. Previously, this was controlled by the option "Compress menu configuration data that's stored in the database", but now the "Compress..." option only applies to actual compression.

##### Fixed
* Fixed default redirects not being saved due to a bug in the "delete settings associated with missing roles" feature.
* Fixed the "Highlight background" color setting in admin menu colors not completely overriding the "Menu highlight background" setting in the general admin color scheme.
* Fixed a potential crash when the Zlib extension is enabled but the gzuncompress() function is disabled.
* Fixed a PHP warning related to WP Adminify that was triggered by trying to parse an invalid hook callback.
* Fixed the "Hide the Gutenberg options menu" tweak not working in WP 6.7.x.
* Fixed the tweaks that hide the "Media" and "Patterns" tabs in the Gutenberg block inserter not working in WP 6.7.x.
* Fixed a potential CSS issue where menu heading styles failed to override general menu item styles.
* Fixed a minor conflict with Elementor that caused the hidden menu items "Elementor -> Connect" and "Elementor -> Note Proxy" to become visible.
* Fixed the left side of the focus outline being cut off for capability checkboxes in the "Roles" tab.
* Fixed a potential caching issue with generated CSS stylesheets.

##### Changed
* Adjusted the size and layout of the top settings tabs on the "Menu Editor Pro" page in situations where the tabs don't fit on a single row.
* Removed the "Screen Options" panel from the menu editor. The only option that was in that panel - "Hide advanced options" - is still available in the "Settings" tab (in the "Interface" section).
* Tested with WP 6.7.2; partially tested with WP 6.8-alpha.
* Increased minimum required WP version to 5.4.

== Upgrade Notice ==

= 1.94 =
Added support for submenu icons, two new menu URL options ("Logout" and "None"), better error reporting, and a new menu editor colour scheme. Fixed several UI layout bugs, plugin conflicts and issues with importing large JSON files.