• Not sure what is causing this – but suddenly I’m getting an error 404 when using the toggle function.

    Just updated WP to 5.9.0, WF to 2.18.10.

    I was using WF on both pages and posts. I had both all pages and all posts open on different tabs – pages wasn’t showing the folders, posts was showing folders and was usable. When I tried WF toggle for pages, I got the 404. When I tried WF toggle for posts, likewise.

    Quick edit for any page or post shows the WF folder hierarchy.

    Err is for sitename.wp-admin/wicked_folders_toggle

    Err occurs on all sites where WF is installed, so I doubt it’s sth unique to the site.

    Any ideas?

    • This topic was modified 2 years, 9 months ago by imincognito.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter imincognito

    (@imincognito)

    Updated Issue

    Wicked Folders 2.18.10
    Admin Menu Editor Pro 2.16.1

    Wicked Folders Toggle must be in the root menu of Admin Menu Editor – otherwise, there is an err 404 when toggling Wicked Folders.

    I’m posting this to both plugins’ support forums, but I suspect this is an Admin Menu Editor issue, because prior to 2.16.1, having the Wicked Toggle item in a sub-menu worked.

    Normally, I wouldn’t care, but I have a standard menu system for all my sites, so users have been trained to look for the toggle in a certain place and…some of my root menus are rather long.

    Any way to get this fixed? Certainly not urgent, but I think any WP plugin should work in a sub-menu…

    • This reply was modified 2 years, 9 months ago by imincognito.
    Thread Starter imincognito

    (@imincognito)

    Here’s Admin Menu Editor’s response – TL;DR: it appears that WF needs to tweak your code just a bit to support sub-menu items.

    Short answer:
    When you move a top-level menu item to a submenu, that necessarily changes the HTML structure of the admin menu. Wicked Folders doesn’t recognize the new structure. This could potentially be fixed by changing one or two lines in Wicked Folders.
    
    Longer, more technical answer:
    I’ve looked at parts of Wicked Folders source code, and it appears that it uses this selector to find the “Toggle folders” menu item:
    
    #adminmenu #toplevel_page_wicked_folders_toggle a
    
    It then uses some simple JavaScript to show/hide the folder pane.
    
    The second part of that selector is a unique ID. WordPress core automatically generates this ID based on the item’s slug and a few other things. WordPress uses this ID as the id attribute for a top-level menu.
    
    However, WordPress never assigns id attributes to submenu items. As a result, the selector doesn’t work when the item is in a submenu.
    
    One way to work around that would be to add an alternative selector that also works in submenus. For example, Wicked Folders could use a class instead of/in addition to an ID. Technically, the documented WordPress API doesn’t support adding CSS classes to admin menus, but the actual code does support it, and Admin Menu Editor will preserve menu CSS classes when moving an item.
    
    For example:
    
    #adminmenu .toplevel_page_wicked_folders_toggle a
    
    Something more exotic, like using the menu slug in the selector, might also work:
    
    #adminmenu li > a[href="wicked_folders_toggle"]
    Plugin Author wickedplugins

    (@wickedplugins)

    Hi @imincognito,

    Thanks for the details. We’ll look into using a class name per their suggestion and include a fix for this in the next release. Thanks for pointing out the issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Toggle – Error 404’ is closed to new replies.