• This plugin mostly works great, and does exactly what I need. I have, though, one page on which I want NO menu items at all to be shown. When I unchecked all the items, instead of getting no menu items I get *all* the menu items.

    Checking the code, this appears to be a deliberate choice. In the “psmi_add_menu_class” function, the code checks !empty($currentpage_items). If $currentpage_items is empty it then skips the remaining code in the function — and leaves the menu showing every possible menu item.

    This doesn’t seem like the right outcome to me. I would expect all the menu items to be hidden. If there is some problem or ambiguity in this case, I would expect all the menu items to either show or hide depending on the ‘default’ option chosen in the settings.

    A fix would seem obvious — the if test that checks !empty($currentpage_items) could simply be removed. However, I don’t know what the other consequences of that would be. Presumably this test was added for some reason. Over to you.

    NB I have a workaround for my own needs: I’ve added a hook that hides the entire menu on that particular page. However, this was exactly the kind of code I was hoping to avoid by using this plugin :-/ Still, it means I’m not waiting urgently for a fix. Just raising this to help improve what is already a very useful plugin.

Viewing 1 replies (of 1 total)
  • Thread Starter dcwarwick

    (@dcwarwick)

    Actually, there is another page where the same problem occurs, and that is the search results page — again, all the menu items appear on that. I would have expected to get *no* menu items at all on the search results page if I’ve selected ‘hide’ as the default.

    On my own system, I have edited your plugin to remove that ‘if’ test, and it seems to work fine for me. The page where I wanted no menu at all now has no menu items, as does the search results page. If there’s a particular reason why that test was included, do let me know, because I can’t test every eventuality in my site and might miss whatever it is!

    Thanks. I hope this helps.

    dave

Viewing 1 replies (of 1 total)
  • The topic ‘Unexpected outcome when all menu items unchecked’ is closed to new replies.