'primary', 'menu_class' => $class, ) ); } endif; add_action( 'bizznis_header_bottom', 'bizznis_do_subnav' ); /** * Echo the "Secondary Navigation" menu. * * Applies the `bizznis_secondary_nav` and legacy `bizznis_do_subnav` filters. * * @since 1.0.0 * * @uses bizznis_nav_menu() Display a navigation menu. * @uses bizznis_nav_menu_supported() Checks for support of specific nav menu. */ if ( ! function_exists( 'bizznis_do_subnav' ) ) : function bizznis_do_subnav() { # Do nothing if menu not supported if ( ! bizznis_nav_menu_supported( 'secondary' ) ) { return; } $class = 'menu menu-bizznis menu-secondary'; bizznis_nav_menu( array( 'theme_location' => 'secondary', 'menu_class' => $class, ) ); } endif; add_filter( 'nav_primary_after', 'bizznis_nav_right', 10, 2 ); /** * Filter the Primary Navigation menu items, appending either RSS links, search form, twitter link, or today's date. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_nav_right' ) ) : function bizznis_nav_right( $menu = '', $args = '' ) { # Stop here if extras not enabled if ( ! bizznis_get_option( 'nav_extras_enable' ) ) { return $menu; } # show selected option switch ( bizznis_get_option( 'nav_extras' ) ) { case 'search': # I hate output buffering, but I have no choice ob_start(); get_search_form(); $search = ob_get_clean(); $menu .= ''; break; case 'twitter': $menu .= sprintf( '', esc_url( 'http://twitter.com/' . bizznis_get_option( 'nav_extras_twitter_id' ) ), esc_html( bizznis_get_option( 'nav_extras_twitter_text' ) ) ); break; case 'date': $menu .= ''; break; } return $menu; } endif; /** * Sets a common class, `.bizznis-nav-menu`, for the custom menu widget if used in the header sidebar. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_header_menu_args' ) ) : function bizznis_header_menu_args( $args ) { $args['container'] = ''; $args['menu_class'] .= ' menu-bizznis'; return $args; } endif; /** * Wrap the header navigation menu in its own nav tags with markup API. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_header_menu_wrap' ) ) : function bizznis_header_menu_wrap( $menu ) { return sprintf( ''; } endif; /** * Add navigation menu description * * Optionally call it inside a child theme * * @since 1.0.0 */ // add_filter( 'walker_nav_menu_start_el', 'bizznis_add_menu_description', 10, 2 ); function bizznis_add_menu_description( $item_output, $item ) { $description = $item->post_content; if ( ' ' !== $description ) { return preg_replace( '/([^<]*?)' . $description . '<', $item_output); } else { return $item_output; } }