A "bug" and an enhancement
-
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
- The topic ‘A "bug" and an enhancement’ is closed to new replies.