Astra_Ext_Header_Sections_Markup::astra_get_below_header_items()
Custom Below Header Menu Item Markup
Description
=> Used in hooks:
See also
Source
File: addons/header-sections/classes/class-astra-ext-header-sections-markup.php
public function astra_get_below_header_items() { if ( function_exists( 'ubermenu_automatic_integration_filter' ) ) { remove_filter( 'wp_nav_menu_args', 'ubermenu_automatic_integration_filter', 1000 ); } $markup = ''; $below_header_on_mobile = astra_get_option( 'below-header-on-mobile' ); $below_header_enabled = $this->astra_below_header_enabled(); $below_header_layout = astra_get_option( 'below-header-layout' ); $below_header_layout_meta = astra_get_option_meta( 'ast-below-header-display' ); // Menu arguments. $below_header_menu_args = array( 'theme_location' => 'below_header_menu', 'container' => false, 'fallback_cb' => false, 'echo' => true, 'items_wrap' => '<ul class="ast-below-header-menu-items"> %3$s </ul>', ); $mobile_menu_style = astra_get_option( 'mobile-menu-style' ); // If menu style is no toggle, remove item wrap div from above header menu. if ( 'no-toggle' == $mobile_menu_style ) { $below_header_menu_args['items_wrap'] = '%3$s'; } if ( $this->astra_below_header_merged_enabled() && $below_header_on_mobile ) { ob_start(); $below_section_1 = astra_get_option( 'below-header-section-1' ); $below_section_2 = astra_get_option( 'below-header-section-2' ); if ( $below_header_enabled ) { if ( has_nav_menu( 'below_header_menu' ) ) { if ( ( 'menu' === $below_section_1 && 'below-header-layout-1' === $below_header_layout ) || ( 'menu' === $below_section_2 && 'below-header-layout-1' === $below_header_layout ) || ( 'menu' === $below_section_1 && 'below-header-layout-2' === $below_header_layout ) ) { wp_nav_menu( $below_header_menu_args ); } } ?> <div class="ast-below-header-custom-menu-items ast-container"> <?php // Left sections. if ( 'menu' !== $below_section_1 ) { self::get_below_header_section( 'below-header-section-1' ); } // Right sections. if ( 'menu' !== $below_section_2 && 'below-header-layout-1' === $below_header_layout ) { self::get_below_header_section( 'below-header-section-2' ); } ?> </div> <?php } $markup = ob_get_clean(); } if ( function_exists( 'ubermenu_automatic_integration_filter' ) ) { add_filter( 'wp_nav_menu_args', 'ubermenu_automatic_integration_filter', 1000 ); } return apply_filters( 'astra_get_below_header_items', $markup ); }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |