���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC PK!H4 footer.phpnu[ PK!WQYnn header.phpnu[ section and everything up until
* * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * * @package Astra * @since 1.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } ?> > >
'page', 'class' => 'hfeed site', ) ); ?> >
PK!44 search.phpnu[
>
PK!ь" readme.txtnu[=== Astra === Contributors: brainstormforce License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: custom-menu, custom-logo, entertainment, featured-images, full-width-template, one-column, two-columns, left-sidebar, e-commerce, right-sidebar, custom-colors, editor-style, featured-images, full-width-template, microformats, post-formats, rtl-language-support, theme-options, threaded-comments, translation-ready, blog Tested up to: 6.2.1 Requires PHP: 5.3 Stable tag: 4.1.5 Astra is fast, fully customizable & beautiful WordPress theme suitable for blog, personal portfolio, business website and WooCommerce storefront. == Description == Astra is fast, fully customizable & beautiful WordPress theme suitable for blog, personal portfolio, business website and WooCommerce storefront. It is very lightweight (less than 50KB on frontend) and offers unparalleled speed. Built with SEO in mind, Astra comes with Schema.org code integrated and is Native AMP ready so search engines will love your site. It offers special features and templates so it works perfectly with all page builders like Elementor, Beaver Builder, Visual Composer, SiteOrigin, Divi, etc. Some of the other features: # WooCommerce Ready # Responsive # RTL & Translation Ready # Extendible with premium addons # Regularly updated # Designed, Developed, Maintained & Supported by Brainstorm Force. Looking for a perfect base theme? Look no further. Astra is fast, fully customizable and WooCommerce ready theme that you can use for building any kind of website! == Installation == = From within WordPress = 1. Visit "Appearance > Themes > Add New" 2. Search for "Astra" 3. Install and activate == License == Astra WordPress Theme, Copyright 2020 WPAstra. Astra is distributed under the terms of the GNU GPL. Astra is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc. Underscores is distributed under the terms of the GNU GPL v2 or later. == Features == = Appearance > Widgets = Astra has up to 4 widget area. 1 in your header, 1 for each sidebar and up to 2 in your footer. = Appearance > Customize = - Site Identity: Hide your site title or tagline, and upload your own header. - Layout: Change things like your container width, header layout, Header width, Custom menu item , sidebar layout and much more. - Set footer layout there is a two footer layout layout 1 and layout 2. layout 1 is stack style and layout 2 is inline. - Blog: Show the full post or excerpt, also show and hide blog post meta & adjust blog post width to default or custom. - Single post:Set single post meta and adjust width to custom or default. - Colors & background: Choose your default background color, body color, theme color and link color. - Typography: Choose your default body font & set default font size to H1 to H6 tags, Site title, tagline & blog post title on archive page and single page. = ASTRA Child Theme = There are multiple ways you can use a child theme with the Astra Theme, Use any one method mentoned below to create a child theme or use a child theme we have created. 1. Download the child theme from Github - https://github.com/brainstormforce/astra-child/releases/latest/ 2. More information on creating child theme. - https://developer.wordpress.org/themes/advanced-topics/child-themes/ = Screenshot & WP-Preview Starter Content Licenses = Screenshot image is a collage of actual sites created using the Astra WordPress Theme. Icons used are all licensed under Massachusetts Institute of Technology ( MIT ) License ( https://heroicons.com ) Illustrations used are all licensed under Creative Commons ( CC0 ) License ( https://gumroad.com/l/humaaans ) https://websitedemos.net/web-design-agency-08/wp-content/uploads/sites/796/2021/05/standing-24.png https://websitedemos.net/web-design-agency-08/wp-content/uploads/sites/796/2021/05/sitting-2.png Hand-drawn illustrations used are created by Brainstorm Force and released under Creative Commons ( CC0 ) License. https://websitedemos.net/web-design-agency-08/wp-content/uploads/sites/796/2021/05/girl-with-image-container.png https://websitedemos.net/web-design-agency-08/wp-content/uploads/sites/796/2021/05/boy-with-code-container.png https://websitedemos.net/web-design-agency-08/wp-content/uploads/sites/796/2021/05/web-browser.png Images used in the WordPress preview starter content are all licensed under Creative Commons ( CC0 ) License ( https://pxhere.com ) The same site as screenshot can be imported from here https://websitedemos.net/web-design-agency-08/. For more information, refer to this document on how to create a page like in the screenshot - https://wpastra.com/docs/replicating-the-screenshot/. = Normalizing styles = Normalizing styles have been helped along thanks to the fine work of. Nicolas Gallagher and Jonathan Neal https://necolas.github.com/normalize.css/ = Flexibility JS = Flexibility is a JavaScript polyfill for Flexbox By Jonathan Neal, 10up. (https://github.com/jonathantneal/flexibility) Licensed under MIT ( https://github.com/jonathantneal/flexibility/blob/master/LICENSE.md ) = IcoMoon-Free = Astra icon font is based on IcoMoon-Free vector icon by Keyamoon. IcoMoon-Free vector icon destributed under trems of CC BY 4.0 or GPL. (https://creativecommons.org/licenses/by/4.0/ or https://www.gnu.org/licenses/gpl.html) Source: http://keyamoon.com/ = Breadcrumb Trail = Astra default breadcrumb is based on Breadcrumb Trail by Justin Tadlock. (https://github.com/justintadlock/breadcrumb-trail) Breadcrumb Trail is distributed under the terms of the GNU GPL v2 or later. Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc., [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html) = Webfonts Loader = Astra local fonts feature is based on Webfonts Loader by WordPress Themes Team (WPTT). (https://github.com/WPTT/webfont-loader) Licensed under MIT ( https://github.com/WPTT/webfont-loader/blob/master/LICENSE ) PK!C comments.phpnu[

1 && get_option( 'page_comments' ) ) : ?>
    'astra_theme_comment', 'style' => 'ol', ) ); ?>
1 && get_option( 'page_comments' ) ) : ?>

