Astra_Ext_Header_Sections_Markup::astra_masthead_toggle_buttons_primary()
Header toggle buttons
Description
=> Used in files:
/header.php
Source
File: addons/header-sections/classes/class-astra-ext-header-sections-markup.php
public function astra_masthead_toggle_buttons_primary() { $disable_primary_navigation = astra_get_option( 'disable-primary-nav' ); $custom_header_section = astra_get_option( 'header-main-rt-section' ); $above_header = $this->astra_above_header_enabled(); $below_header = $this->astra_below_header_enabled(); $merged_above_header = $this->astra_above_header_merged_enabled(); $merged_below_header = $this->astra_below_header_merged_enabled(); $display_outside_menu = astra_get_option( 'header-display-outside-menu' ); $above_header_on_mobile = astra_get_option( 'above-header-on-mobile' ); $below_header_on_mobile = astra_get_option( 'below-header-on-mobile' ); if ( $disable_primary_navigation && ( 'none' == $custom_header_section || ( 'none' != $custom_header_section && $display_outside_menu ) ) && ( $above_header || $below_header ) && ( $merged_above_header || $merged_below_header ) && ( $above_header_on_mobile || $below_header_on_mobile ) ) { $menu_title = trim( apply_filters( 'astra_main_menu_toggle_label', astra_get_option( 'header-main-menu-label' ) ) ); $menu_icon = apply_filters( 'astra_main_menu_toggle_icon', 'menu-toggle-icon' ); $menu_label_class = ''; $screen_reader_title = __( 'Main Menu', 'astra-addon' ); if ( '' !== $menu_title ) { $menu_label_class = 'ast-menu-label'; $screen_reader_title = $menu_title; } $menu_label_class = apply_filters( 'astra_main_menu_toggle_classes', $menu_label_class ); ?> <div class="ast-button-wrap"> <button type="button" class="menu-toggle main-header-menu-toggle <?php echo esc_attr( $menu_label_class ); ?>" aria-controls='primary-menu' aria-expanded='false'> <span class="screen-reader-text"><?php echo esc_html( $screen_reader_title ); ?></span> <span class="<?php echo esc_attr( $menu_icon ); ?>"></span> <?php if ( '' != $menu_title ) { ?> <div class="mobile-menu-wrap"> <span class="mobile-menu"><?php echo esc_html( $menu_title ); ?></span> </div> <?php } ?> </button> </div> <?php } }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |