/**
* CartFlows Functions.
*
* @package CARTFLOWS
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Fatal error mb_strpos fallback.
*
* @param string $string string where to find.
* @param string $search string to search.
* @since 1.0.0
*/
function wcf_mb_strpos( $string, $search ) {
if ( function_exists( 'mb_strpos' ) ) {
return mb_strpos( $string, $search, 0, 'utf-8' );
} else {
return strpos( $string, $search );
}
}
/**
* Check if cartflows pro activated.
*
* @since 1.0.0
*/
function _is_cartflows_pro() {
if ( defined( 'CARTFLOWS_PRO_FILE' ) ) {
return true;
}
return false;
}
/**
* Check if cartflows pro's license is been activated.
*
* @since 1.11.8
*/
function _is_cartflows_pro_license_activated() {
if ( _is_cartflows_pro() && class_exists( 'CartFlows_Pro_Licence' ) ) {
return CartFlows_Pro_Licence::get_instance()->activate_status;
}
return false;
}
/**
* Returns pro version number.
*
* @param int $version version number.
* @since 1.0.0
*/
function _is_cartflows_pro_ver_less_than( $version ) {
if ( defined( 'CARTFLOWS_PRO_VER' ) && version_compare( CARTFLOWS_PRO_VER, $version, '<' ) ) {
return true;
}
return false;
}
/**
* Returns step id.
*
* @since 1.0.0
*/
function _get_wcf_post_id() {
global $post;
if ( isset( $post->ID ) ) {
return $post->ID;
}
return 0;
}
/**
* Returns step id.
*
* @since 1.0.0
*/
function _get_wcf_step_id() {
if ( wcf()->utils->is_step_post_type() ) {
global $post;
return $post->ID;
}
return false;
}
/**
* Check if it is a landing page?
*
* @since 1.0.0
*/
function _is_wcf_landing_type() {
if ( wcf()->utils->is_step_post_type() ) {
global $post;
if ( 'landing' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
return true;
}
}
return false;
}
/**
* Returns landing id.
*
* @since 1.0.0
*/
function _get_wcf_landing_id() {
if ( _is_wcf_landing_type() ) {
global $post;
return $post->ID;
}
return false;
}
/**
* Is custom checkout?
*
* @param int $checkout_id checkout ID.
* @since 1.0.0
*/
function _is_wcf_meta_custom_checkout( $checkout_id ) {
$is_custom = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-custom-checkout-fields' );
if ( 'yes' === $is_custom ) {
return true;
}
return false;
}
/**
* Check if page is cartflow checkout.
*
* @since 1.0.0
* @return bool
*/
function _is_wcf_checkout_type() {
if ( wcf()->utils->is_step_post_type() ) {
global $post;
if ( 'checkout' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
return true;
}
}
return false;
}
/**
* Check if AJAX call is in progress.
*
* @since 1.0.0
* @return bool
*/
function _is_wcf_doing_checkout_ajax() {
//phpcs:disable WordPress.Security.NonceVerification
if ( wp_doing_ajax() || isset( $_GET['wc-ajax'] ) ) {
if ( ( isset( $_GET['wc-ajax'] ) && isset( $_POST['_wcf_checkout_id'] ) ) || isset( $_GET['wcf_checkout_id'] )
) {
return true;
}
}
//phpcs:enable WordPress.Security.NonceVerification
return false;
}
/**
* Check if optin AJAX call is in progress.
*
* @since 1.0.0
* @return bool
*/
function _is_wcf_doing_optin_ajax() {
//phpcs:disable WordPress.Security.NonceVerification
if ( wp_doing_ajax() || isset( $_GET['wc-ajax'] ) ) {
if ( isset( $_GET['wc-ajax'] ) &&
isset( $_POST['_wcf_optin_id'] )
) {
return true;
}
}
//phpcs:enable WordPress.Security.NonceVerification
return false;
}
/**
* Returns checkout ID.
*
* @since 1.0.0
* @return int/bool
*/
function _get_wcf_checkout_id() {
if ( _is_wcf_checkout_type() ) {
global $post;
return $post->ID;
}
return false;
}
/**
* Check if it is checkout shortcode.
*
* @since 1.0.0
* @return bool
*/
function _is_wcf_checkout_shortcode() {
global $post;
if ( ! empty( $post ) && has_shortcode( $post->post_content, 'cartflows_checkout' ) ) {
return true;
}
return false;
}
/**
* Check if it is checkout shortcode.
*
* @since 1.0.0
* @param string $content shortcode content.
* @return bool
*/
function _get_wcf_checkout_id_from_shortcode( $content = '' ) {
$checkout_id = 0;
if ( ! empty( $content ) ) {
$regex_pattern = get_shortcode_regex( array( 'cartflows_checkout' ) );
preg_match( '/' . $regex_pattern . '/s', $content, $regex_matches );
if ( ! empty( $regex_matches ) ) {
if ( 'cartflows_checkout' == $regex_matches[2] ) {
$attribure_str = str_replace( ' ', '&', trim( $regex_matches[3] ) );
$attribure_str = str_replace( '"', '', $attribure_str );
$attributes = wp_parse_args( $attribure_str );
if ( isset( $attributes['id'] ) ) {
$checkout_id = $attributes['id'];
}
}
}
}
return $checkout_id;
}
/**
* Check if post type is upsell.
*
* @since 1.0.0
* @return bool
*/
function _is_wcf_upsell_type() {
if ( wcf()->utils->is_step_post_type() ) {
global $post;
if ( 'upsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
return true;
}
}
return false;
}
/**
* Returns upsell ID.
*
* @since 1.0.0
* @return int/bool
*/
function _get_wcf_upsell_id() {
if ( _is_wcf_upsell_type() ) {
global $post;
return $post->ID;
}
return false;
}
/**
* Check if post is of type downsell.
*
* @since 1.0.0
* @return int/bool
*/
function _is_wcf_downsell_type() {
if ( wcf()->utils->is_step_post_type() ) {
global $post;
if ( 'downsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
return true;
}
}
return false;
}
/**
* Get downsell page ID.
*
* @since 1.0.0
* @return int/bool
*/
function _get_wcf_downsell_id() {
if ( _is_wcf_downsell_type() ) {
global $post;
return $post->ID;
}
return false;
}
/**
* Check if page is of thank you type.
*
* @since 1.0.0
* @return int/bool
*/
function _is_wcf_thankyou_type() {
if ( wcf()->utils->is_step_post_type() ) {
global $post;
if ( 'thankyou' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
return true;
}
}
return false;
}
/**
* Get thank you page ID.
*
* @since 1.0.0
* @return int/bool
*/
function _get_wcf_thankyou_id() {
if ( _is_wcf_thankyou_type() ) {
global $post;
return $post->ID;
}
return false;
}
/**
* Check if post type is upsell.
*
* @since 1.0.0
* @return bool
*/
function _is_wcf_base_offer_type() {
$result = false;
if ( wcf()->utils->is_step_post_type() ) {
global $post;
$step_type = get_post_meta( $post->ID, 'wcf-step-type', true );
if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
$result = true;
}
}
return apply_filters( 'cartflows_is_offer_type', $result );
}
/**
* Returns upsell ID.
*
* @since 1.0.0
* @return int/bool
*/
function _get_wcf_base_offer_id() {
if ( _is_wcf_base_offer_type() ) {
global $post;
return $post->ID;
}
return false;
}
/**
* Check if page is of optin type.
*
* @since 1.0.0
* @return int/bool
*/
function _is_wcf_optin_type() {
if ( wcf()->utils->is_step_post_type() ) {
global $post;
if ( 'optin' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
return true;
}
}
return false;
}
/**
* Get optin page ID.
*
* @since 1.0.0
* @return int/bool
*/
function _get_wcf_optin_id() {
if ( _is_wcf_optin_type() ) {
global $post;
return $post->ID;
}
return false;
}
/**
* Define a constant if it is not already defined.
*
* @since 3.0.0
* @param string $name Constant name.
* @param mixed $value Value.
*/
function wcf_maybe_define_constant( $name, $value ) {
if ( ! defined( $name ) ) {
define( $name, $value );
}
}
if ( ! function_exists( 'wp_body_open' ) ) {
/**
* Fire the wp_body_open action.
*
* Added for backwards compatibility to support WordPress versions prior to 5.2.0.
*/
function wp_body_open() {
/**
* Triggered after the opening tag.
*/
do_action( 'wp_body_open' );
}
}
/**
* Check if type is optin by id.
*
* @param int $post_id post id.
*
* @return int/bool
* @since 1.0.0
*/
function _wcf_check_is_optin_by_id( $post_id ) {
if ( 'optin' === get_post_meta( $post_id, 'wcf-step-type', true ) ) {
return true;
}
return false;
}
/**
* Supported Page Template
*
* @param string $page_template current page template.
*
* @return int/bool
* @since 1.5.7
*/
function _wcf_supported_template( $page_template ) {
if ( in_array( $page_template, array( 'cartflows-default', 'cartflows-canvas', 'instant-checkout' ), true ) ) {
return true;
}
return false;
}
/**
* Display design Metabox Notice.
*
* @return string
* @since 1.6.15
*/
function wcf_get_page_builder_notice() {
$notice = '';
$page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
$supported_page_builders = array( 'elementor', 'beaver-builder' );
$page_builder_data = array(
'elementor' => array(
'name' => 'Elementor',
'doc' => 'https://cartflows.com/docs/elementor-widgets-of-cartflows/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs',
),
'beaver-builder' => array(
'name' => 'Beaver Builder',
'doc' => 'https://cartflows.com/docs/beaver-builder-modules-of-cartflows/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs',
),
'gutenberg' => array(
'name' => 'Gutenebrg',
'doc' => 'https://cartflows.com/docs/cartflows-gutenberg-blocks/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs',
),
);
if ( isset( $page_builder_data[ $page_builder ] ) ) {
$page_builder_name = $page_builder_data[ $page_builder ]['name'];
$doc_link = $page_builder_data[ $page_builder ]['doc'];
$notice = '';
}
return $notice;
}
/**
* Get step type.
*
* @param int $post_id post id.
*
* @return bool|string
* @since 1.0.0
*/
function wcf_get_step_type( $post_id ) {
return get_post_meta( $post_id, 'wcf-step-type', true );
}
/**
* Get get step object.
*
* @param int $step_id current step ID.
* @since 1.5.9
*/
function wcf_get_step( $step_id ) {
if ( ! isset( wcf()->wcf_step_objs[ $step_id ] ) ) {
wcf()->wcf_step_objs[ $step_id ] = new Cartflows_Step_Factory( $step_id );
}
return wcf()->wcf_step_objs[ $step_id ];
}
/**
* Check auto-prefill checkout fields feature is enabled or not.
*
* @return boolean
*/
function is_auto_prefill_checkout_fields_enabled() {
return apply_filters( 'cartflows_auto_prefill_checkout_fields', true );
}
/**
* Is starter plan.
*
* @return boolean
*/
function is_wcf_starter_plan() {
return defined( 'CARTFLOWS_PRO_PLUGIN_TYPE' ) && CARTFLOWS_PRO_PLUGIN_TYPE === 'starter';
}
/**
* Is PRO plan.
*
* @return boolean
*/
function is_wcf_pro_plan() {
return defined( 'CARTFLOWS_PRO_PLUGIN_TYPE' ) && CARTFLOWS_PRO_PLUGIN_TYPE === 'pro';
}
/**
* Show notice.
*
* @param string $title title.
* @param string $message description.
* @param string $classes classes.
*/
function wcf_feature_notice( $title, $message, $classes ) {
$image_path = esc_url( CARTFLOWS_URL . 'assets/images/cartflows-logo-small.jpg' );
$output = '';
$output .= '
';
$output .= '

';
$output .= '
' . $title . '
' . $message . '
';
$output .= '
';
$output .= '
';
echo wp_kses_post( $output );
}
/**
* Get checkout layout type.
*
* @since 2.1.0
* @return string
*/
function wcf_get_checkout_layout() {
$checkout_id = _is_wcf_checkout_type();
if ( ! $checkout_id ) {
$checkout_id = isset( $_GET['wcf_checkout_id'] ) && ! empty( $_GET['wcf_checkout_id'] ) ? intval( wp_unslash( $_GET['wcf_checkout_id'] ) ) : 0; // phpcs:ignore WordPress.Security.NonceVerification
}
$checkout_layout = 'modern-checkout';
if ( ! empty( $checkout_id ) ) {
// Get checkout layout skin.
$checkout_layout = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-layout' );
}
return $checkout_layout;
}
/** Check weather the SureTriggers is installed and Connected.
*
* @return bool
*/
function _is_suretriggers_connected() {
// Check is the plugin installed.
if ( ! defined( 'SURE_TRIGGERS_VER' ) ) {
return false;
}
// If installed then check is it connected or not.
return apply_filters( 'suretriggers_is_user_connected', '' );
}
/**
* Check if the current theme is a block theme OR a FSE Theme.
*
* @since 2.1.1
* @return bool
*/
function wcf_is_current_theme_is_fse_theme() {
if ( function_exists( 'wp_is_block_theme' ) ) {
return boolval( wp_is_block_theme() );
}
return false;
}
/**
* Checks if deprecated step notes should be shown.
*
* This function applies a filter to determine if deprecated step notes should be displayed.
*
* @return bool Returns true if deprecated step notes should be shown, false otherwise.
*/
function wcf_show_deprecated_step_notes() {
return apply_filters( 'cartflows_show_deprecated_step_notes', false );
}import { useCallback, useEffect, useRef, useState } from '@wordpress/element';
import ReactCanvasConfetti from 'react-canvas-confetti';
const randomInRange = ( min, max ) => {
return Math.random() * ( max - min ) + min;
};
const canvasStyles = {
position: 'fixed',
pointerEvents: 'none',
width: '100%',
height: '100%',
top: 0,
left: 0,
};
const getAnimationSettings = ( originXA, originXB ) => {
return {
startVelocity: 30,
spread: 360,
ticks: 60,
zIndex: 0,
particleCount: 150,
origin: {
x: randomInRange( originXA, originXB ),
y: Math.random() - 0.2,
},
};
};
export default function Confetti() {
const refAnimationInstance = useRef( null );
const [ intervalId, setIntervalId ] = useState();
const getInstance = useCallback( ( { confetti } ) => {
refAnimationInstance.current = confetti;
}, [] );
const nextTickAnimation = useCallback( () => {
if ( refAnimationInstance.current ) {
refAnimationInstance.current( getAnimationSettings( 0.1, 0.3 ) );
refAnimationInstance.current( getAnimationSettings( 0.7, 0.9 ) );
}
}, [] );
const startAnimation = useCallback( () => {
if ( ! intervalId ) {
setIntervalId( setInterval( nextTickAnimation, 400 ) );
// stop animation after 5 seconds
setTimeout( () => {
pauseAnimation();
}, 5000 );
}
}, [ intervalId, nextTickAnimation ] );
const pauseAnimation = useCallback( () => {
clearInterval( intervalId );
setIntervalId( null );
}, [ intervalId ] );
useEffect( () => {
startAnimation();
}, [] );
useEffect( () => {
return () => {
clearInterval( intervalId );
};
}, [ intervalId ] );
return (
);
}
/*! elementor-pro - v3.30.0 - 01-07-2025 */
.woocommerce .elementor-product-price-block-yes.elementor-widget-woocommerce-product-price .price del,.woocommerce .elementor-product-price-block-yes.elementor-widget-woocommerce-product-price .price ins{display:block}/*! elementor-pro - v3.29.0 - 04-06-2025 */
.e-overlay-animation-fade{opacity:0}.e-overlay-animation-slide-up{transform:translateY(100%)}.e-overlay-animation-slide-down{transform:translateY(-100%)}.e-overlay-animation-slide-right{transform:translateX(-100%)}.e-overlay-animation-slide-left{transform:translateX(100%)}.e-overlay-animation-zoom-in{opacity:0;transform:scale(.5)}/**
* Astra Builder Controller.
*
* @package astra-builder
* @since 3.0.0
*/
// No direct access, please.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Class Astra_Builder_Customizer.
*
* Customizer Configuration for Header Footer Builder.
*
* @since 3.0.0
*/
final class Astra_Builder_Customizer {
/**
* Constructor
*
* @since 3.0.0
*/
public function __construct() {
add_action( 'customize_preview_init', array( $this, 'enqueue_customizer_preview_scripts' ) );
add_action( 'customize_register', array( $this, 'woo_header_configs' ), 2 );
$this->load_extended_components();
if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
return;
}
require_once ASTRA_THEME_DIR . 'inc/customizer/configurations/builder/class-astra-builder-base-configuration.php';
// Base Config Files.
require_once ASTRA_THEME_DIR . 'inc/customizer/configurations/builder/base/class-astra-social-icon-component-configs.php';
require_once ASTRA_THEME_DIR . 'inc/customizer/configurations/builder/base/class-astra-html-component-configs.php';
require_once ASTRA_THEME_DIR . 'inc/customizer/configurations/builder/base/class-astra-button-component-configs.php';
define( 'ASTRA_HEADER_BUILDER_CONFIGS_DIR', ASTRA_THEME_DIR . 'inc/customizer/configurations/builder/header/configs/' );
foreach ( scandir( ASTRA_HEADER_BUILDER_CONFIGS_DIR ) as $config_file ) {
$path = ASTRA_HEADER_BUILDER_CONFIGS_DIR . $config_file;
if ( is_file( $path ) ) {
require_once $path;
}
}
define( 'ASTRA_FOOTER_BUILDER_CONFIGS_DIR', ASTRA_THEME_DIR . 'inc/customizer/configurations/builder/footer/configs/' );
foreach ( scandir( ASTRA_FOOTER_BUILDER_CONFIGS_DIR ) as $config_file ) {
$path = ASTRA_FOOTER_BUILDER_CONFIGS_DIR . $config_file;
if ( is_file( $path ) ) {
require_once $path;
}
}
$this->load_base_components();
add_action( 'customize_register', array( $this, 'builder_configs' ), 2 );
add_action( 'customize_register', array( $this, 'header_configs' ), 2 );
add_action( 'customize_register', array( $this, 'footer_configs' ), 2 );
add_action( 'customize_register', array( $this, 'update_default_wp_configs' ) );
add_action( 'init', array( $this, 'deregister_menu_locations_widgets' ), 999 );
add_action( 'customize_controls_print_footer_scripts', array( $this, 'builder_customizer_preview_styles' ) );
}
/**
* Update default WP configs.
*
* @param object $wp_customize customizer object.
*/
public function update_default_wp_configs( $wp_customize ) {
$wp_customize->get_control( 'custom_logo' )->priority = 2;
$wp_customize->get_control( 'blogname' )->priority = 8;
$wp_customize->get_control( 'blogdescription' )->priority = 12;
$wp_customize->get_setting( 'custom_logo' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_section( 'title_tagline' )->panel = 'panel-header-builder-group';
$wp_customize->selective_refresh->add_partial(
'custom_logo',
array(
'selector' => '.site-branding',
'container_inclusive' => true,
'render_callback' => 'Astra_Builder_Header::site_identity',
)
);
// @codingStandardsIgnoreStart PHPCompatibility.FunctionDeclarations.NewClosure.Found
$wp_customize->selective_refresh->add_partial(
'blogdescription',
array(
'selector' => '.site-description',
'render_callback' => function() {
bloginfo( 'description' );
},
)
);
$wp_customize->selective_refresh->add_partial(
'blogname',
array(
'selector' => '.site-title',
'render_callback' => function() {
bloginfo( 'name' );
},
)
);
// @codingStandardsIgnoreStart PHPCompatibility.FunctionDeclarations.NewClosure.Found
}
/**
* Function to remove old Header and Footer Menu location and widgets.
*
* @since 3.0.0
* @return void
*/
public function deregister_menu_locations_widgets() {
// Remove Header Menus locations.
unregister_nav_menu( 'above_header_menu' );
unregister_nav_menu( 'below_header_menu' );
// Remove Header Widgets.
unregister_sidebar( 'above-header-widget-1' );
unregister_sidebar( 'above-header-widget-2' );
unregister_sidebar( 'below-header-widget-1' );
unregister_sidebar( 'below-header-widget-2' );
// Remove Footer Widgets.
unregister_sidebar( 'advanced-footer-widget-1' );
unregister_sidebar( 'advanced-footer-widget-2' );
unregister_sidebar( 'advanced-footer-widget-3' );
unregister_sidebar( 'advanced-footer-widget-4' );
unregister_sidebar( 'advanced-footer-widget-5' );
}
/**
* Attach customize_controls_print_footer_scripts preview styles conditionally.
*
* @since 3.0.0
*/
public function builder_customizer_preview_styles() {
/**
* Added Astra Pro dependent customizer style.
*/
if ( is_customize_preview() ) {
echo '';
if ( astra_wp_version_compare( '6.1', '<' ) ) {
echo '
';
}
if ( astra_wp_version_compare( '6.2', '>=' ) ) {
echo '
';
}
}
}
/**
* Add Customizer preview script.
*
* @since 3.0.0
*/
public function enqueue_customizer_preview_scripts() {
// Enqueue Builder CSS.
wp_enqueue_style(
'ahfb-customizer-preview-style',
ASTRA_THEME_URI . 'inc/assets/css/customizer-preview.css',
null,
ASTRA_THEME_VERSION
);
// Advanced Dynamic CSS.
wp_enqueue_script(
'ahfb-customizer-preview',
ASTRA_THEME_URI . 'inc/assets/js/customizer-preview.js',
array( 'customize-preview' ),
ASTRA_THEME_VERSION,
true
);
// Base Dynamic CSS.
wp_enqueue_script(
'ahfb-base-customizer-preview',
ASTRA_THEME_URI . 'inc/builder/type/base/assets/js/customizer-preview.js',
array( 'customize-preview' ),
ASTRA_THEME_VERSION,
true
);
// Localize variables for Astra Breakpoints JS.
wp_localize_script(
'ahfb-base-customizer-preview',
'astraBuilderPreview',
array(
'tablet_break_point' => astra_get_tablet_breakpoint(),
'mobile_break_point' => astra_get_mobile_breakpoint(),
)
);
wp_localize_script(
'ahfb-customizer-preview',
'astraBuilderCustomizer',
array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'ajax_nonce' => wp_create_nonce( 'astra-builder-customizer-nonce' ),
)
);
}
/**
* Register Some extended work for both old-new header footer layouts.
*
* @since 4.6.5
*/
public function load_extended_components() {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
require_once ASTRA_THEME_DIR . 'inc/customizer/class-astra-extended-base-configuration.php';
require_once ASTRA_THEME_DIR . 'inc/class-astra-extended-base-dynamic-css.php';
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Register Base Components for Builder.
*/
public function load_base_components() {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
require_once ASTRA_THEME_DIR . 'inc/builder/type/class-astra-builder-base-dynamic-css.php';
// Base Dynamic CSS Files.
require_once ASTRA_THEME_DIR . 'inc/builder/type/base/dynamic-css/html/class-astra-html-component-dynamic-css.php';
require_once ASTRA_THEME_DIR . 'inc/builder/type/base/dynamic-css/social/class-astra-social-component-dynamic-css.php';
require_once ASTRA_THEME_DIR . 'inc/builder/type/base/dynamic-css/button/class-astra-button-component-dynamic-css.php';
require_once ASTRA_THEME_DIR . 'inc/builder/type/base/dynamic-css/widget/class-astra-widget-component-dynamic-css.php';
$this->load_header_components();
$this->load_footer_components();
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Register Components for Header Builder.
*
* @since 3.0.0
*/
public function load_header_components() {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
$header_components_path = ASTRA_THEME_DIR . 'inc/builder/type/header';
require_once $header_components_path . '/site-identity/class-astra-header-site-identity-component.php';
require_once $header_components_path . '/off-canvas/class-astra-off-canvas.php';
require_once $header_components_path . '/primary-header/class-astra-primary-header.php';
require_once $header_components_path . '/button/class-astra-header-button-component.php';
require_once $header_components_path . '/menu/class-astra-header-menu-component.php';
require_once $header_components_path . '/html/class-astra-header-html-component.php';
require_once $header_components_path . '/search/class-astra-header-search-component.php';
require_once $header_components_path . '/account/class-astra-header-account-component.php';
require_once $header_components_path . '/social-icon/class-astra-header-social-icon-component.php';
require_once $header_components_path . '/widget/class-astra-header-widget-component.php';
require_once $header_components_path . '/mobile-trigger/class-astra-mobile-trigger.php';
require_once $header_components_path . '/mobile-menu/class-astra-mobile-menu-component.php';
require_once $header_components_path . '/above-header/class-astra-above-header.php';
require_once $header_components_path . '/below-header/class-astra-below-header.php';
if ( class_exists( 'Astra_Woocommerce' ) ) {
require_once $header_components_path . '/woo-cart/class-astra-header-woo-cart-component.php';
}
if ( class_exists( 'Easy_Digital_Downloads' ) ) {
require_once $header_components_path . '/edd-cart/class-astra-header-edd-cart-component.php';
}
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Register Components for Footer Builder.
*
* @since 3.0.0
*/
public function load_footer_components() {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
$footer_components_path = ASTRA_THEME_DIR . 'inc/builder/type/footer';
require_once $footer_components_path . '/below-footer/class-astra-below-footer.php';
require_once $footer_components_path . '/menu/class-astra-footer-menu-component.php';
require_once $footer_components_path . '/html/class-astra-footer-html-component.php';
require_once $footer_components_path . '/button/class-astra-footer-button-component.php';
require_once $footer_components_path . '/copyright/class-astra-footer-copyright-component.php';
require_once $footer_components_path . '/social-icon/class-astra-footer-social-icons-component.php';
require_once $footer_components_path . '/above-footer/class-astra-above-footer.php';
require_once $footer_components_path . '/primary-footer/class-astra-primary-footer.php';
require_once $footer_components_path . '/widget/class-astra-footer-widget-component.php';
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Register controls for Header/Footer Builder.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
* @since 3.0.0
*/
public function builder_configs( $wp_customize ) {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
$builder_config_path = ASTRA_THEME_DIR . 'inc/customizer/configurations/builder/';
// Header Builder.
require_once $builder_config_path . '/header/class-astra-customizer-header-builder-configs.php';
// Footer Builder.
require_once $builder_config_path . '/footer/class-astra-customizer-footer-builder-configs.php';
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Register controls for Header Builder.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
* @since 3.0.0
*/
public function header_configs( $wp_customize ) {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
$header_config_path = ASTRA_THEME_DIR . 'inc/customizer/configurations/builder/header';
require_once $header_config_path . '/class-astra-customizer-above-header-configs.php';
require_once $header_config_path . '/class-astra-customizer-below-header-configs.php';
require_once $header_config_path . '/class-astra-customizer-header-builder-configs.php';
require_once $header_config_path . '/class-astra-customizer-header-widget-configs.php';
require_once $header_config_path . '/class-astra-customizer-mobile-trigger-configs.php';
require_once $header_config_path . '/class-astra-customizer-off-canvas-configs.php';
require_once $header_config_path . '/class-astra-customizer-primary-header-configs.php';
require_once $header_config_path . '/class-astra-customizer-site-identity-configs.php';
require_once $header_config_path . '/class-astra-header-button-component-configs.php';
require_once $header_config_path . '/class-astra-header-html-component-configs.php';
require_once $header_config_path . '/class-astra-header-menu-component-configs.php';
require_once $header_config_path . '/class-astra-header-search-component-configs.php';
require_once $header_config_path . '/class-astra-header-account-component-configs.php';
require_once $header_config_path . '/class-astra-header-social-icon-component-configs.php';
if ( class_exists( 'Astra_Woocommerce' ) ) {
require_once $header_config_path . '/class-astra-customizer-woo-cart-configs.php';
}
if ( class_exists( 'Easy_Digital_Downloads' ) ) {
require_once $header_config_path . '/class-astra-customizer-edd-cart-configs.php';
}
require_once $header_config_path . '/class-astra-mobile-menu-component-configs.php';
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Register controls for Footer Builder.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
* @since 3.0.0
*/
public function footer_configs( $wp_customize ) {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
$footer_config_path = ASTRA_THEME_DIR . 'inc/customizer/configurations/builder/footer';
require_once $footer_config_path . '/class-astra-customizer-above-footer-configs.php';
require_once $footer_config_path . '/class-astra-customizer-below-footer-configs.php';
require_once $footer_config_path . '/class-astra-customizer-copyright-configs.php';
require_once $footer_config_path . '/class-astra-customizer-footer-builder-configs.php';
require_once $footer_config_path . '/class-astra-customizer-footer-menu-configs.php';
require_once $footer_config_path . '/class-astra-customizer-footer-social-icons-configs.php';
require_once $footer_config_path . '/class-astra-customizer-primary-footer-configs.php';
require_once $footer_config_path . '/class-astra-footer-html-component-configs.php';
require_once $footer_config_path . '/class-astra-footer-button-component-configs.php';
require_once $footer_config_path . '/class-astra-footer-widget-component-configs.php';
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Register Woocommerce controls for new and old Header Builder.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
* @since 3.0.0
*/
public function woo_header_configs( $wp_customize ) {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
$header_config_path = ASTRA_THEME_DIR . 'inc/customizer/configurations/builder/header';
if ( class_exists( 'Astra_Woocommerce' ) ) {
require_once $header_config_path . '/class-astra-customizer-woo-cart-configs.php';
}
if ( class_exists( 'Easy_Digital_Downloads' ) ) {
require_once $header_config_path . '/class-astra-customizer-edd-cart-configs.php';
}
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Collect Customizer Builder Data to process further.
*
* @since 4.5.2
* @return bool
*/
public static function astra_collect_customizer_builder_data() {
return ( ! is_customize_preview() && apply_filters( 'astra_collect_customizer_builder_data', false ) ) ? true : false;
}
}
/**
* Prepare if class 'Astra_Builder_Customizer' exist.
* Kicking this off by creating new object of the class.
*/
new Astra_Builder_Customizer();