Astra_Menu_Sidebar_Animation::localize_variables( array $localize_vars )
Add Localize variables
Description
Parameters
- $localize_vars
-
(array) (Required) Localize variables array.
Return
(array)
Source
File: classes/modules/menu-sidebar/class-astra-menu-sidebar-animation.php
public function localize_variables( $localize_vars ) { $mobile_menu_style = astra_get_option( 'mobile-menu-style' ); $mobile_menu_flyout = astra_get_option( 'flyout-mobile-menu-alignment' ); $above_mobile_menu_style = astra_get_option( 'mobile-above-header-menu-style' ); $above_mobile_menu_flyout = astra_get_option( 'flyout-mobile-above-header-menu-alignment' ); $below_mobile_menu_style = astra_get_option( 'mobile-below-header-menu-style' ); $below_mobile_menu_flyout = astra_get_option( 'flyout-mobile-below-header-menu-alignment' ); // If plugin - 'WooCommerce' not exist then return. if ( class_exists( 'WooCommerce' ) ) { $canvas_trigger_type = astra_get_option( 'shop-off-canvas-trigger-type' ); $canvas_enable = false; $canvas_trigger_class = 'astra-shop-filter-button'; if ( is_shop() || is_product_taxonomy() ) { $canvas_enable = true; } if ( 'custom-class' == $canvas_trigger_type && '' != $canvas_trigger_class ) { $canvas_trigger_class = astra_get_option( 'shop-filter-trigger-custom-class' ); } if ( 'disable' != $canvas_trigger_type ) { $localize_vars['off_canvas_trigger_class'] = $canvas_trigger_class; $localize_vars['off_canvas_enable'] = $canvas_enable; } if ( 'flyout' == $mobile_menu_style ) { $localize_vars['main_menu_flyout_alignment'] = $mobile_menu_flyout; } if ( 'flyout' == $above_mobile_menu_style ) { $localize_vars['above_menu_flyout_alignment'] = $above_mobile_menu_flyout; } if ( 'flyout' == $below_mobile_menu_style ) { $localize_vars['below_menu_flyout_alignment'] = $below_mobile_menu_flyout; } } $above_header = astra_get_option( 'header-above-stick' ); $main_header = astra_get_option( 'header-main-stick' ); $below_header = astra_get_option( 'header-below-stick' ); if ( $above_header || $main_header || $below_header ) { $localize_vars['sticky_active'] = true; } else { $localize_vars['sticky_active'] = false; } $localize_vars['svgIconClose'] = Astra_Icons::get_icons( 'close' ); return $localize_vars; }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.4.0 | Introduced. |