• Resolved enollo

    (@enollo)


    Hi,

    I gave your plugin a try and it is looking very promising. One thing I noticed was a lot of PHP notices on the front end.

    I hunted the issue down to line 100 of power-menus.php

    instead of:

    if ( count($menu_item->power_menus_user_roles[0]) > 0 ) {

    it should be (or something to this effect):

    if ( is_array($menu_item->power_menus_user_roles) && !empty($menu_item->power_menus_user_roles) && count($menu_item->power_menus_user_roles[0]) > 0 ) {

    Before the change, I saved all of my menus and the notices went away.
    I think these wouldn’t have popped up had I not had so many menus on my test site 😉

    I had been planning on building a mini internal plugin to allow me to show/hide menu items for logged-in vs logged-out users, so I was pretty excited to find your plugin on WP Tavern. However, my main use for this would be for Login/My Account links, which your plugin does not easy allow as there is no way to hide an item for logged in users.

    Maybe you can change the ‘Visible to logged in users only’ radio buttons to checkboxes like so:
    Visible to:
    □ Logged In
    □ Logged Out

    (Both checked by default)

    Let me know your thoughts.

    Thanks

    https://wordpress.org/plugins/power-menus/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WP Idiots

    (@wpidiots)

    Hi Enollo,

    thanks for the bug reporting.

    There is a way to hide an item for logged in users. Check out FAQ https://wordpress.org/plugins/power-menus/faq/

    Plugin Author WP Idiots

    (@wpidiots)

    Plugin patched with your code! Thanks!

    Thread Starter enollo

    (@enollo)

    Thanks for the patch!

    I actually realized that I can hide items for logged in users right after I posted, but it seems a bit cumbersome to explain to clients.

    I understand the logic is a bit messy and it might take a few tries to get it just right. In terms of UX, i feel something like my checkbox example above would be more understandable. Maybe even a way to show/hide the user roles checkboxes as they are not always needed. I can already imagine the emails from my clients if they try to edit the menus themselves 🙂

    Thanks for a handy plugin!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘A "bug" and an enhancement’ is closed to new replies.