PK!я''inc/template-parts.phpnu[ Used in hooks: * * @see astra_masthead_get_menu_items * @see astra_masthead_custom_nav_menu_items * @param boolean $display_outside_markup Outside / Inside markup. * * @since 1.0.0 */ function astra_masthead_get_menu_items( $display_outside_markup = false ) { // Get selected custom menu items. $markup = ''; $section = astra_get_option( 'header-main-rt-section' ); $sections = astra_get_dynamic_header_content( 'header-main-rt-section' ); $disable_primary_navigation = astra_get_option( 'disable-primary-nav' ); $html_element = 'li'; if ( $disable_primary_navigation || $display_outside_markup ) { $html_element = 'div'; } if ( array_filter( $sections ) ) { ob_start(); $menu_item_classes = apply_filters( 'astra_masthead_custom_menu_item', array( 'ast-masthead-custom-menu-items', $section . '-custom-menu-item' ), $section ); ?> < class=""> $value ) { if ( ! empty( $value ) ) { echo $value; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } ?> > Used in files: * * /header.php * * @since 1.0.0 * @param array $args Array of arguments. * @return array Modified menu item array. */ function astra_masthead_custom_page_menu_items( $args ) { if ( isset( $args['theme_location'] ) && ! astra_get_option( 'header-display-outside-menu' ) ) { if ( 'primary' === $args['theme_location'] ) { $markup = astra_masthead_get_menu_items(); if ( $markup ) { $args['after'] = $markup . ''; } } } return $args; } endif; /** * Header Custom Menu Item */ if ( ! function_exists( 'astra_masthead_custom_nav_menu_items' ) ) : /** * Header Custom Menu Item * * => Used in files: * * /header.php * * @since 1.0.0 * @param array $items Nav menu item array. * @param array $args Nav menu item arguments array. * @return array Modified menu item array. */ function astra_masthead_custom_nav_menu_items( $items, $args ) { if ( isset( $args->theme_location ) && ! astra_get_option( 'header-display-outside-menu' ) ) { if ( 'primary' === $args->theme_location ) { $markup = astra_masthead_get_menu_items(); if ( $markup ) { $items .= $markup; } } } return $items; } endif; /** * Header toggle buttons */ if ( ! function_exists( 'astra_masthead_toggle_buttons_primary' ) ) { /** * Header toggle buttons * * => Used in files: * * /header.php * * @since 1.0.0 */ 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' ); $display_outside_menu = astra_get_option( 'header-display-outside-menu' ); if ( ! $disable_primary_navigation || ( 'none' != $custom_header_section && ! $display_outside_menu ) ) { $menu_title = trim( apply_filters( 'astra_main_menu_toggle_label', astra_get_option( 'header-main-menu-label' ) ) ); $menu_label_class = ''; $screen_reader_title = __( 'Main Menu', 'astra' ); 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 ); ?>
Used in files: * * /footer.php * * @since 1.0.0 */ function astra_footer_small_footer_template() { $small_footer_layout = astra_get_option_meta( 'footer-sml-layout', 'footer-sml-layout-2' ); $small_footer_layout = apply_filters( 'astra_footer_sml_layout', $small_footer_layout ); if ( 'disabled' != $small_footer_layout ) { $small_footer_layout = str_replace( 'footer-sml-layout-', '', $small_footer_layout ); // Default footer layout 1 is ast-footer-layout. if ( '1' == $small_footer_layout ) { $small_footer_layout = ''; } get_template_part( 'template-parts/footer/footer-sml-layout', $small_footer_layout ); } } } /** * Primary Header */ if ( ! function_exists( 'astra_masthead_primary_template' ) ) { /** * Primary Header * * => Used in files: * * /header.php * * @since 1.0.0 */ function astra_masthead_primary_template() { get_template_part( 'template-parts/header/header-main-layout' ); } } /** * Single post markup */ if ( ! function_exists( 'astra_entry_content_single_template' ) ) { /** * Single post markup * * => Used in files: * * /template-parts/content-single.php * * @since 1.0.0 */ function astra_entry_content_single_template() { get_template_part( 'template-parts/single/single-layout' ); } } /** * Blog post list markup for blog & search page */ if ( ! function_exists( 'astra_entry_content_blog_template' ) ) { /** * Blog post list markup for blog & search page * * => Used in files: * * /template-parts/content-blog.php * /template-parts/content-search.php * * @since 1.0.0 */ function astra_entry_content_blog_template() { get_template_part( 'template-parts/blog/blog-layout', apply_filters( 'astra_blog_template_name', '' ) ); } } /** * 404 markup */ if ( ! function_exists( 'astra_entry_content_404_page_template' ) ) { /** * 404 markup * * => Used in files: * * /template-parts/content-404.php * * @since 1.0.0 */ function astra_entry_content_404_page_template() { $layout_404 = astra_get_option( 'ast-404-layout' ); $layout_404 = str_replace( '404-layout-', '', $layout_404 ); // Default 404 is nothing but the 404 layout 1. if ( '1' == $layout_404 ) { $layout_404 = ''; } get_template_part( 'template-parts/404/404-layout', $layout_404 ); } } /** * Footer widgets markup */ if ( ! function_exists( 'astra_advanced_footer_markup' ) ) { /** * Footer widgets markup * * Loads appropriate template file based on the style option selected in options panel. * * @since 1.0.12 */ function astra_advanced_footer_markup() { $advanced_footer_layout = astra_get_option( 'footer-adv' ); $advanced_footer_meta = astra_get_option_meta( 'footer-adv-display' ); if ( apply_filters( 'astra_advanced_footer_disable', false ) || 'layout-4' !== $advanced_footer_layout || 'disabled' == $advanced_footer_meta ) { return; } // Add markup. get_template_part( 'template-parts/advanced-footer/layout-4' ); } } /** * Header menu item outside custom menu */ if ( ! function_exists( 'astra_header_custom_item_outside_menu' ) ) { /** * Footer widgets markup * * Loads appropriate template file based on the style option selected in options panel. * * @since 1.0.12 */ function astra_header_custom_item_outside_menu() { if ( astra_get_option( 'header-display-outside-menu' ) ) { $markup = astra_masthead_get_menu_items( true ); echo $markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } } /** * Single page markup * * => Used in files: * * /template-parts/single/content-header.php * * @since 4.0.0 */ function astra_entry_content_single_page_template() { get_template_part( 'template-parts/single/content-header' ); } PK!u u $inc/customizer/override-defaults.phpnu[get_section( 'title_tagline' )->priority = 5; $wp_customize->get_section( 'title_tagline' )->panel = 'panel-header-group'; /** * Override Settings */ $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_setting( 'custom_logo' )->transport = 'refresh'; /** * Override Controls */ $wp_customize->get_control( 'custom_logo' )->priority = 5; $wp_customize->get_control( 'blogname' )->priority = 8; $wp_customize->get_control( 'blogdescription' )->priority = 12; $wp_customize->get_control( 'header_textcolor' )->priority = 9; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.main-header-bar .site-title a, .ast-small-footer-wrap .ast-footer-site-title', 'container_inclusive' => false, 'render_callback' => 'Astra_Customizer_Partials::render_partial_site_title', ) ); } if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.main-header-bar .site-description', 'container_inclusive' => false, 'render_callback' => 'Astra_Customizer_Partials::render_partial_site_tagline', ) ); } /* * Modify WooCommerce default section priorities */ if ( class_exists( 'WooCommerce' ) ) { $wp_customize->get_section( 'woocommerce_product_images' )->priority = 25; $wp_customize->get_section( 'woocommerce_store_notice' )->priority = 26; $wp_customize->get_section( 'woocommerce_product_catalog' )->priority = 11; $wp_customize->get_section( 'woocommerce_checkout' )->priority = 21; $wp_customize->get_section( 'woocommerce_checkout' )->description = ''; $wp_customize->get_panel( 'woocommerce' )->priority = 70; } PK!'!Ovv7inc/customizer/astra-pro/class-astra-pro-customizer.phpnu[pro_url ); return $json; } /** * Outputs the Underscore.js template. * * @since 1.0.10 * @access public * @return void */ protected function render_template() { ?>
  • <# if ( data.title && data.pro_url ) { #> {{ data.title }} <# } #>

  • 'astra-pro', 'type' => 'section', 'ast_type' => 'astra-pro', 'title' => esc_html__( 'More Options Available in Astra Pro!', 'astra' ), 'pro_url' => htmlspecialchars_decode( astra_get_pro_url( 'https://wpastra.com/pricing/', 'customizer', 'free-theme', 'main-cta' ) ), 'priority' => 1, 'section_callback' => 'Astra_Pro_Customizer', ), array( 'name' => ASTRA_THEME_SETTINGS . '[astra-pro-section-notice]', 'type' => 'control', 'transport' => 'postMessage', 'control' => 'ast-hidden', 'section' => 'astra-pro', 'priority' => 0, ), ); return array_merge( $configurations, $_configs ); } } } new Astra_Pro_Upgrade_Link_Configs(); PK!9FAA1inc/customizer/class-astra-builder-customizer.phpnu[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 Base Components for Builder. */ public function load_base_components() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_THEME_DIR . 'inc/customizer/configurations/builder/class-astra-builder-base-configuration.php'; require_once ASTRA_THEME_DIR . 'inc/builder/type/class-astra-builder-base-dynamic-css.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'; // 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 } } /** * Prepare if class 'Astra_Builder_Customizer' exist. * Kicking this off by creating new object of the class. */ new Astra_Builder_Customizer(); PK!%%2inc/customizer/class-astra-customizer-partials.phpnu[ ' . $custom_button_text . '
    '; return do_shortcode( $html ); } /** * Render Partial Text Header Site Title & Tagline * * @since 2.2.0 * * @return mixed */ public static function render_header_site_title_tagline() { $site_title = astra_get_option( 'display-site-title-responsive' ); $display_site_title = ( $site_title['desktop'] || $site_title['tablet'] || $site_title['mobile'] ) ? true : false; $site_tagline = astra_get_option( 'display-site-tagline-responsive' ); $display_site_tagline = ( $site_tagline['desktop'] || $site_tagline['tablet'] || $site_tagline['mobile'] ) ? true : false; $html = astra_get_site_title_tagline( $display_site_title, $display_site_tagline ); return do_shortcode( $html ); } /** * Render Partial Footer Section 1 Credit * * @since 1.0.0 * * @return mixed */ public static function render_footer_sml_section_1_credit() { $output = astra_get_small_footer_custom_text( 'footer-sml-section-1-credit' ); return do_shortcode( $output ); } /** * Render Partial Footer Section 2 Credit * * @since 1.0.0 * * @return mixed */ public static function render_footer_sml_section_2_credit() { $output = astra_get_small_footer_custom_text( 'footer-sml-section-2-credit' ); return do_shortcode( $output ); } /** * Render Partial text for the mobile toggle menu * * @since 2.6.0 * * @return mixed */ public static function mobile_toggle_menu() { $output = astra_masthead_toggle_buttons_primary(); return do_shortcode( $output ); } } } PK! vv$inc/customizer/class-astra-fonts.phpnu[ (array) $variants, ); } } /** * Get Fonts */ public static function get_fonts() { do_action( 'astra_get_fonts' ); return apply_filters( 'astra_add_fonts', self::$fonts ); } /** * Renders the tag for all fonts in the $fonts array. * * @since 1.0.16 Added the filter 'astra_render_fonts' to support custom fonts. * @since 1.0.0 * @return void */ public static function render_fonts() { $font_list = apply_filters( 'astra_render_fonts', self::get_fonts() ); $google_fonts = array(); $font_subset = array(); $system_fonts = Astra_Font_Families::get_system_fonts(); foreach ( $font_list as $name => $font ) { if ( ! empty( $name ) && ! isset( $system_fonts[ $name ] ) ) { // Add font variants. $google_fonts[ $name ] = $font['variants']; // Add Subset. $subset = apply_filters( 'astra_font_subset', '', $name ); if ( ! empty( $subset ) ) { $font_subset[] = $subset; } } } $google_font_url = self::google_fonts_url( $google_fonts, $font_subset ); // Do not load Google font remote or local font asset if not any font selected. if ( '' === $google_font_url ) { return; } /** * Support self hosted Google Fonts. * * @since 3.6.0 */ if ( Astra_API_Init::get_admin_settings_option( 'self_hosted_gfonts', false ) && ! is_customize_preview() && ! is_admin() ) { if ( Astra_API_Init::get_admin_settings_option( 'preload_local_fonts', false ) ) { astra_load_preload_local_fonts( $google_font_url ); } wp_enqueue_style( 'astra-google-fonts', astra_get_webfont_url( $google_font_url ), array(), ASTRA_THEME_VERSION, 'all' ); } else { wp_enqueue_style( 'astra-google-fonts', $google_font_url, array(), ASTRA_THEME_VERSION, 'all' ); } } /** * Google Font URL * Combine multiple google font in one URL * * @link https://shellcreeper.com/?p=1476 * @param array $fonts Google Fonts array. * @param array $subsets Font's Subsets array. * * @return string */ public static function google_fonts_url( $fonts, $subsets = array() ) { /* URL */ $base_url = 'https://fonts.googleapis.com/css'; $font_args = array(); $family = array(); // This is deprecated filter hook. $fonts = apply_filters( 'astra_google_fonts', $fonts ); $fonts = apply_filters( 'astra_google_fonts_selected', $fonts ); /* Format Each Font Family in Array */ foreach ( $fonts as $font_name => $font_weight ) { $font_name = str_replace( ' ', '+', $font_name ); if ( ! empty( $font_weight ) ) { if ( is_array( $font_weight ) ) { $font_weight = implode( ',', $font_weight ); } $font_family = explode( ',', $font_name ); $font_family = str_replace( "'", '', astra_get_prop( $font_family, 0 ) ); $family[] = trim( $font_family . ':' . rawurlencode( trim( $font_weight ) ) ); } else { $family[] = trim( $font_name ); } } /* Only return URL if font family defined. */ if ( ! empty( $family ) ) { /* Make Font Family a String */ $family = implode( '|', $family ); /* Add font family in args */ $font_args['family'] = $family; /* Add font subsets in args */ if ( ! empty( $subsets ) ) { /* format subsets to string */ if ( is_array( $subsets ) ) { $subsets = implode( ',', $subsets ); } $font_args['subset'] = rawurlencode( trim( $subsets ) ); } $font_args['display'] = astra_get_fonts_display_property(); return esc_url_raw( add_query_arg( $font_args, $base_url ) ); } return ''; } } PK!jw11Binc/customizer/class-astra-customizer-register-sections-panels.phpnu[ 'panel-global', 'type' => 'panel', 'priority' => 10, 'title' => __( 'Global', 'astra' ), ), array( 'name' => 'section-container-layout', 'type' => 'section', 'priority' => 17, 'title' => __( 'Container', 'astra' ), 'panel' => 'panel-global', 'description_hidden' => true, 'description' => $this->section_get_description( array( 'description' => '

    ' . __( 'Helpful Information', 'astra' ) . '

    ', 'links' => array( array( 'text' => __( 'Site Layout Overview', 'astra' ) . ' »', 'attrs' => array( 'href' => astra_get_pro_url( 'https://wpastra.com/docs/site-layout-overview/?utm_source=wp&utm_medium=dashboard', 'customizer', 'helpful_information', 'astra_theme' ), ), ), array( 'text' => __( 'Container Overview', 'astra' ) . ' »', 'attrs' => array( 'href' => astra_get_pro_url( 'https://wpastra.com/docs/container-overview/?utm_source=wp&utm_medium=dashboard', 'customizer', 'helpful_information', 'astra_theme' ), ), ), ), ) ), ), /* * Header section * * @since 1.4.0 */ array( 'name' => 'panel-header-group', 'type' => 'panel', 'priority' => 20, 'title' => __( 'Header', 'astra' ), ), /* * Update the Site Identity section inside Layout -> Header * * @since 1.4.0 */ array( 'name' => 'title_tagline', 'type' => 'section', 'priority' => 5, 'title' => __( 'Site Identity', 'astra' ), 'panel' => 'panel-header-group', 'description_hidden' => true, 'description' => $this->section_get_description( array( 'description' => '

    ' . __( 'Helpful Information', 'astra' ) . '

    ', 'links' => array( array( 'text' => __( 'Site Identity Overview', 'astra' ) . ' »', 'attrs' => array( 'href' => astra_get_pro_url( 'https://wpastra.com/docs/site-identity-free/?utm_source=wp&utm_medium=dashboard', 'customizer', 'helpful_information', 'astra_theme' ), ), ), ), ) ), ), /* * Update the Primary Header section * * @since 1.4.0 */ array( 'name' => 'section-header', 'type' => 'section', 'priority' => 15, 'title' => __( 'Primary Header', 'astra' ), 'panel' => 'panel-header-group', 'description_hidden' => true, 'description' => $this->section_get_description( array( 'description' => '

    ' . __( 'Helpful Information', 'astra' ) . '

    ', 'links' => array( array( 'text' => __( 'Primary Header Overview', 'astra' ) . ' »', 'attrs' => array( 'href' => astra_get_pro_url( 'https://wpastra.com/docs/header-overview/?utm_source=wp&utm_medium=dashboard', 'customizer', 'helpful_information', 'astra_theme' ), ), ), ), ) ), ), array( 'name' => 'section-primary-menu', 'type' => 'section', 'priority' => 15, 'title' => __( 'Primary Menu', 'astra' ), 'panel' => 'panel-header-group', ), array( 'name' => 'section-footer-group', 'type' => 'section', 'title' => __( 'Footer', 'astra' ), 'priority' => 55, ), array( 'name' => 'section-separator', 'type' => 'section', 'ast_type' => 'ast-section-separator', 'priority' => 70, 'section_callback' => 'Astra_WP_Customize_Separator', ), /** * Footer Widgets Section */ array( 'name' => 'section-footer-adv', 'type' => 'section', 'title' => __( 'Footer Widgets', 'astra' ), 'section' => 'section-footer-group', 'priority' => 5, ), array( 'name' => 'section-footer-small', 'type' => 'section', 'title' => __( 'Footer Bar', 'astra' ), 'section' => 'section-footer-group', 'priority' => 10, 'description_hidden' => true, 'description' => $this->section_get_description( array( 'description' => '

    ' . __( 'Helpful Information', 'astra' ) . '

    ', 'links' => array( array( 'text' => __( 'Footer Bar Overview', 'astra' ) . ' »', 'attrs' => array( 'href' => astra_get_pro_url( 'https://wpastra.com/docs/footer-bar/?utm_source=wp&utm_medium=dashboard', 'customizer', 'helpful_information', 'astra_theme' ), ), ), ), ) ), ), array( 'name' => 'section-blog-group', 'type' => 'section', 'priority' => 40, 'title' => __( 'Blog', 'astra' ), ), array( 'name' => 'section-blog', 'type' => 'section', 'priority' => 5, 'title' => __( 'Blog / Archive', 'astra' ), 'section' => 'section-blog-group', ), array( 'name' => 'section-blog-single', 'type' => 'section', 'priority' => 10, 'title' => __( 'Single Post', 'astra' ), 'section' => 'section-blog-group', ), array( 'name' => 'section-page-dynamic-group', 'type' => 'section', 'priority' => 40, 'title' => __( 'Page', 'astra' ), ), array( 'name' => 'section-sidebars', 'type' => 'section', 'priority' => 50, 'title' => __( 'Sidebar', 'astra' ), 'description_hidden' => true, 'description' => $this->section_get_description( array( 'description' => '

    ' . __( 'Helpful Information', 'astra' ) . '

    ', 'links' => array( array( 'text' => __( 'Sidebar Overview', 'astra' ) . ' »', 'attrs' => array( 'href' => astra_get_pro_url( 'https://wpastra.com/docs/sidebar-free/?utm_source=wp&utm_medium=dashboard', 'customizer', 'helpful_information', 'astra_theme' ), ), ), ), ) ), ), /** * Accessibility Panel * * @since 4.1.0 */ array( 'name' => 'section-accessibility', 'type' => 'section', 'priority' => 65, 'title' => __( 'Accessibility', 'astra' ), 'panel' => 'panel-global', ), /** * Colors Panel */ array( 'name' => 'section-colors-background', 'type' => 'section', 'priority' => 16, 'title' => __( 'Colors', 'astra' ), 'description_hidden' => true, 'description' => $this->section_get_description( array( 'description' => '

    ' . __( 'Helpful Information', 'astra' ) . '

    ', 'links' => array( array( 'text' => __( 'Colors & Background Overview', 'astra' ) . ' »', 'attrs' => array( 'href' => astra_get_pro_url( 'https://wpastra.com/docs/colors-background/?utm_source=wp&utm_medium=dashboard', 'customizer', 'helpful_information', 'astra_theme' ), ), ), ), ) ), 'panel' => 'panel-global', ), array( 'name' => 'section-colors-body', 'type' => 'section', 'title' => __( 'Base Colors', 'astra' ), 'panel' => 'panel-global', 'priority' => 1, 'section' => 'section-colors-background', ), array( 'name' => 'section-footer-adv-color-bg', 'type' => 'section', 'title' => __( 'Footer Widgets', 'astra' ), 'panel' => 'panel-colors-background', 'priority' => 55, ), /** * Typography Panel */ array( 'name' => 'section-typography', 'type' => 'section', 'title' => __( 'Typography', 'astra' ), 'priority' => 15, 'description_hidden' => true, 'description' => $this->section_get_description( array( 'description' => '

    ' . __( 'Helpful Information', 'astra' ) . '

    ', 'links' => array( array( 'text' => __( 'Typography Overview', 'astra' ) . ' »', 'attrs' => array( 'href' => astra_get_pro_url( 'https://wpastra.com/docs/typography-free/?utm_source=wp&utm_medium=dashboard', 'customizer', 'helpful_information', 'astra_theme' ), ), ), ), ) ), 'panel' => 'panel-global', ), array( 'name' => 'section-body-typo', 'type' => 'section', 'title' => __( 'Base Typography', 'astra' ), 'section' => 'section-typography', 'priority' => 1, 'panel' => 'panel-global', ), array( 'name' => 'section-content-typo', 'type' => 'section', 'title' => __( 'Headings', 'astra' ), 'section' => 'section-typography', 'priority' => 35, 'panel' => 'panel-global', ), /** * Buttons Section */ array( 'name' => 'section-buttons', 'type' => 'section', 'priority' => 50, 'title' => __( 'Buttons', 'astra' ), 'panel' => 'panel-global', ), /** * Header Buttons */ array( 'name' => 'section-header-button', 'type' => 'section', 'priority' => 10, 'title' => __( 'Header Button', 'astra' ), 'section' => 'section-buttons', ), /** * Header Button - Default */ array( 'name' => 'section-header-button-default', 'type' => 'section', 'priority' => 10, 'title' => __( 'Primary Header Button', 'astra' ), 'section' => 'section-header-button', ), /** * Header Button - Transparent */ array( 'name' => 'section-header-button-transparent', 'type' => 'section', 'priority' => 10, 'title' => __( 'Transparent Header Button', 'astra' ), 'section' => 'section-header-button', ), /** * Block Editor specific configs. */ array( 'name' => 'section-block-editor', 'type' => 'section', 'priority' => 80, 'title' => __( 'Block Editor', 'astra' ), 'panel' => 'panel-global', ), /** * Global Misc specific configs. */ array( 'name' => 'section-global-misc', 'type' => 'section', 'priority' => 80, 'title' => __( 'Misc', 'astra' ), 'panel' => 'panel-global', ), /** * Option: Scroll To Top */ array( 'name' => 'section-scroll-to-top', 'title' => __( 'Scroll To Top', 'astra' ), 'type' => 'section', 'panel' => 'panel-global', 'priority' => 60, ), ); return array_merge( $configurations, $configs ); } } } /** * Kicking this off by calling 'get_instance()' method */ new Astra_Customizer_Register_Sections_Panels(); PK!*<<,inc/customizer/class-astra-font-families.phpnu[ array( 'fallback' => 'Verdana, Arial, sans-serif', 'weights' => array( '300', '400', '700', ), ), 'Verdana' => array( 'fallback' => 'Helvetica, Arial, sans-serif', 'weights' => array( '300', '400', '700', ), ), 'Arial' => array( 'fallback' => 'Helvetica, Verdana, sans-serif', 'weights' => array( '300', '400', '700', ), ), 'Times' => array( 'fallback' => 'Georgia, serif', 'weights' => array( '300', '400', '700', ), ), 'Georgia' => array( 'fallback' => 'Times, serif', 'weights' => array( '300', '400', '700', ), ), 'Courier' => array( 'fallback' => 'monospace', 'weights' => array( '300', '400', '700', ), ), ); } return apply_filters( 'astra_system_fonts', self::$system_fonts ); } /** * Custom Fonts * * @since 1.0.19 * * @return Array All the custom fonts in Astra */ public static function get_custom_fonts() { $custom_fonts = array(); return apply_filters( 'astra_custom_fonts', $custom_fonts ); } /** * Variant labels. * * @since 3.8.0 * @return array */ public static function font_variant_labels() { return array( '100' => __( 'Thin 100', 'astra' ), '200' => __( 'Extra Light 200', 'astra' ), '300' => __( 'Light 300', 'astra' ), '400' => __( 'Regular 400', 'astra' ), '500' => __( 'Medium 500', 'astra' ), '600' => __( 'Semi-Bold 600', 'astra' ), '700' => __( 'Bold 700', 'astra' ), '800' => __( 'Extra-Bold 800', 'astra' ), '900' => __( 'Ultra-Bold 900', 'astra' ), '100italic' => __( 'Thin 100 Italic', 'astra' ), '200italic' => __( 'Extra Light 200 Italic', 'astra' ), '300italic' => __( 'Light 300 Italic', 'astra' ), '400italic' => __( 'Regular 400 Italic', 'astra' ), 'italic' => __( 'Regular 400 Italic', 'astra' ), '500italic' => __( 'Medium 500 Italic', 'astra' ), '600italic' => __( 'Semi-Bold 600 Italic', 'astra' ), '700italic' => __( 'Bold 700 Italic', 'astra' ), '800italic' => __( 'Extra-Bold 800 Italic', 'astra' ), '900italic' => __( 'Ultra-Bold 900 Italic', 'astra' ), ); } /** * Google Fonts used in astra. * Array is generated from the google-fonts.json file. * * @since 1.0.19 * * @return Array Array of Google Fonts. */ public static function get_google_fonts() { if ( empty( self::$google_fonts ) ) { /** * Deprecating the Filter to change the Google Fonts JSON file path. * * @since 2.5.0 * @param string $json_file File where google fonts json format added. * @return array */ $google_fonts_file = apply_filters( 'astra_google_fonts_php_file', ASTRA_THEME_DIR . 'inc/google-fonts.php' ); if ( ! file_exists( $google_fonts_file ) ) { return array(); } $google_fonts_arr = include $google_fonts_file;// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound foreach ( $google_fonts_arr as $key => $font ) { $name = key( $font ); foreach ( $font[ $name ] as $font_key => $single_font ) { if ( 'variants' === $font_key ) { foreach ( $single_font as $variant_key => $variant ) { if ( 'regular' == $variant ) { $font[ $name ][ $font_key ][ $variant_key ] = '400'; } } } self::$google_fonts[ $name ] = array_values( $font[ $name ] ); } } } return apply_filters( 'astra_google_fonts', self::$google_fonts ); } } endif; PK!zLL)inc/customizer/class-astra-customizer.phpnu[' ) && is_customize_preview() ) { add_filter( 'gutenberg_use_widgets_block_editor', '__return_false' ); } add_action( 'customize_controls_enqueue_scripts', array( $this, 'controls_scripts' ) ); add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_customizer_scripts' ), 999 ); add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_footer_scripts' ) ); add_action( 'customize_register', array( $this, 'customize_register_panel' ), 2 ); add_action( 'customize_register', array( $this, 'customize_register' ) ); add_action( 'customize_register', array( $this, 'customize_register_site_icon' ), 20 ); add_action( 'customize_save_after', array( $this, 'customize_save' ) ); add_action( 'customize_save_after', array( $this, 'delete_cached_partials' ) ); add_action( 'wp_head', array( $this, 'preview_styles' ) ); add_action( 'wp_ajax_astra_regenerate_fonts_folder', array( $this, 'regenerate_astra_fonts_folder' ) ); } /** * Add site icon control in the site identity panel. * * @access public * @param WP_Customize_Manager $wp_customize Theme Customizer object. * @return void * * @since 3.6.9 */ public function customize_register_site_icon( $wp_customize ) { /** @psalm-suppress RedundantConditionGivenDocblockType */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( true !== Astra_Builder_Helper::$is_header_footer_builder_active ) { /** @psalm-suppress RedundantConditionGivenDocblockType */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort return; } $panel_arr = array( 'priority' => 80, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => 'Site Identity', 'description' => '', ); // Register panel. /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $wp_customize->add_panel( 'astra-site-identity', $panel_arr ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $section_arr = array( 'priority' => 80, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => 'Site Identity', 'description' => '', ); // Register Section. $wp_customize->add_section( 'astra-site-identity', $section_arr ); /** @psalm-suppress PossiblyNullPropertyAssignment */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $wp_customize->get_control( 'site_icon' )->section = 'astra-site-identity'; /** @psalm-suppress PossiblyNullPropertyAssignment */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress PossiblyNullPropertyAssignment */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $wp_customize->get_control( 'site_icon' )->description = __( 'Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. Upload one here! Site Icons should be square and at least 512 × 512 pixels.', 'astra' ); /** @psalm-suppress PossiblyNullPropertyAssignment */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort } /** * Reset font folder * * @access public * @return void * * @since 3.6.0 */ public function regenerate_astra_fonts_folder() { check_ajax_referer( 'astra_update_admin_setting', 'security' ); if ( ! current_user_can( 'edit_theme_options' ) ) { wp_send_json_error( 'invalid_permissions' ); } if ( Astra_API_Init::get_admin_settings_option( 'self_hosted_gfonts', false ) ) { $local_font_loader = astra_webfont_loader_instance( '' ); $flushed = $local_font_loader->astra_delete_fonts_folder(); if ( ! $flushed ) { $response_data = array( 'message' => __( 'Failed to Flush, try again later.', 'astra' ) ); wp_send_json_error( $response_data ); } wp_send_json_success(); } $response_data = array( 'message' => __( 'Local font files not present.', 'astra' ) ); wp_send_json_error( $response_data ); } /** * Delete the cached partial configs. */ public function delete_cached_partials() { delete_option( 'astra_partials_config_cache' ); // Delete previously stored local fonts data, if exists. if ( Astra_API_Init::get_admin_settings_option( 'self_hosted_gfonts', false ) ) { $local_webfont_loader = astra_webfont_loader_instance( '' ); $local_webfont_loader->astra_delete_fonts_folder(); } } /** * Add dynamic control partial refresh. * * @since 3.1.0 * @param array $partial_args partial configs. * @param string $partial_id partial id. * @return array|mixed */ public function filter_dynamic_partial_args( $partial_args, $partial_id ) { if ( isset( self::$dynamic_options['partials'][ $partial_id ] ) ) { if ( false === $partial_args ) { $partial_args = array(); } $partial_args = array_merge( $partial_args, self::$dynamic_options['partials'][ $partial_id ] ); } return $partial_args; } /** * Add dynamic control settings. * * @since 3.1.0 * @param array $setting_args setting configs. * @param string $setting_id setting id. * @return mixed */ public function filter_dynamic_setting_args( $setting_args, $setting_id ) { if ( isset( self::$dynamic_options['settings'][ $setting_id ] ) ) { return self::$dynamic_options['settings'][ $setting_id ]; } return $setting_args; } /** * Prepare Contexts and choices. * * @since 3.0.0 */ public function prepare_customizer_javascript_configs() { global $wp_customize; $cached_data = get_option( 'astra_partials_config_cache', false ); if ( $wp_customize->selective_refresh->is_render_partials_request() && $cached_data ) { self::$dynamic_options = $cached_data; return; } $configurations = $this->get_customizer_configurations(); $defaults = $this->get_astra_customizer_configuration_defaults(); foreach ( $configurations as $key => $configuration ) { $config = wp_parse_args( $configuration, $defaults ); if ( isset( $configuration['context'] ) ) { self::$contexts[ $configuration['name'] ] = $configuration['context']; } else { if ( isset( $configuration['type'] ) && ( ( 'control' === $configuration['type'] ) || ( 'sub-control' === $configuration['type'] ) ) ) { if ( ( isset( $configuration['control'] ) && 'ast-builder-header-control' !== $configuration['control'] ) && ( isset( $configuration['name'] ) && strpos( $configuration['name'], 'ast-callback-notice' ) === false ) ) { self::$contexts[ $configuration['name'] ] = Astra_Builder_Helper::$general_tab; } } } if ( isset( $configuration['choices'] ) ) { self::$choices[ $configuration['name'] ] = $configuration['choices']; } switch ( $config['type'] ) { case 'panel': $this->prepare_javascript_panel_configs( $config ); break; case 'section': $this->prepare_javascript_section_configs( $config ); break; case 'sub-control': $this->prepare_javascript_sub_control_configs( $config ); break; case 'control': $this->prepare_javascript_control_configs( $config ); break; } } update_option( 'astra_partials_config_cache', self::$dynamic_options, false ); } /** * Get control default. * * @param string $setting_key setting key. * @param array $default_values default value array. * @return mixed|string */ private function get_default_value( $setting_key, $default_values ) { $return = ''; preg_match( '#astra-settings\[(.*?)\]#', $setting_key, $match ); if ( ! empty( $match ) && isset( $match[1] ) ) { $return = isset( $default_values[ $match[1] ] ) ? $default_values[ $match[1] ] : ''; } return $return; } /** * Prepare tabbed sections for dynamic controls to optimize frontend JS calls. */ private static function prepare_tabbed_sections() { if ( ! isset( self::$js_configs['controls'] ) ) { return; } foreach ( self::$js_configs['controls'] as $section_id => $controls ) { $tab_id = $section_id . '-ast-context-tabs'; $control_names = wp_list_pluck( $controls, 'name' ); if ( in_array( $tab_id, $control_names, true ) ) { array_push( self::$tabbed_sections, $section_id ); } } } /** * Print Footer Scripts * * @since 1.0.0 * @return void */ public function print_footer_scripts() { $output = ''; echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Set default context for WP default controls. */ private static function set_default_context() { if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { return; } self::$contexts['blogname'] = array( Astra_Builder_Helper::$general_tab_config, ); self::$contexts['blogdescription'] = array( Astra_Builder_Helper::$general_tab_config, ); } /** * Bypass JS configs for Controls. * * @param array $configuration configuration. */ public static function bypass_control_configs( $configuration ) { $val = ''; if ( isset( $configuration['name'] ) ) { $data = explode( '[', rtrim( $configuration['name'], ']' ) ); if ( isset( $data[1] ) ) { $val = astra_get_option( $data[1] ); } } if ( isset( $val ) && ! empty( $val ) ) { $configuration['value'] = $val; } switch ( $configuration['type'] ) { case 'ast-builder': if ( is_array( $configuration['default'] ) && ! isset( $configuration['default']['popup'] ) ) { $configuration['default']['popup'] = array( 'popup_content' => array() ); } break; case 'ast-responsive-spacing': if ( ! is_array( $val ) || is_numeric( $val ) ) { $configuration['value'] = array( 'desktop' => array( 'top' => $val, 'right' => '', 'bottom' => $val, 'left' => '', ), 'tablet' => array( 'top' => $val, 'right' => '', 'bottom' => $val, 'left' => '', ), 'mobile' => array( 'top' => $val, 'right' => '', 'bottom' => $val, 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); } break; case 'ast-radio-image': $configuration['value'] = $val; if ( isset( $configuration['choices'] ) && is_array( $configuration['choices'] ) ) { foreach ( $configuration['choices'] as $key => $value ) { $configuration['choices'][ $key ] = $value['path']; $configuration['choices_titles'][ $key ] = $value['label']; $configuration['choices_upgrade'][ $key ] = isset( $value['is_pro'] ) ? $value['is_pro'] : false; } } if ( isset( $configuration['input_attrs'] ) ) { $configuration['inputAttrs'] = ''; $configuration['labelStyle'] = ''; foreach ( $configuration['input_attrs'] as $attr => $value ) { if ( 'style' !== $attr ) { $configuration['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; } else { $configuration['labelStyle'] = 'style="' . esc_attr( $value ) . '" '; } } } break; case 'ast-border': $configuration['value'] = $val; break; case 'ast-section-toggle': $configuration['value'] = $val; break; case 'ast-responsive-slider': if ( ! is_array( $val ) || is_numeric( $val ) ) { $configuration['value'] = array( 'desktop' => $val, 'tablet' => '', 'mobile' => '', ); } break; case 'ast-responsive-background': $configuration['value'] = $val; break; case 'ast-link': $configuration['value'] = $val; break; case 'ast-hidden': $configuration['value'] = $val; break; case 'ast-settings-group': $config = array(); if ( isset( self::$group_configs[ $configuration['name'] ]['tabs'] ) ) { $tab = array_keys( self::$group_configs[ $configuration['name'] ]['tabs'] ); rsort( $tab ); foreach ( $tab as $key => $value ) { $config['tabs'][ $value ] = wp_list_sort( self::$group_configs[ $configuration['name'] ]['tabs'][ $value ], 'priority' ); } } else { if ( isset( self::$group_configs[ $configuration['name'] ] ) ) { $config = wp_list_sort( self::$group_configs[ $configuration['name'] ], 'priority' ); } } $configuration['ast_fields'] = $config; break; case 'ast-font-weight': $configuration['ast_all_font_weight'] = array( '100' => __( 'Thin 100', 'astra' ), '100italic' => __( '100 Italic', 'astra' ), '200' => __( 'Extra-Light 200', 'astra' ), '200italic' => __( '200 Italic', 'astra' ), '300' => __( 'Light 300', 'astra' ), '300italic' => __( '300 Italic', 'astra' ), '400' => __( 'Normal 400', 'astra' ), 'italic' => __( '400 Italic', 'astra' ), '500' => __( 'Medium 500', 'astra' ), '500italic' => __( '500 Italic', 'astra' ), '600' => __( 'Semi-Bold 600', 'astra' ), '600italic' => __( '600 Italic', 'astra' ), '700' => __( 'Bold 700', 'astra' ), '700italic' => __( '700 Italic', 'astra' ), '800' => __( 'Extra-Bold 800', 'astra' ), '800italic' => __( '800 Italic', 'astra' ), '900' => __( 'Ultra-Bold 900', 'astra' ), '900italic' => __( '900 Italic', 'astra' ), ); break; case 'ast-sortable': $configuration['value'] = $val; if ( isset( self::$group_configs[ $configuration['name'] ] ) ) { /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $config = wp_list_sort( self::$group_configs[ $configuration['name'] ], 'priority' ); /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $configuration['ast_fields'] = $config; } break; case 'ast-font-variant': $configuration['value'] = $val; break; } // Switch End. if ( isset( $configuration['id'] ) ) { $configuration['link'] = self::get_control_link( $configuration['id'] ); } $exclude_controls = array( 'ast-builder', 'ast-radio-image' ); if ( isset( $configuration['type'] ) && ! in_array( $configuration['type'], $exclude_controls ) && isset( $configuration['input_attrs'] ) && is_array( $configuration['input_attrs'] ) ) { $configuration['inputAttrs'] = ''; foreach ( $configuration['input_attrs'] as $attr => $value ) { if ( ! is_array( $value ) ) { $configuration['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; } } } return $configuration; } /** * Prepare Panel Configs for Javascript. * * @since 3.0.0 * @param array $config configs. */ public function prepare_javascript_panel_configs( $config ) { $panel_name = astra_get_prop( $config, 'name' ); unset( $config['type'] ); $config['type'] = 'ast_panel'; $config['active'] = true; $config['id'] = $panel_name; self::$js_configs['panels'][ $panel_name ] = $config; } /** * Prepare Section Configs for Javascript. * * @since 3.0.0 * @param array $config configs. */ public function prepare_javascript_section_configs( $config ) { $section_name = astra_get_prop( $config, 'name' ); unset( $config['type'] ); $config['type'] = isset( $config['ast_type'] ) ? $config['ast_type'] : 'ast_section'; $config['active'] = true; $config['id'] = $section_name; $config['customizeAction'] = sprintf( 'Customizing ▸ %s', astra_get_prop( $config, 'title' ) ); if ( isset( $config['clone_type'] ) && isset( $config['clone_index'] ) ) { if ( isset( Astra_Builder_Helper::$component_count_array[ $config['clone_type'] ] ) ) { if ( in_array( $section_name, Astra_Builder_Helper::$component_count_array['removed-items'], true ) || Astra_Builder_Helper::$component_count_array[ $config['clone_type'] ] < $config['clone_index'] ) { self::$js_configs['clone_sections'][ $section_name ] = $config; } else { self::$js_configs['sections'][ $section_name ] = $config; } } } else { self::$js_configs['sections'][ $section_name ] = $config; } } /** * Prepare Sub Control Configs for Javascript. * * @since 3.0.0 * @param array $config configs. */ public function prepare_javascript_sub_control_configs( $config ) { global $wp_customize; unset( $config['type'] ); $sub_control_name = ASTRA_THEME_SETTINGS . '[' . astra_get_prop( $config, 'name' ) . ']'; $parent = astra_get_prop( $config, 'parent' ); $ignore_controls = array( 'ast-settings-group', 'ast-sortable', 'ast-radio-image', 'ast-slider', 'ast-responsive-slider', 'ast-section-toggle' ); $sanitize_callback = ( in_array( $config['control'], $ignore_controls, true ) ) ? false : astra_get_prop( $config, 'sanitize_callback', Astra_Customizer_Control_Base::get_sanitize_call( astra_get_prop( $config, 'control' ) ) ); if ( ! $sanitize_callback ) { $config = $this->sanitize_control( $config ); } $new_config = array( 'name' => $sub_control_name, 'datastore_type' => 'option', 'transport' => 'postMessage', 'control' => 'ast-hidden', 'section' => astra_get_prop( $config, 'section', 'title_tagline' ), 'title' => astra_get_prop( $config, 'title' ), 'priority' => astra_get_prop( $config, 'priority', '10' ), 'default' => astra_get_prop( $config, 'default' ), 'sanitize_callback' => $sanitize_callback, 'suffix' => astra_get_prop( $config, 'suffix' ), 'control_type' => astra_get_prop( $config, 'control' ), 'linked' => astra_get_prop( $config, 'linked' ), 'variant' => astra_get_prop( $config, 'variant' ), 'help' => astra_get_prop( $config, 'help' ), 'input_attrs' => astra_get_prop( $config, 'input_attrs' ), 'disable' => astra_get_prop( $config, 'disable' ), ); self::$dynamic_options['settings'][ astra_get_prop( $new_config, 'name' ) ] = array( 'default' => astra_get_prop( $new_config, 'default' ), 'type' => astra_get_prop( $new_config, 'datastore_type' ), 'transport' => astra_get_prop( $new_config, 'transport', 'refresh' ), 'sanitize_callback' => astra_get_prop( $new_config, 'sanitize_callback', Astra_Customizer_Control_Base::get_sanitize_call( astra_get_prop( $new_config, 'control' ) ) ), ); $new_config['type'] = astra_get_prop( $new_config, 'control' ); $new_config['id'] = astra_get_prop( $new_config, 'name' ); $new_config['settings'] = array( 'default' => astra_get_prop( $new_config, 'name' ) ); $new_config = self::bypass_control_configs( $new_config ); self::$js_configs ['sub_controls'] [ $parent ] [] = $new_config; } /** * Get the Link for Control. * * @since 3.0.0 * @param array $id Control ID. */ public static function get_control_link( $id ) { if ( isset( $id ) ) { return 'data-customize-setting-link="' . $id . '"'; } else { return 'data-customize-setting-key-link="default"'; } } /** * Prepare Control Configs for Javascript. * * @since 3.0.0 * @param array $config configs. */ public function prepare_javascript_control_configs( $config ) { global $wp_customize; // Remove type from configuration. unset( $config['type'] ); $ignore_controls = array( 'ast-settings-group', 'ast-sortable', 'ast-radio-image', 'ast-slider', 'ast-responsive-slider', 'ast-section-toggle' ); if ( ! isset( $config['control'] ) ) { return; } $sanitize_callback = ( in_array( $config['control'], $ignore_controls, true ) ) ? false : astra_get_prop( $config, 'sanitize_callback', Astra_Customizer_Control_Base::get_sanitize_call( astra_get_prop( $config, 'control' ) ) ); if ( ! $sanitize_callback ) { $config = $this->sanitize_control( $config ); } $config['label'] = astra_get_prop( $config, 'title' ); $config['type'] = astra_get_prop( $config, 'control' ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( false !== astra_get_prop( $config, 'font-type', false ) ) { /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $config['type'] = astra_get_prop( $config, 'font-type', false ); } if ( 'image' === $config['type'] ) { $this->prepare_preload_controls( $config ); } if ( isset( $config['active_callback'] ) ) { self::$js_configs ['skip_context'] [] = astra_get_prop( $config, 'name' ); $this->prepare_preload_controls( $config ); return; } self::$dynamic_options['settings'][ astra_get_prop( $config, 'name' ) ] = array( 'default' => astra_get_prop( $config, 'default' ), 'type' => astra_get_prop( $config, 'datastore_type' ), 'transport' => astra_get_prop( $config, 'transport', 'refresh' ), 'sanitize_callback' => $sanitize_callback, ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( astra_get_prop( $config, 'partial', false ) ) { self::$dynamic_options['partials'][ astra_get_prop( $config, 'name' ) ] = array( 'selector' => astra_get_prop( $config['partial'], 'selector' ), 'render_callback' => astra_get_prop( $config['partial'], 'render_callback' ), 'containerInclusive' => astra_get_prop( $config['partial'], 'container_inclusive' ), 'fallbackRefresh' => astra_get_prop( $config['partial'], 'fallback_refresh', true ), ); } $config['id'] = astra_get_prop( $config, 'name' ); $config['settings'] = array( 'default' => astra_get_prop( $config, 'name' ) ); $config = self::bypass_control_configs( $config ); if ( isset( $config['section'] ) ) { self::$js_configs ['controls'] [ $config['section'] ] [] = $config; } } /** * Map and add sanitize callback to JS configs. * * @param array $config js config array. * @return mixed */ public function sanitize_control( $config ) { $control_type = isset( $config['control'] ) ? $config['control'] : ''; switch ( $control_type ) { case 'color': $config['sanitize_callback'] = array( 'Astra_Customizer_Sanitizes', 'sanitize_hex_color' ); break; case 'ast-border': $config['sanitize_callback'] = array( 'Astra_Customizer_Sanitizes', 'sanitize_border' ); break; case 'ast-html-editor': $config['sanitize_callback'] = array( 'Astra_Customizer_Sanitizes', 'sanitize_html' ); break; case 'ast-color': $config['sanitize_callback'] = array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ); break; case 'ast-sortable': $config ['sanitize_callback'] = array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ); break; case 'ast-radio-image': $config ['sanitize_callback'] = array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ); break; case 'ast-link': $config ['sanitize_callback'] = array( 'Astra_Customizer_Sanitizes', 'sanitize_link' ); break; case 'ast-customizer-link': $config ['sanitize_callback'] = array( 'Astra_Customizer_Sanitizes', 'sanitize_customizer_links' ); break; case 'ast-responsive-slider': $config ['sanitize_callback'] = array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ); break; case 'ast-toggle-control': case 'ast-section-toggle': $config ['sanitize_callback'] = array( 'Astra_Customizer_Sanitizes', 'sanitize_toggle_control' ); break; default: break; } return $config; } /** * Add controls for which active_callback is added. * * @since 3.0.0 * @param array $config config. */ public function prepare_preload_controls( $config ) { global $wp_customize; $instance = Astra_Customizer_Control_Base::get_control_instance( astra_get_prop( $config, 'control' ) ); // Forwarding to the DOM as default control. if ( 'title_tagline' !== $config['section'] ) { self::$js_configs ['wp_defaults'][ astra_get_prop( $config, 'name' ) ] = $config['section']; $config['section'] = 'title_tagline'; } $wp_customize->add_setting( astra_get_prop( $config, 'name' ), array( 'default' => astra_get_prop( $config, 'default' ), 'type' => astra_get_prop( $config, 'datastore_type' ), 'transport' => astra_get_prop( $config, 'transport', 'refresh' ), 'sanitize_callback' => astra_get_prop( $config, 'sanitize_callback', Astra_Customizer_Control_Base::get_sanitize_call( astra_get_prop( $config, 'control' ) ) ), ) ); if ( false !== $instance ) { $wp_customize->add_control( new $instance( $wp_customize, astra_get_prop( $config, 'name' ), $config ) ); } else { $wp_customize->add_control( astra_get_prop( $config, 'name' ), $config ); } } /** * Prepare Group configs to visible sub-controls. * * @since 3.0.0 * @param object $wp_customize customizer object. */ public function prepare_group_configs( $wp_customize ) { if ( $wp_customize->selective_refresh->is_render_partials_request() ) { return; } $configurations = $this->get_customizer_configurations(); $defaults = $this->get_astra_customizer_configuration_defaults(); foreach ( $configurations as $key => $configuration ) { $config = wp_parse_args( $configuration, $defaults ); if ( 'sub-control' === $config['type'] ) { unset( $config['type'] ); $parent = astra_get_prop( $config, 'parent' ); $tab = astra_get_prop( $config, 'tab' ); if ( empty( self::$group_configs[ $parent ] ) ) { self::$group_configs[ $parent ] = array(); } if ( array_key_exists( 'tab', $config ) ) { self::$group_configs[ $parent ]['tabs'][ $tab ][] = $config; } else { self::$group_configs[ $parent ][] = $config; } } } } /** * Prepare context. * * @return mixed|void */ public static function get_contexts() { self::set_default_context(); // Return contexts. return apply_filters( 'astra_customizer_context', self::$contexts ); } /** * Prepare choices. * * @return mixed|void */ public static function get_choices() { // Return contexts. return apply_filters( 'astra_customizer_choices', self::$choices ); } /** * Prepare javascript configs. * * @return mixed|void */ public static function get_js_configs() { // Return contexts. return apply_filters( 'astra_javascript_configurations', self::$js_configs ); } /** * Prepare tabbed sections. * * @return mixed|void */ public static function get_tabbed_sections() { self::prepare_tabbed_sections(); // Return contexts. return apply_filters( 'astra_customizer_tabbed_sections', self::$tabbed_sections ); } /** * Prepare default values for the control. * * @return array */ private function get_control_defaults() { $defaults = array(); $default_values = Astra_Theme_Options::defaults(); $default_controls = array_merge( self::$js_configs['controls'], self::$js_configs['sub_controls'] ); foreach ( $default_controls as $section_controls ) { foreach ( $section_controls as $control ) { $control_id = astra_get_prop( $control, 'name' ); if ( 'ast-responsive-spacing' === $control['control'] ) { $defaults[ $control_id ] = array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); } else { $defaults[ $control_id ] = $this->get_default_value( $control_id, $default_values ); } } } return $defaults; } /** * Add customizer script. * * @since 3.0.0 */ public function enqueue_customizer_scripts() { $sorted_menus = array( '0' => __( 'Select Menu', 'astra' ), ); $all_menus = get_terms( array( 'taxonomy' => 'nav_menu', 'hide_empty' => true, ) ); if ( is_array( $all_menus ) && count( $all_menus ) ) { foreach ( $all_menus as $row ) { /** @psalm-suppress PossiblyInvalidPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $sorted_menus[ $row->term_id ] = $row->name; /** @psalm-suppress PossiblyInvalidPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort } } $resultant_menus = array(); foreach ( $sorted_menus as $id => $menu ) { $resultant_menus[ $id ] = $menu; } // Localize variables for Dev mode > Customizer JS. wp_localize_script( 'astra-custom-control-script', 'AstraBuilderCustomizerData', array( 'contexts' => self::get_contexts(), 'dynamic_setting_options' => self::$dynamic_options['settings'], 'choices' => self::get_choices(), 'js_configs' => self::get_js_configs(), 'tabbed_sections' => self::get_tabbed_sections(), 'component_limit' => Astra_Builder_Helper::$component_limit, 'is_site_rtl' => is_rtl(), 'defaults' => $this->get_control_defaults(), 'isWP_5_9' => astra_wp_version_compare( '5.8.99', '>=' ), 'astraRegenerateFonts' => wp_create_nonce( 'astra-regenerate-local-fonts' ), 'initialFlushText' => __( 'Flush Local Font Files', 'astra' ), 'successFlushed' => __( 'Successfully Flushed', 'astra' ), 'failedFlushed' => __( 'Failed, Please try again later.', 'astra' ), 'googleFonts' => Astra_Font_Families::get_google_fonts(), 'variantLabels' => Astra_Font_Families::font_variant_labels(), 'menuLocations' => $resultant_menus, 'upgradeUrl' => ASTRA_PRO_CUSTOMIZER_UPGRADE_URL, ) ); if ( is_rtl() ) { $builder_customizer_css_file = 'ast-builder-customizer-rtl'; $font_icon_picker_css_file = 'font-icon-picker-rtl'; } else { $builder_customizer_css_file = 'ast-builder-customizer'; $font_icon_picker_css_file = 'font-icon-picker'; } // Enqueue Builder CSS. wp_enqueue_style( 'ahfb-customizer-style', ASTRA_THEME_URI . 'inc/assets/css/' . $builder_customizer_css_file . '.css', array( 'wp-components' ), ASTRA_THEME_VERSION ); wp_enqueue_style( 'ahfb-customizer-color-picker-style', ASTRA_THEME_URI . 'inc/assets/css/' . $font_icon_picker_css_file . '.css', array( 'wp-components' ), ASTRA_THEME_VERSION ); } /** * Check if string is start with a string provided. * * @param string $string main string. * @param string $start_string string to search. * @since 2.0.0 * @return bool. */ public function starts_with( $string, $start_string ) { $len = strlen( $start_string ); return ( substr( $string, 0, $len ) === $start_string ); } /** * Filter and return Customizer Configurations. * * @since 1.4.3 * @return Array Customizer Configurations for registering Sections/Panels/Controls. */ private function get_customizer_configurations() { global $wp_customize; if ( ! is_null( self::$configuration ) ) { return self::$configuration; } self::$configuration = apply_filters( 'astra_customizer_configurations', array(), $wp_customize ); return self::$configuration; } /** * Return default values for the Customize Configurations. * * @since 1.4.3 * @return Array default values for the Customizer Configurations. */ private function get_astra_customizer_configuration_defaults() { return apply_filters( 'astra_customizer_configuration_defaults', array( 'priority' => null, 'title' => null, 'label' => null, 'name' => null, 'type' => null, 'description' => null, 'capability' => null, 'datastore_type' => 'option', // theme_mod or option. Default option. 'settings' => null, 'active_callback' => null, 'sanitize_callback' => null, 'sanitize_js_callback' => null, 'theme_supports' => null, 'transport' => null, 'default' => null, 'selector' => null, 'ast_fields' => array(), ) ); } /** * Include Customizer Configuration files. * * @since 1.4.3 * @return void */ public function include_configurations() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require ASTRA_THEME_DIR . 'inc/customizer/configurations/class-astra-customizer-config-base.php'; /** * Register Sections & Panels */ require ASTRA_THEME_DIR . 'inc/customizer/class-astra-customizer-register-sections-panels.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/buttons/class-astra-customizer-button-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/layout/class-astra-site-layout-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/layout/class-astra-site-identity-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/layout/class-astra-blog-layout-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/layout/class-astra-blog-single-layout-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/layout/class-astra-sidebar-layout-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/layout/class-astra-site-container-layout-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/colors-background/class-astra-body-colors-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/typography/class-astra-archive-typo-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/typography/class-astra-body-typo-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/block-editor/class-astra-block-editor-configs.php'; if( astra_has_gcp_typo_preset_compatibility() ) { require ASTRA_THEME_DIR . 'inc/customizer/configurations/typography/class-astra-headings-typo-configs.php'; } else { require ASTRA_THEME_DIR . 'inc/customizer/configurations/typography/class-astra-content-typo-configs.php'; } require ASTRA_THEME_DIR . 'inc/customizer/configurations/typography/class-astra-header-typo-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/typography/class-astra-single-typo-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/typography/class-astra-global-typo-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/global-misc/class-astra-global-misc-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/accessibility/class-astra-accessibility-configs.php'; if ( astra_existing_header_footer_configs() ) { require ASTRA_THEME_DIR . 'inc/customizer/configurations/buttons/class-astra-existing-button-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/layout/class-astra-header-layout-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/layout/class-astra-footer-layout-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/colors-background/class-astra-advanced-footer-colors-configs.php'; require ASTRA_THEME_DIR . 'inc/customizer/configurations/colors-background/class-astra-footer-colors-configs.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } /** * Register custom section and panel. * * @since 1.0.0 * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ public function customize_register_panel( $wp_customize ) { /** * Register Extended Panel */ $wp_customize->register_panel_type( 'Astra_WP_Customize_Panel' ); $wp_customize->register_section_type( 'Astra_WP_Customize_Section' ); $wp_customize->register_section_type( 'Astra_WP_Customize_Separator' ); if ( ! defined( 'ASTRA_EXT_VER' ) ) { $wp_customize->register_section_type( 'Astra_Pro_Customizer' ); } // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require ASTRA_THEME_DIR . 'inc/customizer/extend-customizer/class-astra-wp-customize-panel.php'; require ASTRA_THEME_DIR . 'inc/customizer/extend-customizer/class-astra-wp-customize-section.php'; require ASTRA_THEME_DIR . 'inc/customizer/extend-customizer/class-astra-wp-customize-separator.php'; require ASTRA_THEME_DIR . 'inc/customizer/customizer-controls.php'; // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound /** * Add Controls */ Astra_Customizer_Control_Base::add_control( 'image', array( 'callback' => 'WP_Customize_Image_Control', 'sanitize_callback' => 'esc_url_raw', ) ); Astra_Customizer_Control_Base::add_control( 'ast-font', array( 'callback' => 'Astra_Control_Typography', 'sanitize_callback' => 'sanitize_text_field', ) ); Astra_Customizer_Control_Base::add_control( 'ast-description', array( 'callback' => 'Astra_Control_Description', 'sanitize_callback' => '', ) ); Astra_Customizer_Control_Base::add_control( 'ast-customizer-link', array( 'callback' => 'Astra_Control_Customizer_Link', 'santize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_customizer_links' ), ) ); /** * Helper files */ // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require ASTRA_THEME_DIR . 'inc/customizer/class-astra-customizer-partials.php'; require ASTRA_THEME_DIR . 'inc/customizer/class-astra-customizer-callback.php'; require ASTRA_THEME_DIR . 'inc/customizer/class-astra-customizer-sanitizes.php'; // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } /** * Add postMessage support for site title and description for the Theme Customizer. * * @since 1.0.0 * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ public function customize_register( $wp_customize ) { /** * Override Defaults */ require ASTRA_THEME_DIR . 'inc/customizer/override-defaults.php';// phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } /** * Add upgrade link configurations controls. * * @since 1.0.0 * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ public function astra_pro_upgrade_configurations( $wp_customize ) { if ( ! defined( 'ASTRA_EXT_VER' ) ) { require ASTRA_THEME_DIR . 'inc/customizer/astra-pro/class-astra-pro-customizer.php';// phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require ASTRA_THEME_DIR . 'inc/customizer/astra-pro/class-astra-pro-upgrade-link-configs.php';// phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Customizer Controls * * @since 1.0.0 * @return void */ public function controls_scripts() { $js_prefix = '.min.js'; $css_prefix = '.min.css'; $dir = 'minified'; if ( SCRIPT_DEBUG ) { $js_prefix = '.js'; $dir = 'unminified'; } if ( is_rtl() ) { $css_prefix = '.min-rtl.css'; } wp_enqueue_style( 'wp-components' ); wp_enqueue_script( 'thickbox' ); wp_enqueue_style( 'thickbox' ); // Customizer Core. wp_enqueue_script( 'astra-customizer-controls-toggle-js', ASTRA_THEME_URI . 'assets/js/' . $dir . '/customizer-controls-toggle' . $js_prefix, array(), ASTRA_THEME_VERSION, true ); // Extended Customizer Assets - Panel extended. wp_enqueue_style( 'astra-extend-customizer-css', ASTRA_THEME_URI . 'assets/css/minified/extend-customizer' . $css_prefix, null, ASTRA_THEME_VERSION ); wp_enqueue_script( 'astra-extend-customizer-js', ASTRA_THEME_URI . 'assets/js/' . $dir . '/extend-customizer' . $js_prefix, array(), ASTRA_THEME_VERSION, true ); // Customizer Controls. wp_enqueue_style( 'astra-customizer-controls-css', ASTRA_THEME_URI . 'assets/css/minified/customizer-controls' . $css_prefix, null, ASTRA_THEME_VERSION ); $string = $this->generate_font_dropdown(); $template = '
    '; $sortable_subcontrol_template = '
    '; wp_localize_script( 'astra-customizer-controls-toggle-js', 'astra', apply_filters( 'astra_theme_customizer_js_localize', array( 'customizer' => array( 'settings' => array( 'sidebars' => array( 'single' => array( 'single-post-sidebar-layout', 'single-page-sidebar-layout', ), 'archive' => array( 'archive-post-sidebar-layout', ), ), 'container' => array( 'single' => array( 'single-post-content-layout', 'single-page-content-layout', ), 'archive' => array( 'archive-post-content-layout', ), ), 'google_fonts' => $string, ), 'group_modal_tmpl' => $template, 'sortable_modal_tmpl' => $sortable_subcontrol_template, 'is_pro' => defined( 'ASTRA_EXT_VER' ), 'show_upgrade_notice' => ( astra_showcase_upgrade_notices() ) ? true : false, 'upgrade_link' => htmlspecialchars_decode( astra_get_pro_url( 'https://wpastra.com/pricing/?utm_source=wp&utm_medium=dashboard/', 'customizer', 'upgrade-link', 'upgrade-to-pro' ) ), 'is_block_widget' => astra_has_widgets_block_editor(), ), 'theme' => array( 'option' => ASTRA_THEME_SETTINGS, ), ) ) ); } /** * Generates HTML for font dropdown. * * @return string */ public function generate_font_dropdown() { ob_start(); ?> $variants ) { ?> $single_font ) { $variants = astra_get_prop( $single_font, '0' ); $category = astra_get_prop( $single_font, '1' ); ?> astra_header_break_point(), 'includeAnchorsInHeadindsCss' => Astra_Dynamic_CSS::anchors_in_css_selectors_heading(), 'googleFonts' => Astra_Font_Families::get_google_fonts(), 'page_builder_button_style_css' => Astra_Dynamic_CSS::page_builder_button_style_css(), 'elementor_default_color_font_setting' => Astra_Dynamic_CSS::elementor_default_color_font_setting(), 'dynamic_partial_options' => self::$dynamic_options['partials'], 'gb_outline_buttons_patterns_support' => Astra_Dynamic_CSS::gutenberg_core_patterns_compat(), 'font_weights_widget_title_support' => Astra_Dynamic_CSS::support_font_css_to_widget_and_in_editor(), 'is_content_bg_option_to_load' => astra_has_gcp_typo_preset_compatibility(), 'content_layout' => astra_get_content_layout(), 'site_layout' => astra_get_option( 'site-layout' ), 'has_block_editor_support' => Astra_Dynamic_CSS::is_block_editor_support_enabled(), 'updated_gb_outline_button_patterns' => astra_button_default_padding_updated(), 'apply_content_bg_fullwidth_layouts' => astra_get_option( 'apply-content-background-fullwidth-layouts', true ), 'astra_woo_btn_global_compatibility' => is_callable( 'Astra_Dynamic_CSS::astra_woo_support_global_settings' ) ? Astra_Dynamic_CSS::astra_woo_support_global_settings() : false, ); wp_localize_script( 'astra-customizer-preview-js', 'astraCustomizer', $localize_array ); } /** * Called by the customize_save_after action to refresh * the cached CSS when Customizer settings are saved. * * @since 1.0.0 * @return void */ public function customize_save() { // Update variables. Astra_Theme_Options::refresh(); if ( apply_filters( 'astra_resize_logo', true ) ) { /* Generate Header Logo */ $custom_logo_id = get_theme_mod( 'custom_logo' ); add_filter( 'intermediate_image_sizes_advanced', 'Astra_Customizer::logo_image_sizes', 10, 2 ); self::generate_logo_by_width( $custom_logo_id ); remove_filter( 'intermediate_image_sizes_advanced', 'Astra_Customizer::logo_image_sizes', 10 ); } else { // Regenerate the logo without custom image sizes. $custom_logo_id = get_theme_mod( 'custom_logo' ); self::generate_logo_by_width( $custom_logo_id ); } do_action( 'astra_customizer_save' ); } /** * Add logo image sizes in filter. * * @since 1.0.0 * @param array $sizes Sizes. * @param array $metadata attachment data. * * @return array */ public static function logo_image_sizes( $sizes, $metadata ) { $logo_width = astra_get_option( 'ast-header-responsive-logo-width' ); if ( is_array( $sizes ) && '' != $logo_width['desktop'] ) { $max_value = max( $logo_width ); $sizes['ast-logo-size'] = array( 'width' => (int) $max_value, 'height' => 0, 'crop' => false, ); } return $sizes; } /** * Generate logo image by its width. * * @since 1.0.0 * @param int $custom_logo_id Logo id. */ public static function generate_logo_by_width( $custom_logo_id ) { if ( $custom_logo_id ) { $image = get_post( $custom_logo_id ); if ( $image ) { $fullsizepath = get_attached_file( $image->ID ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( false !== $fullsizepath || file_exists( $fullsizepath ) ) { if ( ! function_exists( 'wp_generate_attachment_metadata' ) ) { require_once ABSPATH . 'wp-admin/includes/image.php';// phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } $metadata = wp_generate_attachment_metadata( $image->ID, $fullsizepath ); if ( ! is_wp_error( $metadata ) && ! empty( $metadata ) ) { wp_update_attachment_metadata( $image->ID, $metadata ); } } } } } /** * Customizer Preview icon CSS * * @since 1.0.0 * @return void */ public function preview_styles() { if ( is_customize_preview() ) { echo ''; echo ''; } } } } /** * Kicking this off by calling 'get_instance()' method */ Astra_Customizer::get_instance(); PK!L=jxxinc/customizer/index.phpnu[
  • title, ENT_QUOTES, get_bloginfo( 'charset' ) ); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; return $array; } } } PK!WyɓEinc/customizer/extend-customizer/class-astra-wp-customize-section.phpnu[title, ENT_QUOTES, get_bloginfo( 'charset' ) ); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; if ( $this->panel ) { $array['customizeAction'] = sprintf( 'Customizing ▸ %s', esc_html( $this->manager->get_panel( $this->panel )->title ) ); } else { $array['customizeAction'] = 'Customizing'; } return $array; } } } PK!)%[J[J3inc/customizer/class-astra-customizer-sanitizes.phpnu[manager->get_control( $setting->id )->input_attrs ) ) { $input_attrs = $setting->manager->get_control( $setting->id )->input_attrs; } if ( isset( $input_attrs ) ) { $input_attrs['min'] = isset( $input_attrs['min'] ) ? $input_attrs['min'] : 0; $input_attrs['step'] = isset( $input_attrs['step'] ) ? $input_attrs['step'] : 1; if ( isset( $input_attrs['max'] ) && $val > $input_attrs['max'] ) { $val = $input_attrs['max']; } elseif ( $val < $input_attrs['min'] ) { $val = $input_attrs['min']; } /** @psalm-suppress InvalidCast */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dv = (float) $val / $input_attrs['step']; /** @psalm-suppress InvalidCast */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dv = round( $dv ); $val = $dv * $input_attrs['step']; $val = number_format( (float) $val, 2, '.', '' ); if ( $val == (int) $val ) { $val = (int) $val; } } return is_numeric( $val ) ? $val : 0; } /** * Sanitize Integer * * @param number $val Customizer setting input number. * @return number Return number. */ public static function sanitize_number_n_blank( $val ) { return is_numeric( $val ) ? $val : ''; } /** * Sanitize Spacing * * @param number $val Customizer setting input number. * @return number Return number. * @since 1.0.6 */ public static function sanitize_spacing( $val ) { foreach ( $val as $key => $value ) { $val[ $key ] = ( is_numeric( $val[ $key ] ) && $val[ $key ] >= 0 ) ? $val[ $key ] : ''; } return $val; } /** * Sanitize link * * @param array $val Customizer setting link. * @return array Return array. * @since 2.3.0 */ public static function sanitize_link( $val ) { $link = array(); $link['url'] = esc_url_raw( $val['url'] ); $link['new_tab'] = esc_attr( $val['new_tab'] ); $link['link_rel'] = esc_attr( $val['link_rel'] ); return $link; } /** * Sanitize responsive Spacing * * @param number $val Customizer setting input number. * @return number Return number. * @since 1.2.1 */ public static function sanitize_responsive_spacing( $val ) { $spacing = array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); if ( isset( $val['desktop'] ) ) { $spacing['desktop'] = array_map( 'self::check_numberic_values', $val['desktop'] ); $spacing['tablet'] = array_map( 'self::check_numberic_values', $val['tablet'] ); $spacing['mobile'] = array_map( 'self::check_numberic_values', $val['mobile'] ); if ( isset( $val['desktop-unit'] ) ) { $spacing['desktop-unit'] = $val['desktop-unit']; } if ( isset( $val['tablet-unit'] ) ) { $spacing['tablet-unit'] = $val['tablet-unit']; } if ( isset( $val['mobile-unit'] ) ) { $spacing['mobile-unit'] = $val['mobile-unit']; } return $spacing; } else { foreach ( $val as $key => $value ) { $val[ $key ] = is_numeric( $val[ $key ] ) ? $val[ $key ] : ''; } return $val; } } /** * Check numeric values. * * @param int|string $value Value of variable. * @return string|int Return empty if $value is not integer. * * @since 2.5.4 */ public static function check_numberic_values( $value ) { return ( is_numeric( $value ) ) ? $value : ''; } /** * Sanitize Responsive Slider * * @param array|number $val Customizer setting input number. * @param object $setting Setting Onject. * @return array Return number. */ public static function sanitize_responsive_slider( $val, $setting ) { $input_attrs = array(); if ( isset( $setting->manager->get_control( $setting->id )->input_attrs ) ) { $input_attrs = $setting->manager->get_control( $setting->id )->input_attrs; } $responsive = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); if ( is_array( $val ) ) { $responsive['desktop'] = is_numeric( $val['desktop'] ) ? $val['desktop'] : ''; $responsive['tablet'] = is_numeric( $val['tablet'] ) ? $val['tablet'] : ''; $responsive['mobile'] = is_numeric( $val['mobile'] ) ? $val['mobile'] : ''; } else { $responsive['desktop'] = is_numeric( $val ) ? $val : ''; } foreach ( $responsive as $key => $value ) { $value = isset( $input_attrs['min'] ) && ( ! empty( $value ) ) && ( $input_attrs['min'] > $value ) ? $input_attrs['min'] : $value; $value = isset( $input_attrs['max'] ) && ( ! empty( $value ) ) && ( $input_attrs['max'] < $value ) ? $input_attrs['max'] : $value; $responsive[ $key ] = $value; } return $responsive; } /** * Sanitize Responsive Typography * * @param array|number $val Customizer setting input number. * @return array Return number. */ public static function sanitize_responsive_typo( $val ) { $responsive = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => '', 'tablet-unit' => '', 'mobile-unit' => '', ); if ( is_array( $val ) ) { $responsive['desktop'] = ( isset( $val['desktop'] ) && is_numeric( $val['desktop'] ) ) ? $val['desktop'] : ''; $responsive['tablet'] = ( isset( $val['tablet'] ) && is_numeric( $val['tablet'] ) ) ? $val['tablet'] : ''; $responsive['mobile'] = ( isset( $val['mobile'] ) && is_numeric( $val['mobile'] ) ) ? $val['mobile'] : ''; $responsive['desktop-unit'] = ( isset( $val['desktop-unit'] ) && in_array( $val['desktop-unit'], array( '', 'px', 'em', 'rem', '%' ) ) ) ? $val['desktop-unit'] : 'px'; $responsive['tablet-unit'] = ( isset( $val['tablet-unit'] ) && in_array( $val['tablet-unit'], array( '', 'px', 'em', 'rem', '%' ) ) ) ? $val['tablet-unit'] : 'px'; $responsive['mobile-unit'] = ( isset( $val['mobile-unit'] ) && in_array( $val['mobile-unit'], array( '', 'px', 'em', 'rem', '%' ) ) ) ? $val['mobile-unit'] : 'px'; } else { $responsive['desktop'] = is_numeric( $val ) ? $val : ''; } return $responsive; } /** * Validate Email * * @param object $validity setting input validity. * @param string $value setting input value. * @return object Return the validity object. */ public static function validate_email( $validity, $value ) { if ( ! is_email( $value ) ) { $validity->add( 'required', __( 'Enter valid email address!', 'astra' ) ); } return $validity; } /** * Validate Sidebar Content Width * * @param number $value Sidebar content width. * @return number Sidebar content width value. */ public static function validate_sidebar_content_width( $value ) { $value = intval( $value ); if ( $value > 50 ) { $value = 50; } elseif ( $value < 15 ) { $value = 15; } return $value; } /** * Validate Site width * * @param number $value Site width. * @return number Site width value. */ public static function validate_site_width( $value ) { $value = intval( $value ); if ( 1920 < $value ) { $value = 1920; } elseif ( 768 > $value ) { $value = 768; } return $value; } /** * Validate Site padding * * @param number $value Site padding. * @return number Site padding value. */ public static function validate_site_padding( $value ) { $value = intval( $value ); if ( 200 < $value ) { $value = 200; } elseif ( 1 > $value ) { $value = 1; } return $value; } /** * Validate Site margin * * @param number $value Site margin. * @return number Site margin value. */ public static function validate_site_margin( $value ) { $value = intval( $value ); if ( 600 < $value ) { $value = 600; } elseif ( 0 > $value ) { $value = 0; } return $value; } /** * Sanitize checkbox * * @param mixed $input setting input. * @return number setting input value. */ public static function sanitize_checkbox( $input ) { if ( $input ) { $output = '1'; } else { $output = false; } return $output; } /** * Sanitize HEX color * * @param string $color setting input. * @return string setting input value. */ public static function sanitize_hex_color( $color ) { if ( '' === $color ) { return ''; } // 3 or 6 hex digits, or the empty string. if ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { return $color; } return ''; } /** * Sanitize Alpha color * * @param string $color setting input. * @return string setting input value. */ public static function sanitize_alpha_color( $color ) { if ( '' === $color ) { return ''; } // CSS variable value sanitize. if ( 0 === strpos( $color, 'var(--' ) ) { return preg_replace( '/[^A-Za-z0-9_)(\-,.]/', '', $color ); } if ( false === strpos( $color, 'rgba' ) ) { /* Hex sanitize */ return self::sanitize_hex_color( $color ); } /* rgba sanitize */ $color = str_replace( ' ', '', $color ); sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')'; } /** * Sanitize html * * @param string $input setting input. * @return mixed setting input value. */ public static function sanitize_html( $input ) { return wp_kses_post( $input ); } /** * Sanitize Select choices * * @param string $input setting input. * @param object $setting setting object. * @return mixed setting input value. */ public static function sanitize_multi_choices( $input, $setting ) { // Get list of choices from the control // associated with the setting. $choices = $setting->manager->get_control( $setting->id )->choices; $input_keys = $input; foreach ( $input_keys as $key => $value ) { if ( ! array_key_exists( $value, $choices ) ) { unset( $input[ $key ] ); } } // If the input is a valid key, return it; // otherwise, return the default. return ( is_array( $input ) ? $input : $setting->default ); } /** * Sanitize Select choices * * @param string $input setting input. * @param object $setting setting object. * @return mixed setting input value. */ public static function sanitize_choices( $input, $setting ) { // Ensure input is a slug. $input = sanitize_key( $input ); // Get list of choices from the control // associated with the setting. $choices = $setting->manager->get_control( $setting->id )->choices; // If the input is a valid key, return it; // otherwise, return the default. return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } /** * Sanitize Font weight * * @param mixed $input setting input. * @return mixed setting input value. */ public static function sanitize_font_weight( $input ) { $valid = array( 'normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900', ); if ( in_array( $input, $valid ) ) { return $input; } else { return 'normal'; } } /** * Sanitize Font variant * * @param mixed $input setting input. * @return mixed setting input value. */ public static function sanitize_font_variant( $input ) { if ( is_array( $input ) ) { $input = implode( ',', $input ); } return sanitize_text_field( $input ); } /** * Sanitize Background Obj * * @param mixed $bg_obj setting input. * @return array setting input value. */ public static function sanitize_background_obj( $bg_obj ) { $out_bg_obj = array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-gradient' => '', 'background-media' => '', 'background-type' => '', ); if ( is_array( $bg_obj ) ) { foreach ( $out_bg_obj as $key => $value ) { if ( isset( $bg_obj[ $key ] ) ) { if ( 'background-image' === $key ) { $out_bg_obj[ $key ] = esc_url_raw( $bg_obj[ $key ] ); } else { $out_bg_obj[ $key ] = esc_attr( $bg_obj[ $key ] ); } } } } return $out_bg_obj; } /** * Sanitize Border Typography * * @since 1.4.0 * @param array|number $val Customizer setting input number. * @return array Return number. */ public static function sanitize_border( $val ) { $border = array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ); if ( is_array( $val ) ) { $border['top'] = is_numeric( $val['top'] ) ? $val['top'] : ''; $border['right'] = is_numeric( $val['right'] ) ? $val['right'] : ''; $border['bottom'] = is_numeric( $val['bottom'] ) ? $val['bottom'] : ''; $border['left'] = is_numeric( $val['left'] ) ? $val['left'] : ''; } return $border; } /** * Sanitize Customizer Link param. * * @param Array $val array( * linked : Linked Customizer Section, * link_text : Link Text. * ). * * @since 1.6.0 * * @return Array */ public static function sanitize_customizer_links( $val ) { $val['linked'] = sanitize_text_field( $val['linked'] ); $val['link_text'] = esc_html( $val['link_text'] ); $val['link_type'] = esc_html( $val['link_type'] ); $val['is_button_link'] = esc_html( isset( $val['is_button_link'] ) ? $val['is_button_link'] : '#' ); return $val; } /** * Sanitize Responsive Background Image * * @param array $bg_obj Background object. * @return array Background object. */ public static function sanitize_responsive_background( $bg_obj ) { // Default Responsive Background Image. $defaults = array( 'desktop' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-gradient' => '', 'background-media' => '', 'background-type' => '', ), 'tablet' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-gradient' => '', 'background-media' => '', 'background-type' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-gradient' => '', 'background-media' => '', 'background-type' => '', ), ); // Merge responsive background object and default object into $out_bg_obj array. $out_bg_obj = wp_parse_args( $bg_obj, $defaults ); foreach ( $out_bg_obj as $device => $bg ) { foreach ( $bg as $key => $value ) { if ( 'background-image' === $key ) { $out_bg_obj[ $device ] [ $key ] = esc_url_raw( $value ); } if ( 'background-media' === $key ) { $out_bg_obj[ $device ] [ $key ] = floatval( $value ); } else { $out_bg_obj[ $device ] [ $key ] = esc_attr( $value ); } } } return $out_bg_obj; } /** * Sanitize Toggle Control param. * * @param bool $val for True|False. * * @since 3.1.0 * * @return bool True|False */ public static function sanitize_toggle_control( $val ) { // returns true if checkbox is checked. return ( isset( $val ) && is_bool( $val ) ? $val : '' ); } } } /** * Kicking this off by calling 'get_instance()' method */ Astra_Customizer_Sanitizes::get_instance(); PK!5pγ334inc/customizer/extend-custom-controls/build/index.jsnu[!function(){var e={862:function(e,t,c){var s,l,a,r,o;window,e.exports=(s=c(5697),l=c(9196),a=c(4184),r=c(1850),o=c(9698),function(e){var t={};function c(s){if(t[s])return t[s].exports;var l=t[s]={i:s,l:!1,exports:{}};return e[s].call(l.exports,l,l.exports,c),l.l=!0,l.exports}return c.m=e,c.c=t,c.d=function(e,t,s){c.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:s})},c.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="",c(c.s=15)}([function(e,t){e.exports=s},function(e,t){e.exports=l},function(e,t,c){"use strict";function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t,c){return t in e?Object.defineProperty(e,t,{value:c,enumerable:!0,configurable:!0,writable:!0}):e[t]=c,e}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,c=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null;if(Array.isArray(e))return a(e);if(null!==t)return void 0!==e[t]?a(e[t]):[];var c=[],s=function(e){for(var t=1;tc)return!1;if(s===c)return e===t;e:for(var l=0,a=0;ll-20){var z=g.left+c.props.btnRef.current.offsetWidth-(e+d.left);z+d.left<0&&(z=10-d.left),m.style.left="".concat(z,"px")}t+h-a>r&&g.top-t>0&&("self"===c.state.appendRoot?m.style.top="-".concat(t-w,"px"):m.style.top="".concat(g.top+w-t,"px"))}}),c.state={},c.debouncedSyncPortalPosition=(0,o.debounce)(c.syncPortalPosition,250),c}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,s.default.PureComponent),v(t,null,[{key:"getDerivedStateFromProps",value:function(e){var c=t.calculateAppendAndClass(e.appendRoot);return{appendRoot:c.appendRoot,portalClasses:c.portalClasses}}},{key:"calculateAppendAndClass",value:function(e){var t="self",c=(0,r.default)({"rfipdropdown--portal":!1!==e});return!1!==e&&(t=document.querySelector(e)),{portalClasses:c,appendRoot:t}}}]),v(t,[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.debouncedSyncPortalPosition),window.addEventListener("scroll",this.debouncedSyncPortalPosition),this.syncPortalPosition()}},{key:"componentDidUpdate",value:function(){this.syncPortalPosition()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.debouncedSyncPortalPosition),window.removeEventListener("scroll",this.debouncedSyncPortalPosition)}},{key:"positionPortal",value:function(){var e=this.props.domRef.current.style.display;this.props.domRef.current.style.display="none";var t=this.props.btnRef.current,c=(0,o.getOffset)(t),s=(0,o.getOffset)(this.state.appendRoot),l=t.offsetHeight;this.props.domRef.current.style.left="".concat(c.left-s.left,"px"),this.props.domRef.current.style.top="".concat(c.top+l,"px"),this.props.domRef.current.style.display=e}},{key:"resetPortalPosition",value:function(){var e=this.props.domRef.current;"self"===this.state.appendRoot?e.style.top="":this.positionPortal()}},{key:"render",value:function(){var e=(0,r.default)(this.props.className,this.state.portalClasses),t=s.default.createElement("div",{className:e,ref:this.props.domRef},this.props.children);return"self"===this.state.appendRoot?t:(0,l.createPortal)(t,this.state.appendRoot)}}]),t}();Object.defineProperty(p,"propTypes",{configurable:!0,enumerable:!0,writable:!0,value:{appendRoot:a.default.oneOfType([a.default.bool,a.default.string]),children:a.default.node.isRequired,domRef:a.default.object.isRequired,btnRef:a.default.object.isRequired,className:a.default.string.isRequired}}),Object.defineProperty(p,"defaultProps",{configurable:!0,enumerable:!0,writable:!0,value:{appendRoot:!1}});var m=p;t.default=m},function(e,t,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=o(c(1)),l=o(c(0)),a=o(c(3)),r=c(2);function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return function(e){if(Array.isArray(e)){for(var t=0,c=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null,l=c.props.currentPage,a=c.state.totalPage;null!==s?"next"===s?l+=1:l-=1:l=parseInt(e.target.value,10)-1,l<0&&(l=0),l>a-1&&(l=a-1),t=l+1,null===s&&Number.isNaN(l)&&(l=0,t=""),c.setState({viewPage:t}),c.props.handleChangePage(l)}}),Object.defineProperty(d(c),"handlePageKeyBoard",{configurable:!0,enumerable:!0,writable:!0,value:function(e,t){13!==e.keyCode&&32!==e.keyCode||c.handleChangePage({},t)}}),Object.defineProperty(d(c),"handleChangeValue",{configurable:!0,enumerable:!0,writable:!0,value:function(e){c.props.handleChangeValue(e)}}),Object.defineProperty(d(c),"handleValueKeyboard",{configurable:!0,enumerable:!0,writable:!0,value:function(e,t){13!==e.keyCode&&32!==e.keyCode||c.handleChangeValue(t)}}),c.state={viewPage:c.props.currentPage+1},c}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,s.default.PureComponent),v(t,null,[{key:"getDerivedStateFromProps",value:function(e,c){var s=t.getCategoryFilteredState(e.currentCategory,e.categories,e.icons),l=t.getCategoryFilteredState(e.currentCategory,e.categories,null===e.search?e.icons:e.search),a=t.getActiveIcons(s,l,e.currentSearch),r=a.activeIcons,o=a.activeTitles,i=e.currentPage,n=e.iconsPerPage,h={iconView:t.getCurrentViewIcons(r,n,i),titleView:t.getCurrentViewIcons(o,n,i),totalPage:Math.ceil(r.length/n)};return""!==c.viewPage&&(h.viewPage=e.currentPage+1),h}},{key:"getActiveIcons",value:function(e,t,c){var s=n(e),l=n(t);if(""===c||null===c)return{activeIcons:s,activeTitles:l};var a=[],o=[];return s.forEach((function(e,s){(0,r.fuzzySearch)(c,t[s])&&(a.push(e),o.push(t[s]))})),{activeIcons:a,activeTitles:o}}},{key:"getCategoryFilteredState",value:function(e,t,c){var s=null,l=(0,r.getSourceType)(c);if(Array.isArray(t)){if("object"!==l)throw new r.InvalidSourceException(l,"object")}else if("array"!==l)throw new r.InvalidSourceException(l,"array");return 0!==e&&Array.isArray(t)&&(s=t[e]||null),(0,r.flattenPossiblyCategorizedSource)(c,s)}},{key:"getCurrentViewIcons",value:function(e,t,c){var s=c*t,l=(c+1)*t;return e.slice(s,l)}}]),v(t,[{key:"renderPager",value:function(){var e=this;if(this.state.totalPage<1)return null;var t=this.props.currentPage>0?s.default.createElement("span",{className:"rfipicons__left",role:"button",tabIndex:0,onKeyDown:function(t){return e.handlePageKeyBoard(t,"prev")},onClick:function(t){return e.handleChangePage(t,"prev")}},s.default.createElement("span",{role:"presentation",className:"rfipicons__label","aria-label":"Left"},s.default.createElement("i",{className:"fipicon-angle-left"}))):null,c=this.props.currentPage0?this.state.iconView.map((function(t,c){var l=(0,a.default)("rfipicons__icon",{"rfipicons__icon--selected":e.props.value===t||Array.isArray(e.props.value)&&e.props.value.includes(t)});return s.default.createElement("span",{className:l,key:t,title:e.state.titleView[c]},s.default.createElement("span",{className:"rfipicons__ibox",tabIndex:0,role:"button",onClick:function(){return e.handleChangeValue(t)},onKeyDown:function(c){return e.handleValueKeyboard(c,t)}},e.props.renderIcon(t)))})):s.default.createElement("span",{className:"rfipicons__icon--error"},s.default.createElement("span",{className:"rfipicons__ibox--error"},this.props.noIconPlaceholder))}},{key:"render",value:function(){return s.default.createElement("div",{className:"rfipicons"},this.renderPager(),s.default.createElement("div",{className:"rfipicons__selector"},this.renderIconView()))}}]),t}();Object.defineProperty(p,"propTypes",{configurable:!0,enumerable:!0,writable:!0,value:{categories:l.default.arrayOf(l.default.string),currentCategory:l.default.number,isMulti:l.default.bool.isRequired,icons:l.default.oneOfType([l.default.arrayOf(l.default.string),l.default.arrayOf(l.default.number),l.default.objectOf(l.default.oneOfType([l.default.arrayOf(l.default.number),l.default.arrayOf(l.default.string)]))]).isRequired,search:l.default.oneOfType([l.default.objectOf(l.default.arrayOf(l.default.string)),l.default.arrayOf(l.default.string)]),value:l.default.oneOfType([l.default.number,l.default.string,l.default.arrayOf(l.default.oneOfType([l.default.number,l.default.string]))]).isRequired,currentSearch:l.default.string.isRequired,handleChangeValue:l.default.func.isRequired,currentPage:l.default.number.isRequired,iconsPerPage:l.default.number.isRequired,handleChangePage:l.default.func.isRequired,renderIcon:l.default.func.isRequired,noIconPlaceholder:l.default.string.isRequired}}),Object.defineProperty(p,"defaultProps",{configurable:!0,enumerable:!0,writable:!0,value:{categories:null,currentCategory:null,search:null}});var m=p;t.default=m},function(e,t,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=a(c(1)),l=a(c(0));function a(e){return e&&e.__esModule?e:{default:e}}var r=function(e){return s.default.createElement("div",{className:"rfipsearch"},s.default.createElement("input",{type:"text",className:"rfipsearch__input",value:e.value,onChange:e.handleSearch,placeholder:e.placeholder}))};r.propTypes={handleSearch:l.default.func.isRequired,value:l.default.string.isRequired,placeholder:l.default.string.isRequired};var o=r;t.default=o},function(e,t,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=a(c(1)),l=a(c(0));function a(e){return e&&e.__esModule?e:{default:e}}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=function(e){function t()