Thank you for your patience while I was working on other topics. I have now had a chance to install and test the Nested Pages plugin.
The “normal way” plugins add menu and submenu items to the WordPress Admin section has two steps:
- In the handler, call the WordPress add_menu_subpage() function to register a submenu element.
- Call the WordPress add_action() function to add a handler to the WordPress “admin_menu” action.
Media Library Assistant does this, as do all the other plugins I know of. The Nested Pages plugin also adds several handlers to the “admin_menu” action, and seems to assume its handlers are called after all others. Its “Admin Customization” re-ordering is done in these handlers. As you have observed, this approach fails for some WordPress native elements like the “Privacy” Settings submenu, and for some plugins like XML-Sitemap and MLA. I also noticed that the taxonomy edit submenu entry for the WordPress “Tags” taxonomy does not appear in Nested Pages’ customization list. These are defects in the Nested Pages logic, not in WordPress or other plugins.
My testing also shows other problems with menu customization when multiple taxonomy edit submenu entries are present. You cannot, for example, move a taxonomy edit submenu element to the top of the submenu, or move another submenu element to a position between two taxonomy edit submenu elements.
To accomodate the quirks in Nested Pages, I have added code to MLA that detects when Nested Pages is active. If it is, MLA registers its own “add_menu” handlers at a higher priority so they run before Nested Pages’ handlers. With this change, the MLA submenu entries appear in Nested Pages and can be moved around. The Nested Pages feature overrides MLA’s “Submenu Order” setting, so your original proposal is not required.
I have uploaded a new MLA Development Version dated 20230607 that contains the changes. They will be part of my next MLA version, but if you get a chance to test the Development Version let me know how it works for you. Thank you for calling my attention to the Nested Pages plugin.