cookies_popup(); } public function cookies_popup() { add_filter('etheme_et_js_config', function ($config) { $config['etCookies'] = array( 'cache_time' => get_theme_mod('et_cookies_notice_cache', 3), ); return $config; }); add_action('after_page_wrapper', array($this, 'cookies_popup_content')); } public function cookies_popup_content() { self::$is_customizer = is_customize_preview(); self::$enable_cookies_popup = get_theme_mod('et_cookies_notice_switcher', 0); // html_blocks_callback functions is located in XStore Core plugin if ( ! defined( 'ET_CORE_DIR' ) ) { return; } if ( !self::$is_customizer ) { if ( !self::$enable_cookies_popup) return; if ( isset( $_COOKIE['etheme_cookies'] ) && $_COOKIE['etheme_cookies'] == 'false' ) return; } $position = get_theme_mod('et_cookies_notice_position', 'left_bottom'); $class = array( 'pos-fixed', 'hidden' ); if ( !get_theme_mod('et_cookies_notice_visibility_et-desktop', true)) { $class[] = 'dt-hide'; } if ( !get_theme_mod('et_cookies_notice_visibility_et-mobile', true)) { $class[] = 'mob-hide'; } switch ($position) { case 'left_bottom': $class[] = 'bottom'; $class[] = 'left'; break; case 'right_bottom': $class[] = 'bottom'; $class[] = 'right'; break; case 'full_bottom': $class[] = 'bottom'; $class[] = 'right'; $class[] = 'left'; break; } $content_class = array(); if ( $position != 'full_bottom' ) { $content_class[] = 'align-' . get_theme_mod('et_cookies_notice_content_content_alignment', 'center'); if (get_theme_mod('et_cookies_notice_content_content_width_height', 'auto') == 'custom') $class[] = 'cookies-content-custom-dimensions'; } $button_text = get_theme_mod('et_cookies_notice_content_button_text', esc_html__('Ok, I am ready', 'xstore')); $details_page = get_theme_mod('et_cookies_notice_details_page', ''); $details_page_link = $details_page ? get_permalink( $details_page ) : ''; ?> '; } ?> init();