• Resolved abitofmind

    (@abitofmind)


    Proposal:

    Status Quo:

    • Leaving it blank, seems to default to 0 = natural order = at the bottom.
    • So currently it’s not possible to use the normal WordPress admin menu order customization functions.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author David Lingren

    (@dglingren)

    I am not sure I understand this proposal. You wrote “currently it’s not possible to use the normal WordPress admin menu order customization functions.” As far as I know, the “normal WordPress” function is to supply an appropriate array key to the global $submenu array; that’s what the MLA option does. If the option value is zero MLA does not make any changes to the array.

    In your screen shot it looks like you are using another plugin, “Nested Pages“, to expose a UI for manipulating the array; is that right? If so, I can look at accommodating that plugin in my code. I’ve done that for a couple of the taxonomy term reordering plugins.

    Any additional details you can provide will be helpful. Thanks.

    Thread Starter abitofmind

    (@abitofmind)

    I hope I can clarify this:

    By “normal” I meant the “normal way” that plugins expose their menu entries to the admin menu, whatever that technically may be.

    The majority of my plugins does so, which makes them available for re-ordering in Admin Menu customization plugins like Nested Pages.

    On my installation…

    … on the top level of the admin menu:

    • ? 10 of 10 plugins are visible in the Admin menu and also in the Nested Pages representation thereof. Perfect reflection.

    … on a sub-menu-level: WordPress → Settings

    • ?? 1 menu item is at a different position in the final Admin UI in comparison to its customization in Nested Pages:
      Admin Columns
    • ? 3 menu item are on the bottom of the final Admin UI which are not at all shown in in Nested Pages:
      Privacy (options-privacy.php from WP Core)
      XML-Sitemap
      Media Library Assistant

    Annotated Screenshot:

    Thread Starter abitofmind

    (@abitofmind)

    What do you say? Did you already do some first research how all the other plugins register themselves for being re-sortable in the admin menu?

    Plugin Author David Lingren

    (@dglingren)

    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:

    1. In the handler, call the WordPress add_menu_subpage() function to register a submenu element.
    2. 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.

    Thread Starter abitofmind

    (@abitofmind)

    Thanks for the detailed info and describing the logical defects in Nested Pages responsible for failing to order some menu items.

    I will not report this to Nested Pages, as earlier reports/proposals from me received no reaction so far, seems rather dormant. Should I get into a discourse with Nested Pages devs, I now have your explanation, and could use this for a new report.

    Thanks also for making the particular fix for MLA with Nested Pages.

    Plugin Author David Lingren

    (@dglingren)

    I have released MLA version 3.09, which contains the enhancements required for this topic.

    I am marking this topic resolved, but please update it if you have any problems or further questions regarding MLA’s support for the Nested Pages plugin. Thanks for inspiring this MLA improvement.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Offer possibility to use default Admin Menu integration / order’ is closed to new replies.