Skip to content

Instantly share code, notes, and snippets.

@bnecreative
Last active July 18, 2018 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnecreative/0a3a0df6a70636810800205011c31ed4 to your computer and use it in GitHub Desktop.
Save bnecreative/0a3a0df6a70636810800205011c31ed4 to your computer and use it in GitHub Desktop.
BNE Navbar - Add custom content to nav button hidden panel
<?php // Don't copy this line...
/*
* BNE Navbar Custom Panel Content
*
* Each nav button can open a hidden panel that is primarily
* used to dispay a custom menu. However, they can also be
* used to display custom content by using the before/after
* hooks.
*
* Set the targeted nav button behavior to open a custom
* menu panel, but leave the custom menu selection to none.
*
* A notice will be shown for admins letting them know
* that a menu has not been set but this is not
* shown for non-admin users or non-logged in users.
*
* @param $navbtn string The nav button position to target
*
*/
add_action( 'bne_navbar_menu_after', function( $navbtn ) {
// Target 2nd nav button
if( $navbtn == '2' ) {
echo 'Add your custom content here...';
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment