Support » Plugin: Menubar » Making Menubar aware of 'current page' via php?
6 years, 3 months ago
Hey, I’m smitten with the Menubar plugin. Big ups!
I’d like to use Menubar’s php function. Where if a user is logged in show them a menu. So far so good with this code:
if (is_user_logged_in ())
return array ('Create Event', '/event/create');
return array ('Log in to create a Event', '/login');
Now. If i’m outside of the WP page realm, how would I make Menubar aware of the ‘current page’, as to add ‘.selected’ class to the li.
if ( bp_is_page( 'event' ) ) : echo'<li class='selected>'…?
if ( bp_is_page( 'event' ) ) : echo'<li class='selected>'
Try using fully qualified URLs (http://…) in your returned links, and the highlight function should work automatically. This is a bug I should fix in a future Menubar version.
Thank you for your feedback!
Andrea, Oh! That didn’t occur to me. Will do!
Ya it’s been a saving grace having your plugin in the WP tool kit.