Astra_Ext_Sticky_Header_Loader::preview_scripts()
Customizer Preview
Description
Source
File: addons/sticky-header/classes/class-astra-ext-sticky-header-loader.php
public function preview_scripts() {
wp_register_script( 'astra-sticky-header-customizer-preview-js', ASTRA_EXT_STICKY_HEADER_URI . 'assets/js/unminified/customizer-preview.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_EXT_VER, true );
$sticky_header_style = astra_get_option( 'sticky-header-style' );
$sticky_hide_on_scroll = astra_get_option( 'sticky-hide-on-scroll' );
$localize_array = array(
'stickyHeaderStyle' => $sticky_header_style,
'stickyHideOnScroll' => $sticky_hide_on_scroll,
'component_limit' => astra_addon_builder_helper()->component_limit,
'is_flex_based_css' => Astra_Addon_Builder_Helper::apply_flex_based_css(),
'header_builder_active' => astra_addon_builder_helper()->is_header_footer_builder_active,
'sticky_header_style' => astra_get_option_meta( 'sticky-header-style' ),
'sticky_hide_on_scroll' => astra_get_option_meta( 'sticky-hide-on-scroll' ),
);
wp_localize_script( 'astra-sticky-header-customizer-preview-js', 'astSticky', $localize_array );
wp_enqueue_script( 'astra-sticky-header-customizer-preview-js' );
}
Expand full source code Collapse full source code View on Trac