From 69c17f9c1942fd0d6a5ea941636e87723b8a6fe2 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 21 Jul 2021 16:19:29 -0500 Subject: dos2unix on all .php files, begin paring down admin page and site branding. --- 404.php | 78 +- archive.php | 86 +- assets/images/astra-starter-sites.jpg | Bin 32805 -> 0 bytes comments.php | 204 +- footer.php | 72 +- functions.php | 348 +- header.php | 112 +- .../breadcrumbs/class-astra-breadcrumb-trail.php | 2802 ++-- .../breadcrumbs/class-astra-breadcrumbs-loader.php | 380 +- .../breadcrumbs/class-astra-breadcrumbs-markup.php | 314 +- inc/addons/breadcrumbs/class-astra-breadcrumbs.php | 210 +- .../class-astra-breadcrumbs-color-configs.php | 412 +- .../customizer/class-astra-breadcrumbs-configs.php | 1006 +- .../class-astra-breadcrumbs-typo-configs.php | 358 +- inc/addons/breadcrumbs/dynamic-css/dynamic.css.php | 1078 +- .../class-astra-heading-colors-loader.php | 322 +- .../heading-colors/class-astra-heading-colors.php | 94 +- .../class-astra-heading-colors-configs.php | 852 +- .../heading-colors/dynamic-css/dynamic.css.php | 108 +- .../class-astra-ext-transparent-header.php | 128 +- .../class-astra-ext-transparent-header-loader.php | 428 +- .../class-astra-ext-transparent-header-markup.php | 772 +- ...stra-transparent-header-panels-and-sections.php | 142 +- .../classes/dynamic-css/dynamic.css.php | 996 +- .../dynamic-css/header-sections-dynamic.css.php | 1122 +- inc/addons/transparent-header/classes/index.php | 18 +- ...ustomizer-colors-transparent-header-configs.php | 504 +- ...astra-customizer-transparent-header-configs.php | 2400 ++-- .../transparent-header/classes/sections/index.php | 18 +- inc/addons/transparent-header/index.php | 18 +- inc/admin-functions.php | 170 +- inc/assets/images/astra-logo.svg | 16 - inc/assets/images/astra.svg | 37 - .../images/gen_polylogo_black_color_x200.png | Bin 0 -> 17647 bytes inc/assets/images/lightning-speed.svg | 4 - inc/assets/images/polyguin.svg | 171 + inc/blog/blog-config.php | 940 +- inc/blog/blog.php | 784 +- inc/blog/index.php | 18 +- inc/blog/single-blog.php | 554 +- inc/class-astra-after-setup-theme.php | 528 +- inc/class-astra-dynamic-css.php | 7328 +++++------ inc/class-astra-loop.php | 534 +- inc/class-astra-mobile-header.php | 458 +- inc/compatibility/class-astra-amp.php | 2418 ++-- .../class-astra-bb-ultimate-addon.php | 856 +- inc/compatibility/class-astra-beaver-builder.php | 226 +- inc/compatibility/class-astra-beaver-themer.php | 820 +- inc/compatibility/class-astra-bne-flyout.php | 136 +- inc/compatibility/class-astra-contact-form-7.php | 148 +- inc/compatibility/class-astra-divi-builder.php | 136 +- inc/compatibility/class-astra-elementor-pro.php | 848 +- inc/compatibility/class-astra-elementor.php | 508 +- inc/compatibility/class-astra-gravity-forms.php | 148 +- inc/compatibility/class-astra-jetpack.php | 166 +- inc/compatibility/class-astra-site-origin.php | 136 +- inc/compatibility/class-astra-ubermeu.php | 174 +- inc/compatibility/class-astra-visual-composer.php | 282 +- inc/compatibility/class-astra-yoast-seo.php | 80 +- inc/compatibility/edd/class-astra-edd.php | 2174 ++-- ...class-astra-customizer-register-edd-section.php | 134 +- .../sections/class-astra-edd-container-configs.php | 128 +- .../sections/class-astra-edd-sidebar-configs.php | 168 +- .../class-astra-edd-archive-layout-configs.php | 428 +- ...ass-astra-edd-single-product-layout-configs.php | 114 +- inc/compatibility/edd/edd-common-functions.php | 648 +- inc/compatibility/index.php | 18 +- .../learndash/class-astra-learndash.php | 1354 +- ...astra-customizer-register-learndash-section.php | 100 +- .../class-astra-learndash-container-configs.php | 126 +- .../class-astra-learndash-sidebar-configs.php | 124 +- .../class-astra-learndash-general-configs.php | 144 +- .../lifterlms/class-astra-lifterlms.php | 1716 +-- .../class-astra-liferlms-section-configs.php | 120 +- .../class-astra-lifter-container-configs.php | 132 +- .../class-astra-lifter-sidebar-configs.php | 160 +- .../layout/class-astra-lifter-general-configs.php | 208 +- .../woocommerce/class-astra-woocommerce.php | 3638 +++--- ...class-astra-customizer-register-woo-section.php | 148 +- .../class-astra-woo-shop-container-configs.php | 128 +- .../class-astra-woo-shop-sidebar-configs.php | 168 +- .../class-astra-woo-shop-cart-layout-configs.php | 114 +- .../layout/class-astra-woo-shop-layout-configs.php | 316 +- .../class-astra-woo-shop-single-layout-configs.php | 160 +- .../woocommerce/woocommerce-common-functions.php | 598 +- inc/core/builder/class-astra-builder-options.php | 4 +- inc/core/class-astra-admin-helper.php | 174 +- inc/core/class-astra-admin-settings.php | 2385 ++-- inc/core/class-astra-attr.php | 230 +- inc/core/class-astra-enqueue-scripts.php | 778 +- inc/core/class-astra-theme-options.php | 1060 +- inc/core/class-astra-walker-page.php | 274 +- inc/core/class-gutenberg-editor-css.php | 2232 ++-- inc/core/class-theme-strings.php | 216 +- inc/core/common-functions.php | 3052 ++--- inc/core/deprecated/deprecated-filters.php | 174 +- inc/core/deprecated/deprecated-functions.php | 290 +- inc/core/deprecated/deprecated-hooks.php | 68 +- inc/core/index.php | 18 +- inc/core/sidebar-manager.php | 164 +- inc/core/theme-hooks.php | 998 +- inc/core/view-general.php | 90 +- .../astra-pro/class-astra-pro-customizer.php | 158 +- .../class-astra-pro-upgrade-link-configs.php | 114 +- inc/customizer/astra-pro/index.php | 18 +- inc/customizer/class-astra-customizer-callback.php | 124 +- inc/customizer/class-astra-customizer-partials.php | 316 +- ...s-astra-customizer-register-sections-panels.php | 778 +- .../class-astra-customizer-sanitizes.php | 1364 +- inc/customizer/class-astra-customizer.php | 3068 ++--- inc/customizer/class-astra-font-families.php | 342 +- inc/customizer/class-astra-fonts-data.php | 88 +- inc/customizer/class-astra-fonts.php | 400 +- .../class-astra-customizer-button-configs.php | 968 +- .../class-astra-existing-button-configs.php | 904 +- .../class-astra-customizer-config-base.php | 200 +- .../class-astra-advanced-footer-colors-configs.php | 358 +- .../class-astra-body-colors-configs.php | 198 +- .../class-astra-footer-colors-configs.php | 204 +- .../layout/class-astra-blog-layout-configs.php | 346 +- .../class-astra-blog-single-layout-configs.php | 312 +- .../layout/class-astra-footer-layout-configs.php | 964 +- .../layout/class-astra-header-layout-configs.php | 1368 +- .../layout/class-astra-sidebar-layout-configs.php | 310 +- .../class-astra-site-container-layout-configs.php | 314 +- .../layout/class-astra-site-identity-configs.php | 990 +- .../layout/class-astra-site-layout-configs.php | 138 +- .../class-astra-archive-typo-configs.php | 394 +- .../typography/class-astra-body-typo-configs.php | 554 +- .../class-astra-content-typo-configs.php | 544 +- .../typography/class-astra-header-typo-configs.php | 460 +- .../typography/class-astra-single-typo-configs.php | 272 +- .../class-astra-customizer-control-base.php | 476 +- .../class-astra-control-customizer-link.php | 138 +- .../class-astra-control-description.php | 114 +- inc/customizer/custom-controls/index.php | 18 +- .../typography/class-astra-control-typography.php | 378 +- .../custom-controls/typography/index.php | 18 +- inc/customizer/customizer-controls.php | 48 +- .../class-astra-wp-customize-panel.php | 130 +- .../class-astra-wp-customize-section.php | 136 +- .../class-astra-wp-customize-separator.php | 98 +- inc/customizer/index.php | 18 +- inc/customizer/override-defaults.php | 140 +- inc/extras.php | 1350 +- inc/google-fonts.php | 12804 +++++++++---------- inc/index.php | 18 +- .../class-astra-wp-async-request.php | 326 +- .../class-astra-wp-background-process.php | 1012 +- inc/lib/notices/class-astra-notices.php | 730 +- inc/markup-extras.php | 3186 ++--- inc/metabox/class-astra-meta-box-operations.php | 230 +- inc/metabox/class-astra-meta-boxes.php | 870 +- inc/metabox/index.php | 18 +- inc/schema/class-astra-breadcrumb-schema.php | 148 +- inc/schema/class-astra-creativework-schema.php | 494 +- inc/schema/class-astra-organization-schema.php | 302 +- inc/schema/class-astra-person-schema.php | 296 +- inc/schema/class-astra-schema.php | 136 +- inc/schema/class-astra-site-navigation-schema.php | 124 +- inc/schema/class-astra-wpfooter-schema.php | 124 +- inc/schema/class-astra-wpheader-schema.php | 126 +- inc/schema/class-astra-wpsidebar-schema.php | 124 +- inc/template-parts.php | 726 +- inc/template-tags.php | 84 +- inc/theme-update/astra-update-functions.php | 6264 ++++----- inc/theme-update/class-astra-pb-compatibility.php | 372 +- .../class-astra-theme-background-updater.php | 800 +- inc/theme-update/class-astra-theme-update.php | 1968 +-- .../class-astra-theme-wp-background-process.php | 136 +- inc/widgets.php | 422 +- index.php | 88 +- page.php | 88 +- search.php | 86 +- sidebar.php | 78 +- single.php | 78 +- template-parts/404/404-layout.php | 56 +- template-parts/404/index.php | 18 +- template-parts/advanced-footer/layout-4.php | 100 +- template-parts/blog/blog-layout.php | 84 +- template-parts/blog/index.php | 18 +- template-parts/content-404.php | 50 +- template-parts/content-blog.php | 56 +- template-parts/content-none.php | 96 +- template-parts/content-page.php | 174 +- template-parts/content-single.php | 70 +- template-parts/content.php | 198 +- template-parts/footer/footer-sml-layout-2.php | 128 +- template-parts/footer/footer-sml-layout.php | 80 +- template-parts/footer/index.php | 18 +- template-parts/header/header-main-layout.php | 60 +- template-parts/header/index.php | 18 +- template-parts/index.php | 18 +- template-parts/single/index.php | 18 +- template-parts/single/single-layout.php | 140 +- 195 files changed, 56166 insertions(+), 56601 deletions(-) delete mode 100644 assets/images/astra-starter-sites.jpg delete mode 100644 inc/assets/images/astra-logo.svg delete mode 100644 inc/assets/images/astra.svg create mode 100644 inc/assets/images/gen_polylogo_black_color_x200.png delete mode 100644 inc/assets/images/lightning-speed.svg create mode 100644 inc/assets/images/polyguin.svg diff --git a/404.php b/404.php index dcd7814..fa93023 100644 --- a/404.php +++ b/404.php @@ -1,39 +1,39 @@ - - - - - - - - -
> - - - - - - - -
- - - - - - - - + + + + + + + + +
> + + + + + + + +
+ + + + + + + + diff --git a/archive.php b/archive.php index 03bdf6f..35316e2 100644 --- a/archive.php +++ b/archive.php @@ -1,43 +1,43 @@ - - - - - - - - -
> - - - - - - - - - - - -
- - - - - - - - + + + + + + + + +
> + + + + + + + + + + + +
+ + + + + + + + diff --git a/assets/images/astra-starter-sites.jpg b/assets/images/astra-starter-sites.jpg deleted file mode 100644 index 22261d0..0000000 Binary files a/assets/images/astra-starter-sites.jpg and /dev/null differ diff --git a/comments.php b/comments.php index b639746..d7db2b4 100644 --- a/comments.php +++ b/comments.php @@ -1,102 +1,102 @@ - - -
- - - - -

- -

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

- - - - - - -
+ + +
+ + + + +

+ +

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

+ + + + + + +
diff --git a/footer.php b/footer.php index 97e2155..f82ad92 100644 --- a/footer.php +++ b/footer.php @@ -1,36 +1,36 @@ - - - - - - - - - + + + + + + + + + diff --git a/functions.php b/functions.php index 39da06e..b306be9 100644 --- a/functions.php +++ b/functions.php @@ -1,174 +1,174 @@ -=' ) ) { - require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-elementor.php'; - require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-elementor-pro.php'; - require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-web-stories.php'; -} - -// Beaver Themer compatibility requires PHP 5.3 for anonymus functions. -if ( version_compare( PHP_VERSION, '5.3', '>=' ) ) { - require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-beaver-themer.php'; -} - -require_once ASTRA_THEME_DIR . 'inc/core/markup/class-astra-markup.php'; - -/** - * Load deprecated functions - */ -require_once ASTRA_THEME_DIR . 'inc/core/deprecated/deprecated-filters.php'; -require_once ASTRA_THEME_DIR . 'inc/core/deprecated/deprecated-hooks.php'; -require_once ASTRA_THEME_DIR . 'inc/core/deprecated/deprecated-functions.php'; +=' ) ) { + require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-elementor.php'; + require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-elementor-pro.php'; + require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-web-stories.php'; +} + +// Beaver Themer compatibility requires PHP 5.3 for anonymus functions. +if ( version_compare( PHP_VERSION, '5.3', '>=' ) ) { + require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-beaver-themer.php'; +} + +require_once ASTRA_THEME_DIR . 'inc/core/markup/class-astra-markup.php'; + +/** + * Load deprecated functions + */ +require_once ASTRA_THEME_DIR . 'inc/core/deprecated/deprecated-filters.php'; +require_once ASTRA_THEME_DIR . 'inc/core/deprecated/deprecated-hooks.php'; +require_once ASTRA_THEME_DIR . 'inc/core/deprecated/deprecated-functions.php'; diff --git a/header.php b/header.php index 24dc377..c86e59c 100644 --- a/header.php +++ b/header.php @@ -1,56 +1,56 @@ - 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', - ) - ); - ?> -> - - -
-
- + 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', + ) + ); + ?> +> + + +
+
+ diff --git a/inc/addons/breadcrumbs/class-astra-breadcrumb-trail.php b/inc/addons/breadcrumbs/class-astra-breadcrumb-trail.php index 38bab04..4e3ef15 100644 --- a/inc/addons/breadcrumbs/class-astra-breadcrumb-trail.php +++ b/inc/addons/breadcrumbs/class-astra-breadcrumb-trail.php @@ -1,1402 +1,1402 @@ - - * @copyright Copyright (c) 2008 - 2017, Justin Tadlock - * @link https://themehybrid.com/plugins/breadcrumb-trail - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - */ - -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} - -/** - * Astra Get Breadcrumb - * - * Gets the basic Breadcrumb wrapper div & content - * - * @since 1.8.1 - * @param boolean $echo Whether to echo or not. - * @return string - */ -function astra_get_breadcrumb( $echo = true ) { - - if ( ! $echo ) { - return '
-
' . - astra_get_selected_breadcrumb( $echo ) . - '
-
'; - } - - ?> -
-
- -
-
- $breadcrumb_enable - ); - } - - if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && $breadcrumb_source && 'yoast-seo-breadcrumbs' == $breadcrumb_source ) { - // Check if breadcrumb is turned on from WPSEO option. - return yoast_breadcrumb( '
', '
', $echo ); - } elseif ( function_exists( 'bcn_display' ) && $breadcrumb_source && 'breadcrumb-navxt' == $breadcrumb_source ) { - - if( true === $echo ) { - ?> - - ' . bcn_display( ! $echo ) . '
'; - } elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && $breadcrumb_source && 'rank-math' == $breadcrumb_source ) { - // Check if breadcrumb is turned on from Rank Math plugin. - if ( ! $echo ) { - ob_start(); - rank_math_the_breadcrumbs(); - return ob_get_clean(); - } - rank_math_the_breadcrumbs(); - } else { - // Load default Astra breadcrumb if none selected. - return astra_get_breadcrumb_trail( $echo ); - } -} - - -/** - * Deprecating astra_breadcrumb_trail function. - * - * @since 1.8.1 - * @deprecated 1.8.1 Use astra_get_breadcrumb() - * @param array $args List of args. - * @see astra_breadcrumb_trail() - * - * @return string new breadcrumb function. - */ -function astra_breadcrumb_trail( $args = array() ) { - _deprecated_function( __FUNCTION__, '1.8.1', 'astra_get_breadcrumb()' ); - astra_get_breadcrumb(); -} - -/** - * Shows a breadcrumb for all types of pages. This is a wrapper function for the Breadcrumb_Trail class, - * which should be used in theme templates. - * - * @since 1.8.1 - * @access public - * @param boolean $echo Whether to echo or not. - * @return string Selected Breadcrumb. - */ -function astra_get_breadcrumb_trail( $echo = true ) { - - $defaults = array( - 'before' => '
', - 'after' => '
', - 'show_browse' => false, - 'echo' => $echo, - ); - - $args = apply_filters( 'astra_breadcrumb_trail_args', $defaults ); - - $breadcrumb = apply_filters( 'astra_breadcrumb_trail_object', null, $args ); - - if ( ! is_object( $breadcrumb ) ) { - $breadcrumb = new Astra_Breadcrumb_Trail( $args ); - } - - return $breadcrumb->trail(); -} - -/** - * Creates a breadcrumbs menu for the site based on the current page that's being viewed by the user. - * - * @since 0.6.0 - * @access public - */ -class Astra_Breadcrumb_Trail { - - /** - * Array of items belonging to the current breadcrumb trail. - * - * @since 0.1.0 - * @access public - * @var array - */ - public $items = array(); - - /** - * Arguments used to build the breadcrumb trail. - * - * @since 0.1.0 - * @access public - * @var array - */ - public $args = array(); - - /** - * Array of text labels. - * - * @since 1.0.0 - * @access public - * @var array - */ - public $labels = array(); - - /** - * Array of post types (key) and taxonomies (value) to use for single post views. - * - * @since 1.0.0 - * @access public - * @var array - */ - public $post_taxonomy = array(); - - /* ====== Magic Methods ====== */ - - /** - * Magic method to use in case someone tries to output the layout object as a string. - * We'll just return the trail HTML. - * - * @since 1.0.0 - * @access public - * @return string - */ - public function __toString() { - return $this->trail(); - } - - /** - * Sets up the breadcrumb trail properties. Calls the `Breadcrumb_Trail::add_items()` method - * to create the array of breadcrumb items. - * - * @since 0.6.0 - * @access public - * @param array $args { - * @type string $container Container HTML element. nav|div - * @type string $before String to output before breadcrumb menu. - * @type string $after String to output after breadcrumb menu. - * @type string $browse_tag The HTML tag to use to wrap the "Browse" header text. - * @type string $list_tag The HTML tag to use for the list wrapper. - * @type string $item_tag The HTML tag to use for the item wrapper. - * @type bool $show_on_front Whether to show when `is_front_page()`. - * @type bool $network Whether to link to the network main site (multisite only). - * @type bool $show_title Whether to show the title (last item) in the trail. - * @type bool $show_browse Whether to show the breadcrumb menu header. - * @type array $labels Text labels. @see Breadcrumb_Trail::set_labels() - * @type array $post_taxonomy Taxonomies to use for post types. @see Breadcrumb_Trail::set_post_taxonomy() - * @type bool $echo Whether to print or return the breadcrumbs. - * } - * @return void - */ - public function __construct( $args = array() ) { - - $defaults = array( - 'container' => 'nav', - 'before' => '', - 'after' => '', - 'browse_tag' => 'h2', - 'list_tag' => 'ul', - 'item_tag' => 'li', - 'show_on_front' => true, - 'network' => false, - 'show_title' => true, - 'show_browse' => true, - 'labels' => array(), - 'post_taxonomy' => array(), - 'echo' => true, - 'schema' => true, - ); - - // Parse the arguments with the deaults. - $this->args = apply_filters( 'astra_breadcrumb_trail_args', wp_parse_args( $args, $defaults ) ); - - // Set the labels and post taxonomy properties. - $this->set_labels(); - $this->set_post_taxonomy(); - - // Let's find some items to add to the trail! - $this->add_items(); - } - - /* ====== Public Methods ====== */ - - /** - * Formats the HTML output for the breadcrumb trail. - * - * @since 0.6.0 - * @access public - * @return string - */ - public function trail() { - - // Set up variables that we'll need. - $breadcrumb = ''; - $item_count = count( $this->items ); - $item_position = 0; - $meta = ''; - - if ( 2 > $item_count ) { - $this->args['schema'] = false; - } - - // Connect the breadcrumb trail if there are items in the trail. - if ( 0 < $item_count ) { - - // Add 'browse' label if it should be shown. - if ( true === $this->args['show_browse'] ) { - - $breadcrumb .= sprintf( - '<%1$s class="trail-browse">%2$s', - tag_escape( $this->args['browse_tag'] ), - $this->labels['browse'] - ); - } - - // Open the unordered list. - $breadcrumb .= sprintf( - '<%1$s class="trail-items" %2$s>', - tag_escape( $this->args['list_tag'] ), - ( $this->args['schema'] ? 'itemscope itemtype="http://schema.org/BreadcrumbList"' : '' ) - ); - - if ( $this->args['schema'] ) { - // Add the number of items and item list order schema. - $breadcrumb .= sprintf( '', absint( $item_count ), astra_attr( - 'breadcrumb-trail-items-num-meta', - array( - 'name' => 'numberOfItems', - 'class' => '', - ) - ) ); - $breadcrumb .= ' '', - 'name' => 'itemListOrder', - 'content' => 'Ascending', - ) - ) . '/>'; - } - - // Loop through the items and add them to the list. - foreach ( $this->items as $item ) { - - // Iterate the item position. - ++$item_position; - - // Check if the item is linked. - preg_match( '/()(.*?)(<\/a>)/i', $item, $matches ); - - // Wrap the item text with appropriate itemprop. - $item = ! empty( $matches ) ? sprintf( '%s%s%s', $matches[1], $this->args['schema'] ? 'itemprop="name"' : '', $matches[2], $matches[3] ) : sprintf( '%s', $item ); - - // Wrap the item with its itemprop. - $item = ( ! empty( $matches ) && $this->args['schema'] ) - ? preg_replace( '/(/i', '$1$2 itemprop=$2item$2>', $item ) - : sprintf( '%s', $item ); - - // Add list item classes. - $item_class = 'trail-item'; - $item_schema_attr = 'itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"'; - - if ( 1 === $item_position && 1 < $item_count ) { - $item_class .= ' trail-begin'; - } elseif ( $item_count === $item_position ) { - $item_class .= ' trail-end'; - $item_schema_attr = ''; - } - - // Create list item attributes. - $attributes = $this->args['schema'] ? $item_schema_attr : ''; - - $attributes .= ' class="' . $item_class . '"'; - - if ( $this->args['schema'] ) { - // Build the meta position HTML. - $meta = sprintf( '', absint( $item_position ) ); - } - - if ( $item_count === $item_position ) { - $meta = ''; - } - - // Build the list item. - $breadcrumb .= sprintf( '<%1$s %2$s>%3$s%4$s', tag_escape( $this->args['item_tag'] ),$attributes, $item, $meta ); - } - - // Close the unordered list. - $breadcrumb .= sprintf( '', tag_escape( $this->args['list_tag'] ) ); - - // Wrap the breadcrumb trail. - $breadcrumb = sprintf( - '<%1$s role="navigation" aria-label="%2$s" class="breadcrumb-trail breadcrumbs" >%3$s%4$s%5$s', - tag_escape( $this->args['container'] ), - esc_attr( $this->labels['aria_label'] ), - $this->args['before'], - $breadcrumb, - $this->args['after'] - ); - } - - // Allow developers to filter the breadcrumb trail HTML. - $breadcrumb = apply_filters( 'astra_breadcrumb_trail', $breadcrumb, $this->args ); - - if ( false === $this->args['echo'] ) { - return $breadcrumb; - } - - echo $breadcrumb; - } - - /* ====== Protected Methods ====== */ - - /** - * Sets the labels property. Parses the inputted labels array with the defaults. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function set_labels() { - - $defaults = array( - 'browse' => esc_html__( 'Browse:', 'astra' ), - 'aria_label' => esc_attr_x( 'Breadcrumbs', 'breadcrumbs aria label', 'astra' ), - 'home' => esc_html__( 'Home', 'astra' ), - 'error_404' => esc_html__( '404 Not Found', 'astra' ), - 'archives' => esc_html__( 'Archives', 'astra' ), - // Translators: %s is the search query. - 'search' => esc_html__( 'Search results for: %s', 'astra' ), - // Translators: %s is the page number. - 'paged' => esc_html__( 'Page %s', 'astra' ), - // Translators: %s is the page number. - 'paged_comments' => esc_html__( 'Comment Page %s', 'astra' ), - // Translators: Minute archive title. %s is the minute time format. - 'archive_minute' => esc_html__( 'Minute %s', 'astra' ), - // Translators: Weekly archive title. %s is the week date format. - 'archive_week' => esc_html__( 'Week %s', 'astra' ), - - // "%s" is replaced with the translated date/time format. - 'archive_minute_hour' => '%s', - 'archive_hour' => '%s', - 'archive_day' => '%s', - 'archive_month' => '%s', - 'archive_year' => '%s', - ); - - $this->labels = apply_filters( 'astra_breadcrumb_trail_labels', wp_parse_args( $this->args['labels'], $defaults ) ); - } - - /** - * Sets the `$post_taxonomy` property. This is an array of post types (key) and taxonomies (value). - * The taxonomy's terms are shown on the singular post view if set. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function set_post_taxonomy() { - - $defaults = array(); - - // If post permalink is set to `%postname%`, use the `category` taxonomy. - if ( '%postname%' === trim( get_option( 'permalink_structure' ), '/' ) ) { - $defaults['post'] = 'category'; - } - - $this->post_taxonomy = apply_filters( 'astra_breadcrumb_trail_post_taxonomy', wp_parse_args( $this->args['post_taxonomy'], $defaults ) ); - } - - /** - * Runs through the various WordPress conditional tags to check the current page being viewed. Once - * a condition is met, a specific method is launched to add items to the `$items` array. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_items() { - - // If viewing the front page. - if ( is_front_page() ) { - $this->add_front_page_items(); - } - - // If not viewing the front page. - else { - - // Add the network and site home links. - $this->add_network_home_link(); - $this->add_site_home_link(); - - // If viewing the home/blog page. - if ( is_home() ) { - $this->add_blog_items(); - } - - // If viewing a single post. - elseif ( is_singular() ) { - $this->add_singular_items(); - } - - // If viewing an archive page. - elseif ( is_archive() ) { - - if ( is_post_type_archive() ) { - $this->add_post_type_archive_items(); - } - elseif ( is_category() || is_tag() || is_tax() ) { - $this->add_term_archive_items(); - } - elseif ( is_author() ) { - $this->add_user_archive_items(); - } - elseif ( get_query_var( 'minute' ) && get_query_var( 'hour' ) ) { - $this->add_minute_hour_archive_items(); - } - elseif ( get_query_var( 'minute' ) ) { - $this->add_minute_archive_items(); - } - elseif ( get_query_var( 'hour' ) ) { - $this->add_hour_archive_items(); - } - elseif ( is_day() ) { - $this->add_day_archive_items(); - } - elseif ( get_query_var( 'w' ) ) { - $this->add_week_archive_items(); - } - elseif ( is_month() ) { - $this->add_month_archive_items(); - } - elseif ( is_year() ) { - $this->add_year_archive_items(); - } - else { - $this->add_default_archive_items(); - } - } - - // If viewing a search results page. - elseif ( is_search() ) { - $this->add_search_items(); - } - - // If viewing the 404 page. - elseif ( is_404() ) { - $this->add_404_items(); - } - } - - // Add paged items if they exist. - $this->add_paged_items(); - - // Allow developers to overwrite the items for the breadcrumb trail. - $this->items = array_unique( apply_filters( 'astra_breadcrumb_trail_items', $this->items, $this->args ) ); - } - - /** - * Gets front items based on $wp_rewrite->front. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_rewrite_front_items() { - global $wp_rewrite; - - if ( $wp_rewrite->front ) { - $this->add_path_parents( $wp_rewrite->front ); - } - } - - /** - * Adds the page/paged number to the items array. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_paged_items() { - - // If viewing a paged singular post. - if ( is_singular() && 1 < get_query_var( 'page' ) && true === $this->args['show_title'] ) { - $this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'page' ) ) ) ); - } - // If viewing a singular post with paged comments. - elseif ( is_singular() && get_option( 'page_comments' ) && 1 < get_query_var( 'cpage' ) ) { - $this->items[] = sprintf( $this->labels['paged_comments'], number_format_i18n( absint( get_query_var( 'cpage' ) ) ) ); - } - // If viewing a paged archive-type page. - elseif ( is_paged() && true === $this->args['show_title'] ) { - $this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'paged' ) ) ) ); - } - } - - /** - * Adds the network (all sites) home page link to the items array. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_network_home_link() { - - if ( is_multisite() && ! is_main_site() && true === $this->args['network'] ) { - $this->items[] = sprintf( '%s', esc_url( network_home_url() ), $this->labels['home'] ); - } - } - - /** - * Adds the current site's home page link to the items array. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_site_home_link() { - - $network = is_multisite() && ! is_main_site() && true === $this->args['network']; - $label = $network ? get_bloginfo( 'name' ) : $this->labels['home']; - $rel = $network ? '' : ' rel="home"'; - - $this->items[] = sprintf( '%s', esc_url( user_trailingslashit( home_url() ) ), $rel, $label ); - } - - /** - * Adds items for the front page to the items array. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_front_page_items() { - - // Only show front items if the 'show_on_front' argument is set to 'true'. - if ( true === $this->args['show_on_front'] || is_paged() || ( is_singular() && 1 < get_query_var( 'page' ) ) ) { - - // Add network home link. - $this->add_network_home_link(); - - // If on a paged view, add the site home link. - if ( is_paged() ) { - $this->add_site_home_link(); - } - // If on the main front page, add the network home title. - elseif ( true === $this->args['show_title'] ) { - $this->items[] = is_multisite() && true === $this->args['network'] ? get_bloginfo( 'name' ) : $this->labels['home']; - } - } - } - - /** - * Adds items for the posts page (i.e., is_home()) to the items array. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_blog_items() { - - // Get the post ID and post. - $post_id = get_queried_object_id(); - $post = get_post( $post_id ); - - // If the post has parents, add them to the trail. - if ( 0 < $post->post_parent ) { - $this->add_post_parents( $post->post_parent ); - } - // Get the page title. - $title = get_the_title( $post_id ); - - // Add the posts page item. - if ( is_paged() ) { - $this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), $title ); - } - elseif ( $title && true === $this->args['show_title'] ) { - $this->items[] = $title; - } - } - - /** - * Adds singular post items to the items array. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_singular_items() { - - // Get the queried post. - $post = get_queried_object(); - $post_id = get_queried_object_id(); - - // If the post has a parent, follow the parent trail. - if ( 0 < $post->post_parent ) { - $this->add_post_parents( $post->post_parent ); - } - // If the post doesn't have a parent, get its hierarchy based off the post type. - else { - $this->add_post_hierarchy( $post_id ); - } - // Display terms for specific post type taxonomy if requested. - if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) ) { - $this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] ); - } - // End with the post title. - if ( $post_title = single_post_title( '', false ) ) { - - if ( ( 1 < get_query_var( 'page' ) || is_paged() ) || ( get_option( 'page_comments' ) && 1 < absint( get_query_var( 'cpage' ) ) ) ) { - $this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), $post_title ); - } - elseif ( true === $this->args['show_title'] ) { - $this->items[] = $post_title; - } - } - } - - /** - * Adds the items to the trail items array for taxonomy term archives. - * - * @since 1.0.0 - * @access protected - * @global object $wp_rewrite - * @return void - */ - protected function add_term_archive_items() { - global $wp_rewrite; - - // Get some taxonomy and term variables. - $term = get_queried_object(); - $taxonomy = get_taxonomy( $term->taxonomy ); - $done_post_type = false; - - // If there are rewrite rules for the taxonomy. - if ( false !== $taxonomy->rewrite ) { - - // If 'with_front' is true, dd $wp_rewrite->front to the trail. - if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front ) { - $this->add_rewrite_front_items(); - } - // Get parent pages by path if they exist. - $this->add_path_parents( $taxonomy->rewrite['slug'] ); - - // Add post type archive if its 'has_archive' matches the taxonomy rewrite 'slug'. - if ( $taxonomy->rewrite['slug'] ) { - - $slug = trim( $taxonomy->rewrite['slug'], '/' ); - - // Deals with the situation if the slug has a '/' between multiple - // strings. For example, "movies/genres" where "movies" is the post - // type archive. - $matches = explode( '/', $slug ); - - // If matches are found for the path. - if ( isset( $matches ) ) { - - // Reverse the array of matches to search for posts in the proper order. - $matches = array_reverse( $matches ); - - // Loop through each of the path matches. - foreach ( $matches as $match ) { - - - // Get public post types that match the rewrite slug. - $post_types = $this->get_post_types_by_slug( $match ); - - if ( ! empty( $post_types ) ) { - - $post_type_object = $post_types[0]; - - // Add support for a non-standard label of 'archive_title' (special use case). - $label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name; - - // Core filter hook. - $label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name ); - - // Add the post type archive link to the trail. - $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), $label ); - - $done_post_type = true; - - // Break out of the loop. - break; - } - } - } - } - } - - // If there's a single post type for the taxonomy, use it. - if ( false === $done_post_type && 1 === count( $taxonomy->object_type ) && post_type_exists( $taxonomy->object_type[0] ) ) { - - // If the post type is 'post'. - if ( 'post' === $taxonomy->object_type[0] ) { - $post_id = get_option( 'page_for_posts' ); - - if ( 'posts' !== get_option( 'show_on_front' ) && 0 < $post_id ) { - $this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) ); - } - // If the post type is not 'post'. - } else { - $post_type_object = get_post_type_object( $taxonomy->object_type[0] ); - - $label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name; - - // Core filter hook. - $label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name ); - - $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), $label ); - } - } - - // If the taxonomy is hierarchical, list its parent terms. - if ( is_taxonomy_hierarchical( $term->taxonomy ) && $term->parent ) { - $this->add_term_parents( $term->parent, $term->taxonomy ); - } - // Add the term name to the trail end. - if ( is_paged() ){ - $this->items[] = sprintf( '%s', esc_url( get_term_link( $term, $term->taxonomy ) ), single_term_title( '', false ) ); - } - elseif ( true === $this->args['show_title'] ) { - $this->items[] = single_term_title( '', false ); - } - } - - /** - * Adds the items to the trail items array for post type archives. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_post_type_archive_items() { - - // Get the post type object. - $post_type_object = get_post_type_object( get_query_var( 'post_type' ) ); - - if ( false !== $post_type_object->rewrite ) { - - // If 'with_front' is true, add $wp_rewrite->front to the trail. - if ( $post_type_object->rewrite['with_front'] ) { - $this->add_rewrite_front_items(); - } - // If there's a rewrite slug, check for parents. - if ( ! empty( $post_type_object->rewrite['slug'] ) ) { - $this->add_path_parents( $post_type_object->rewrite['slug'] ); - } - } - - // Add the post type [plural] name to the trail end. - if ( is_paged() || is_author() ) { - $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), post_type_archive_title( '', false ) ); - } - elseif ( true === $this->args['show_title'] ) { - $this->items[] = post_type_archive_title( '', false ); - } - // If viewing a post type archive by author. - if ( is_author() ) { - $this->add_user_archive_items(); - } - } - - /** - * Adds the items to the trail items array for user (author) archives. - * - * @since 1.0.0 - * @access protected - * @global object $wp_rewrite - * @return void - */ - protected function add_user_archive_items() { - global $wp_rewrite; - - // Add $wp_rewrite->front to the trail. - $this->add_rewrite_front_items(); - - // Get the user ID. - $user_id = get_query_var( 'author' ); - - // If $author_base exists, check for parent pages. - if ( ! empty( $wp_rewrite->author_base ) && ! is_post_type_archive() ) { - $this->add_path_parents( $wp_rewrite->author_base ); - } - // Add the author's display name to the trail end. - if ( is_paged() ) { - $this->items[] = sprintf( '%s', esc_url( get_author_posts_url( $user_id ) ), get_the_author_meta( 'display_name', $user_id ) ); - } - elseif ( true === $this->args['show_title'] ) { - $this->items[] = get_the_author_meta( 'display_name', $user_id ); - } - } - - /** - * Adds the items to the trail items array for minute + hour archives. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_minute_hour_archive_items() { - - // Add $wp_rewrite->front to the trail. - $this->add_rewrite_front_items(); - - // Add the minute + hour item. - if ( true === $this->args['show_title'] ) { - $this->items[] = sprintf( $this->labels['archive_minute_hour'], get_the_time( esc_html_x( 'g:i a', 'minute and hour archives time format', 'astra' ) ) ); - } - } - - /** - * Adds the items to the trail items array for minute archives. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_minute_archive_items() { - - // Add $wp_rewrite->front to the trail. - $this->add_rewrite_front_items(); - - // Add the minute item. - if ( true === $this->args['show_title'] ) { - $this->items[] = sprintf( $this->labels['archive_minute'], get_the_time( esc_html_x( 'i', 'minute archives time format', 'astra' ) ) ); - } - } - - /** - * Adds the items to the trail items array for hour archives. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_hour_archive_items() { - - // Add $wp_rewrite->front to the trail. - $this->add_rewrite_front_items(); - - // Add the hour item. - if ( true === $this->args['show_title'] ) { - $this->items[] = sprintf( $this->labels['archive_hour'], get_the_time( esc_html_x( 'g a', 'hour archives time format', 'astra' ) ) ); - } - } - - /** - * Adds the items to the trail items array for day archives. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_day_archive_items() { - - // Add $wp_rewrite->front to the trail. - $this->add_rewrite_front_items(); - - // Get year, month, and day. - $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) ); - $month = sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'astra' ) ) ); - $day = sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'astra' ) ) ); - - // Add the year and month items. - $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); - $this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month ); - - // Add the day item. - if ( is_paged() ) { - $this->items[] = sprintf( '%s', esc_url( get_day_link( get_the_time( 'Y' ) ), get_the_time( 'm' ), get_the_time( 'd' ) ), $day ); - } - elseif ( true === $this->args['show_title'] ) { - $this->items[] = $day; - } - } - - /** - * Adds the items to the trail items array for week archives. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_week_archive_items() { - - // Add $wp_rewrite->front to the trail. - $this->add_rewrite_front_items(); - - // Get the year and week. - $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) ); - $week = sprintf( $this->labels['archive_week'], get_the_time( esc_html_x( 'W', 'weekly archives date format', 'astra' ) ) ); - - // Add the year item. - $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); - - // Add the week item. - if ( is_paged() ) { - $this->items[] = esc_url( get_archives_link( add_query_arg( array( 'm' => get_the_time( 'Y' ), 'w' => get_the_time( 'W' ) ), home_url() ), $week, false ) ); - } - elseif ( true === $this->args['show_title'] ) { - $this->items[] = $week; - } - } - - /** - * Adds the items to the trail items array for month archives. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_month_archive_items() { - - // Add $wp_rewrite->front to the trail. - $this->add_rewrite_front_items(); - - // Get the year and month. - $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) ); - $month = sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'astra' ) ) ); - - // Add the year item. - $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); - - // Add the month item. - if ( is_paged() ) { - $this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month ); - } - elseif ( true === $this->args['show_title'] ) { - $this->items[] = $month; - } - } - - /** - * Adds the items to the trail items array for year archives. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_year_archive_items() { - - // Add $wp_rewrite->front to the trail. - $this->add_rewrite_front_items(); - - // Get the year. - $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) ); - - // Add the year item. - if ( is_paged() ) { - $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); - } - elseif ( true === $this->args['show_title'] ) { - $this->items[] = $year; - } - } - - /** - * Adds the items to the trail items array for archives that don't have a more specific method - * defined in this class. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_default_archive_items() { - - // If this is a date-/time-based archive, add $wp_rewrite->front to the trail. - if ( is_date() || is_time() ) { - $this->add_rewrite_front_items(); - } - if ( true === $this->args['show_title'] ) { - $this->items[] = $this->labels['archives']; - } - } - - /** - * Adds the items to the trail items array for search results. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_search_items() { - - if ( is_paged() ) { - $this->items[] = sprintf( '%s', esc_url( get_search_link() ), sprintf( $this->labels['search'], get_search_query() ) ); - } - elseif ( true === $this->args['show_title'] ) { - $this->items[] = sprintf( $this->labels['search'], get_search_query() ); - } - } - - /** - * Adds the items to the trail items array for 404 pages. - * - * @since 1.0.0 - * @access protected - * @return void - */ - protected function add_404_items() { - - if ( true === $this->args['show_title'] ) { - $this->items[] = $this->labels['error_404']; - } - } - - /** - * Adds a specific post's parents to the items array. - * - * @since 1.0.0 - * @access protected - * @param int $post_id - * @return void - */ - protected function add_post_parents( $post_id ) { - $parents = array(); - - while ( $post_id ) { - - // Get the post by ID. - $post = get_post( $post_id ); - - // If we hit a page that's set as the front page, bail. - if ( 'page' == $post->post_type && 'page' == get_option( 'show_on_front' ) && $post_id == get_option( 'page_on_front' ) ) { - break; - } - // Add the formatted post link to the array of parents. - $parents[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) ); - - // If there's no longer a post parent, break out of the loop. - if ( 0 >= $post->post_parent ) { - break; - } - // Change the post ID to the parent post to continue looping. - $post_id = $post->post_parent; - } - - // Get the post hierarchy based off the final parent post. - $this->add_post_hierarchy( $post_id ); - - // Display terms for specific post type taxonomy if requested. - if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) ) { - $this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] ); - } - // Merge the parent items into the items array. - $this->items = array_merge( $this->items, array_reverse( $parents ) ); - } - - /** - * Adds a specific post's hierarchy to the items array. The hierarchy is determined by post type's - * rewrite arguments and whether it has an archive page. - * - * @since 1.0.0 - * @access protected - * @param int $post_id - * @return void - */ - protected function add_post_hierarchy( $post_id ) { - - // Get the post type. - $post_type = get_post_type( $post_id ); - $post_type_object = get_post_type_object( $post_type ); - - // If this is the 'post' post type, get the rewrite front items and map the rewrite tags. - if ( 'post' === $post_type ) { - - // Add $wp_rewrite->front to the trail. - $this->add_rewrite_front_items(); - - // Map the rewrite tags. - $this->map_rewrite_tags( $post_id, get_option( 'permalink_structure' ) ); - } - - // If the post type has rewrite rules. - elseif ( false !== $post_type_object->rewrite ) { - - // If 'with_front' is true, add $wp_rewrite->front to the trail. - if ( $post_type_object->rewrite['with_front'] ) { - $this->add_rewrite_front_items(); - } - // If there's a path, check for parents. - if ( ! empty( $post_type_object->rewrite['slug'] ) ) { - $this->add_path_parents( $post_type_object->rewrite['slug'] ); - } - } - - // If there's an archive page, add it to the trail. - if ( $post_type_object->has_archive ) { - - // Add support for a non-standard label of 'archive_title' (special use case). - $label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name; - - // Core filter hook. - $label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name ); - - $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type ) ), $label ); - } - - // Map the rewrite tags if there's a `%` in the slug. - if ( 'post' !== $post_type && ! empty( $post_type_object->rewrite['slug'] ) && false !== strpos( $post_type_object->rewrite['slug'], '%' ) ) { - $this->map_rewrite_tags( $post_id, $post_type_object->rewrite['slug'] ); - } - } - - /** - * Gets post types by slug. This is needed because the get_post_types() function doesn't exactly - * match the 'has_archive' argument when it's set as a string instead of a boolean. - * - * @since 0.6.0 - * @access protected - * @param int $slug The post type archive slug to search for. - * @return void - */ - protected function get_post_types_by_slug( $slug ) { - - $return = array(); - - $post_types = get_post_types( array(), 'objects' ); - - foreach ( $post_types as $type ) { - - if ( $slug === $type->has_archive || ( true === $type->has_archive && $slug === $type->rewrite['slug'] ) ) { - $return[] = $type; - } - } - - return $return; - } - - /** - * Adds a post's terms from a specific taxonomy to the items array. - * - * @since 1.0.0 - * @access protected - * @param int $post_id The ID of the post to get the terms for. - * @param string $taxonomy The taxonomy to get the terms from. - * @return void - */ - protected function add_post_terms( $post_id, $taxonomy ) { - - - // Get the post categories. - $terms = get_the_terms( $post_id, $taxonomy ); - - // Check that categories were returned. - if ( $terms && ! is_wp_error( $terms ) ) { - - // Sort the terms by ID and get the first category. - if ( function_exists( 'wp_list_sort' ) ) { - $terms = wp_list_sort( $terms, 'term_id' ); - } - else { - usort( $terms, '_usort_terms_by_ID' ); - } - $term = get_term( $terms[0], $taxonomy ); - - // If the category has a parent, add the hierarchy to the trail. - if ( 0 < $term->parent ) { - $this->add_term_parents( $term->parent, $taxonomy ); - } - // Add the category archive link to the trail. - $this->items[] = sprintf( '%s', esc_url( get_term_link( $term, $taxonomy ) ), $term->name ); - } - } - - /** - * Get parent posts by path. Currently, this method only supports getting parents of the 'page' - * post type. The goal of this function is to create a clear path back to home given what would - * normally be a "ghost" directory. If any page matches the given path, it'll be added. - * - * @since 1.0.0 - * @access protected - * @param string $path The path (slug) to search for posts by. - * @return void - */ - function add_path_parents( $path ) { - - // Trim '/' off $path in case we just got a simple '/' instead of a real path. - $path = trim( $path, '/' ); - - // If there's no path, return. - if ( empty( $path ) ) { - return; - } - // Get parent post by the path. - $post = get_page_by_path( $path ); - - if ( ! empty( $post ) ) { - $this->add_post_parents( $post->ID ); - } - - elseif ( is_null( $post ) ) { - - // Separate post names into separate paths by '/'. - $path = trim( $path, '/' ); - preg_match_all( "/\/.*?\z/", $path, $matches ); - - // If matches are found for the path. - if ( isset( $matches ) ) { - - // Reverse the array of matches to search for posts in the proper order. - $matches = array_reverse( $matches ); - - // Loop through each of the path matches. - foreach ( $matches as $match ) { - - // If a match is found. - if ( isset( $match[0] ) ) { - - // Get the parent post by the given path. - $path = str_replace( $match[0], '', $path ); - $post = get_page_by_path( trim( $path, '/' ) ); - - // If a parent post is found, set the $post_id and break out of the loop. - if ( ! empty( $post ) && 0 < $post->ID ) { - $this->add_post_parents( $post->ID ); - break; - } - } - } - } - } - } - - /** - * Searches for term parents of hierarchical taxonomies. This function is similar to the WordPress - * function get_category_parents() but handles any type of taxonomy. - * - * @since 1.0.0 - * @param int $term_id ID of the term to get the parents of. - * @param string $taxonomy Name of the taxonomy for the given term. - * @return void - */ - function add_term_parents( $term_id, $taxonomy ) { - - // Set up some default arrays. - $parents = array(); - - // While there is a parent ID, add the parent term link to the $parents array. - while ( $term_id ) { - - // Get the parent term. - $term = get_term( $term_id, $taxonomy ); - - // Add the formatted term link to the array of parent terms. - $parents[] = sprintf( '%s', esc_url( get_term_link( $term, $taxonomy ) ), $term->name ); - - // Set the parent term's parent as the parent ID. - $term_id = $term->parent; - } - - // If we have parent terms, reverse the array to put them in the proper order for the trail. - if ( ! empty( $parents ) ) { - $this->items = array_merge( $this->items, array_reverse( $parents ) ); - } - } - - /** - * Turns %tag% from permalink structures into usable links for the breadcrumb trail. This feels kind of - * hackish for now because we're checking for specific %tag% examples and only doing it for the 'post' - * post type. In the future, maybe it'll handle a wider variety of possibilities, especially for custom post - * types. - * - * @since 0.6.0 - * @access protected - * @param int $post_id ID of the post whose parents we want. - * @param string $path Path of a potential parent page. - * @param array $args Mixed arguments for the menu. - * @return array - */ - protected function map_rewrite_tags( $post_id, $path ) { - - $post = get_post( $post_id ); - - // Trim '/' from both sides of the $path. - $path = trim( $path, '/' ); - - // Split the $path into an array of strings. - $matches = explode( '/', $path ); - - // If matches are found for the path. - if ( is_array( $matches ) ) { - - // Loop through each of the matches, adding each to the $trail array. - foreach ( $matches as $match ) { - - // Trim any '/' from the $match. - $tag = trim( $match, '/' ); - - // If using the %year% tag, add a link to the yearly archive. - if ( '%year%' == $tag ) { - $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y', $post_id ) ) ), sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) ) ); - } - // If using the %monthnum% tag, add a link to the monthly archive. - elseif ( '%monthnum%' == $tag ) { - $this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ) ) ), sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'astra' ) ) ) ); - } - // If using the %day% tag, add a link to the daily archive. - elseif ( '%day%' == $tag ) { - $this->items[] = sprintf( '%s', esc_url( get_day_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ), get_the_time( 'd', $post_id ) ) ), sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'astra' ) ) ) ); - } - // If using the %author% tag, add a link to the post author archive. - elseif ( '%author%' == $tag ) { - $this->items[] = sprintf( '%s', esc_url( get_author_posts_url( $post->post_author ) ), get_the_author_meta( 'display_name', $post->post_author ) ); - } - // If using the %category% tag, add a link to the first category archive to match permalinks. - elseif ( taxonomy_exists( trim( $tag, '%' ) ) ) { - - // Force override terms in this post type. - $this->post_taxonomy[ $post->post_type ] = false; - - // Add the post categories. - $this->add_post_terms( $post_id, trim( $tag, '%' ) ); - } - } - } - } + + * @copyright Copyright (c) 2008 - 2017, Justin Tadlock + * @link https://themehybrid.com/plugins/breadcrumb-trail + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} + +/** + * Astra Get Breadcrumb + * + * Gets the basic Breadcrumb wrapper div & content + * + * @since 1.8.1 + * @param boolean $echo Whether to echo or not. + * @return string + */ +function astra_get_breadcrumb( $echo = true ) { + + if ( ! $echo ) { + return '
+
' . + astra_get_selected_breadcrumb( $echo ) . + '
+
'; + } + + ?> +
+
+ +
+
+ $breadcrumb_enable + ); + } + + if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && $breadcrumb_source && 'yoast-seo-breadcrumbs' == $breadcrumb_source ) { + // Check if breadcrumb is turned on from WPSEO option. + return yoast_breadcrumb( '
', '
', $echo ); + } elseif ( function_exists( 'bcn_display' ) && $breadcrumb_source && 'breadcrumb-navxt' == $breadcrumb_source ) { + + if( true === $echo ) { + ?> + + ' . bcn_display( ! $echo ) . '
'; + } elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && $breadcrumb_source && 'rank-math' == $breadcrumb_source ) { + // Check if breadcrumb is turned on from Rank Math plugin. + if ( ! $echo ) { + ob_start(); + rank_math_the_breadcrumbs(); + return ob_get_clean(); + } + rank_math_the_breadcrumbs(); + } else { + // Load default Astra breadcrumb if none selected. + return astra_get_breadcrumb_trail( $echo ); + } +} + + +/** + * Deprecating astra_breadcrumb_trail function. + * + * @since 1.8.1 + * @deprecated 1.8.1 Use astra_get_breadcrumb() + * @param array $args List of args. + * @see astra_breadcrumb_trail() + * + * @return string new breadcrumb function. + */ +function astra_breadcrumb_trail( $args = array() ) { + _deprecated_function( __FUNCTION__, '1.8.1', 'astra_get_breadcrumb()' ); + astra_get_breadcrumb(); +} + +/** + * Shows a breadcrumb for all types of pages. This is a wrapper function for the Breadcrumb_Trail class, + * which should be used in theme templates. + * + * @since 1.8.1 + * @access public + * @param boolean $echo Whether to echo or not. + * @return string Selected Breadcrumb. + */ +function astra_get_breadcrumb_trail( $echo = true ) { + + $defaults = array( + 'before' => '
', + 'after' => '
', + 'show_browse' => false, + 'echo' => $echo, + ); + + $args = apply_filters( 'astra_breadcrumb_trail_args', $defaults ); + + $breadcrumb = apply_filters( 'astra_breadcrumb_trail_object', null, $args ); + + if ( ! is_object( $breadcrumb ) ) { + $breadcrumb = new Astra_Breadcrumb_Trail( $args ); + } + + return $breadcrumb->trail(); +} + +/** + * Creates a breadcrumbs menu for the site based on the current page that's being viewed by the user. + * + * @since 0.6.0 + * @access public + */ +class Astra_Breadcrumb_Trail { + + /** + * Array of items belonging to the current breadcrumb trail. + * + * @since 0.1.0 + * @access public + * @var array + */ + public $items = array(); + + /** + * Arguments used to build the breadcrumb trail. + * + * @since 0.1.0 + * @access public + * @var array + */ + public $args = array(); + + /** + * Array of text labels. + * + * @since 1.0.0 + * @access public + * @var array + */ + public $labels = array(); + + /** + * Array of post types (key) and taxonomies (value) to use for single post views. + * + * @since 1.0.0 + * @access public + * @var array + */ + public $post_taxonomy = array(); + + /* ====== Magic Methods ====== */ + + /** + * Magic method to use in case someone tries to output the layout object as a string. + * We'll just return the trail HTML. + * + * @since 1.0.0 + * @access public + * @return string + */ + public function __toString() { + return $this->trail(); + } + + /** + * Sets up the breadcrumb trail properties. Calls the `Breadcrumb_Trail::add_items()` method + * to create the array of breadcrumb items. + * + * @since 0.6.0 + * @access public + * @param array $args { + * @type string $container Container HTML element. nav|div + * @type string $before String to output before breadcrumb menu. + * @type string $after String to output after breadcrumb menu. + * @type string $browse_tag The HTML tag to use to wrap the "Browse" header text. + * @type string $list_tag The HTML tag to use for the list wrapper. + * @type string $item_tag The HTML tag to use for the item wrapper. + * @type bool $show_on_front Whether to show when `is_front_page()`. + * @type bool $network Whether to link to the network main site (multisite only). + * @type bool $show_title Whether to show the title (last item) in the trail. + * @type bool $show_browse Whether to show the breadcrumb menu header. + * @type array $labels Text labels. @see Breadcrumb_Trail::set_labels() + * @type array $post_taxonomy Taxonomies to use for post types. @see Breadcrumb_Trail::set_post_taxonomy() + * @type bool $echo Whether to print or return the breadcrumbs. + * } + * @return void + */ + public function __construct( $args = array() ) { + + $defaults = array( + 'container' => 'nav', + 'before' => '', + 'after' => '', + 'browse_tag' => 'h2', + 'list_tag' => 'ul', + 'item_tag' => 'li', + 'show_on_front' => true, + 'network' => false, + 'show_title' => true, + 'show_browse' => true, + 'labels' => array(), + 'post_taxonomy' => array(), + 'echo' => true, + 'schema' => true, + ); + + // Parse the arguments with the deaults. + $this->args = apply_filters( 'astra_breadcrumb_trail_args', wp_parse_args( $args, $defaults ) ); + + // Set the labels and post taxonomy properties. + $this->set_labels(); + $this->set_post_taxonomy(); + + // Let's find some items to add to the trail! + $this->add_items(); + } + + /* ====== Public Methods ====== */ + + /** + * Formats the HTML output for the breadcrumb trail. + * + * @since 0.6.0 + * @access public + * @return string + */ + public function trail() { + + // Set up variables that we'll need. + $breadcrumb = ''; + $item_count = count( $this->items ); + $item_position = 0; + $meta = ''; + + if ( 2 > $item_count ) { + $this->args['schema'] = false; + } + + // Connect the breadcrumb trail if there are items in the trail. + if ( 0 < $item_count ) { + + // Add 'browse' label if it should be shown. + if ( true === $this->args['show_browse'] ) { + + $breadcrumb .= sprintf( + '<%1$s class="trail-browse">%2$s', + tag_escape( $this->args['browse_tag'] ), + $this->labels['browse'] + ); + } + + // Open the unordered list. + $breadcrumb .= sprintf( + '<%1$s class="trail-items" %2$s>', + tag_escape( $this->args['list_tag'] ), + ( $this->args['schema'] ? 'itemscope itemtype="http://schema.org/BreadcrumbList"' : '' ) + ); + + if ( $this->args['schema'] ) { + // Add the number of items and item list order schema. + $breadcrumb .= sprintf( '', absint( $item_count ), astra_attr( + 'breadcrumb-trail-items-num-meta', + array( + 'name' => 'numberOfItems', + 'class' => '', + ) + ) ); + $breadcrumb .= ' '', + 'name' => 'itemListOrder', + 'content' => 'Ascending', + ) + ) . '/>'; + } + + // Loop through the items and add them to the list. + foreach ( $this->items as $item ) { + + // Iterate the item position. + ++$item_position; + + // Check if the item is linked. + preg_match( '/()(.*?)(<\/a>)/i', $item, $matches ); + + // Wrap the item text with appropriate itemprop. + $item = ! empty( $matches ) ? sprintf( '%s%s%s', $matches[1], $this->args['schema'] ? 'itemprop="name"' : '', $matches[2], $matches[3] ) : sprintf( '%s', $item ); + + // Wrap the item with its itemprop. + $item = ( ! empty( $matches ) && $this->args['schema'] ) + ? preg_replace( '/(/i', '$1$2 itemprop=$2item$2>', $item ) + : sprintf( '%s', $item ); + + // Add list item classes. + $item_class = 'trail-item'; + $item_schema_attr = 'itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"'; + + if ( 1 === $item_position && 1 < $item_count ) { + $item_class .= ' trail-begin'; + } elseif ( $item_count === $item_position ) { + $item_class .= ' trail-end'; + $item_schema_attr = ''; + } + + // Create list item attributes. + $attributes = $this->args['schema'] ? $item_schema_attr : ''; + + $attributes .= ' class="' . $item_class . '"'; + + if ( $this->args['schema'] ) { + // Build the meta position HTML. + $meta = sprintf( '', absint( $item_position ) ); + } + + if ( $item_count === $item_position ) { + $meta = ''; + } + + // Build the list item. + $breadcrumb .= sprintf( '<%1$s %2$s>%3$s%4$s', tag_escape( $this->args['item_tag'] ),$attributes, $item, $meta ); + } + + // Close the unordered list. + $breadcrumb .= sprintf( '', tag_escape( $this->args['list_tag'] ) ); + + // Wrap the breadcrumb trail. + $breadcrumb = sprintf( + '<%1$s role="navigation" aria-label="%2$s" class="breadcrumb-trail breadcrumbs" >%3$s%4$s%5$s', + tag_escape( $this->args['container'] ), + esc_attr( $this->labels['aria_label'] ), + $this->args['before'], + $breadcrumb, + $this->args['after'] + ); + } + + // Allow developers to filter the breadcrumb trail HTML. + $breadcrumb = apply_filters( 'astra_breadcrumb_trail', $breadcrumb, $this->args ); + + if ( false === $this->args['echo'] ) { + return $breadcrumb; + } + + echo $breadcrumb; + } + + /* ====== Protected Methods ====== */ + + /** + * Sets the labels property. Parses the inputted labels array with the defaults. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function set_labels() { + + $defaults = array( + 'browse' => esc_html__( 'Browse:', 'astra' ), + 'aria_label' => esc_attr_x( 'Breadcrumbs', 'breadcrumbs aria label', 'astra' ), + 'home' => esc_html__( 'Home', 'astra' ), + 'error_404' => esc_html__( '404 Not Found', 'astra' ), + 'archives' => esc_html__( 'Archives', 'astra' ), + // Translators: %s is the search query. + 'search' => esc_html__( 'Search results for: %s', 'astra' ), + // Translators: %s is the page number. + 'paged' => esc_html__( 'Page %s', 'astra' ), + // Translators: %s is the page number. + 'paged_comments' => esc_html__( 'Comment Page %s', 'astra' ), + // Translators: Minute archive title. %s is the minute time format. + 'archive_minute' => esc_html__( 'Minute %s', 'astra' ), + // Translators: Weekly archive title. %s is the week date format. + 'archive_week' => esc_html__( 'Week %s', 'astra' ), + + // "%s" is replaced with the translated date/time format. + 'archive_minute_hour' => '%s', + 'archive_hour' => '%s', + 'archive_day' => '%s', + 'archive_month' => '%s', + 'archive_year' => '%s', + ); + + $this->labels = apply_filters( 'astra_breadcrumb_trail_labels', wp_parse_args( $this->args['labels'], $defaults ) ); + } + + /** + * Sets the `$post_taxonomy` property. This is an array of post types (key) and taxonomies (value). + * The taxonomy's terms are shown on the singular post view if set. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function set_post_taxonomy() { + + $defaults = array(); + + // If post permalink is set to `%postname%`, use the `category` taxonomy. + if ( '%postname%' === trim( get_option( 'permalink_structure' ), '/' ) ) { + $defaults['post'] = 'category'; + } + + $this->post_taxonomy = apply_filters( 'astra_breadcrumb_trail_post_taxonomy', wp_parse_args( $this->args['post_taxonomy'], $defaults ) ); + } + + /** + * Runs through the various WordPress conditional tags to check the current page being viewed. Once + * a condition is met, a specific method is launched to add items to the `$items` array. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_items() { + + // If viewing the front page. + if ( is_front_page() ) { + $this->add_front_page_items(); + } + + // If not viewing the front page. + else { + + // Add the network and site home links. + $this->add_network_home_link(); + $this->add_site_home_link(); + + // If viewing the home/blog page. + if ( is_home() ) { + $this->add_blog_items(); + } + + // If viewing a single post. + elseif ( is_singular() ) { + $this->add_singular_items(); + } + + // If viewing an archive page. + elseif ( is_archive() ) { + + if ( is_post_type_archive() ) { + $this->add_post_type_archive_items(); + } + elseif ( is_category() || is_tag() || is_tax() ) { + $this->add_term_archive_items(); + } + elseif ( is_author() ) { + $this->add_user_archive_items(); + } + elseif ( get_query_var( 'minute' ) && get_query_var( 'hour' ) ) { + $this->add_minute_hour_archive_items(); + } + elseif ( get_query_var( 'minute' ) ) { + $this->add_minute_archive_items(); + } + elseif ( get_query_var( 'hour' ) ) { + $this->add_hour_archive_items(); + } + elseif ( is_day() ) { + $this->add_day_archive_items(); + } + elseif ( get_query_var( 'w' ) ) { + $this->add_week_archive_items(); + } + elseif ( is_month() ) { + $this->add_month_archive_items(); + } + elseif ( is_year() ) { + $this->add_year_archive_items(); + } + else { + $this->add_default_archive_items(); + } + } + + // If viewing a search results page. + elseif ( is_search() ) { + $this->add_search_items(); + } + + // If viewing the 404 page. + elseif ( is_404() ) { + $this->add_404_items(); + } + } + + // Add paged items if they exist. + $this->add_paged_items(); + + // Allow developers to overwrite the items for the breadcrumb trail. + $this->items = array_unique( apply_filters( 'astra_breadcrumb_trail_items', $this->items, $this->args ) ); + } + + /** + * Gets front items based on $wp_rewrite->front. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_rewrite_front_items() { + global $wp_rewrite; + + if ( $wp_rewrite->front ) { + $this->add_path_parents( $wp_rewrite->front ); + } + } + + /** + * Adds the page/paged number to the items array. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_paged_items() { + + // If viewing a paged singular post. + if ( is_singular() && 1 < get_query_var( 'page' ) && true === $this->args['show_title'] ) { + $this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'page' ) ) ) ); + } + // If viewing a singular post with paged comments. + elseif ( is_singular() && get_option( 'page_comments' ) && 1 < get_query_var( 'cpage' ) ) { + $this->items[] = sprintf( $this->labels['paged_comments'], number_format_i18n( absint( get_query_var( 'cpage' ) ) ) ); + } + // If viewing a paged archive-type page. + elseif ( is_paged() && true === $this->args['show_title'] ) { + $this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'paged' ) ) ) ); + } + } + + /** + * Adds the network (all sites) home page link to the items array. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_network_home_link() { + + if ( is_multisite() && ! is_main_site() && true === $this->args['network'] ) { + $this->items[] = sprintf( '%s', esc_url( network_home_url() ), $this->labels['home'] ); + } + } + + /** + * Adds the current site's home page link to the items array. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_site_home_link() { + + $network = is_multisite() && ! is_main_site() && true === $this->args['network']; + $label = $network ? get_bloginfo( 'name' ) : $this->labels['home']; + $rel = $network ? '' : ' rel="home"'; + + $this->items[] = sprintf( '%s', esc_url( user_trailingslashit( home_url() ) ), $rel, $label ); + } + + /** + * Adds items for the front page to the items array. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_front_page_items() { + + // Only show front items if the 'show_on_front' argument is set to 'true'. + if ( true === $this->args['show_on_front'] || is_paged() || ( is_singular() && 1 < get_query_var( 'page' ) ) ) { + + // Add network home link. + $this->add_network_home_link(); + + // If on a paged view, add the site home link. + if ( is_paged() ) { + $this->add_site_home_link(); + } + // If on the main front page, add the network home title. + elseif ( true === $this->args['show_title'] ) { + $this->items[] = is_multisite() && true === $this->args['network'] ? get_bloginfo( 'name' ) : $this->labels['home']; + } + } + } + + /** + * Adds items for the posts page (i.e., is_home()) to the items array. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_blog_items() { + + // Get the post ID and post. + $post_id = get_queried_object_id(); + $post = get_post( $post_id ); + + // If the post has parents, add them to the trail. + if ( 0 < $post->post_parent ) { + $this->add_post_parents( $post->post_parent ); + } + // Get the page title. + $title = get_the_title( $post_id ); + + // Add the posts page item. + if ( is_paged() ) { + $this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), $title ); + } + elseif ( $title && true === $this->args['show_title'] ) { + $this->items[] = $title; + } + } + + /** + * Adds singular post items to the items array. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_singular_items() { + + // Get the queried post. + $post = get_queried_object(); + $post_id = get_queried_object_id(); + + // If the post has a parent, follow the parent trail. + if ( 0 < $post->post_parent ) { + $this->add_post_parents( $post->post_parent ); + } + // If the post doesn't have a parent, get its hierarchy based off the post type. + else { + $this->add_post_hierarchy( $post_id ); + } + // Display terms for specific post type taxonomy if requested. + if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) ) { + $this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] ); + } + // End with the post title. + if ( $post_title = single_post_title( '', false ) ) { + + if ( ( 1 < get_query_var( 'page' ) || is_paged() ) || ( get_option( 'page_comments' ) && 1 < absint( get_query_var( 'cpage' ) ) ) ) { + $this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), $post_title ); + } + elseif ( true === $this->args['show_title'] ) { + $this->items[] = $post_title; + } + } + } + + /** + * Adds the items to the trail items array for taxonomy term archives. + * + * @since 1.0.0 + * @access protected + * @global object $wp_rewrite + * @return void + */ + protected function add_term_archive_items() { + global $wp_rewrite; + + // Get some taxonomy and term variables. + $term = get_queried_object(); + $taxonomy = get_taxonomy( $term->taxonomy ); + $done_post_type = false; + + // If there are rewrite rules for the taxonomy. + if ( false !== $taxonomy->rewrite ) { + + // If 'with_front' is true, dd $wp_rewrite->front to the trail. + if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front ) { + $this->add_rewrite_front_items(); + } + // Get parent pages by path if they exist. + $this->add_path_parents( $taxonomy->rewrite['slug'] ); + + // Add post type archive if its 'has_archive' matches the taxonomy rewrite 'slug'. + if ( $taxonomy->rewrite['slug'] ) { + + $slug = trim( $taxonomy->rewrite['slug'], '/' ); + + // Deals with the situation if the slug has a '/' between multiple + // strings. For example, "movies/genres" where "movies" is the post + // type archive. + $matches = explode( '/', $slug ); + + // If matches are found for the path. + if ( isset( $matches ) ) { + + // Reverse the array of matches to search for posts in the proper order. + $matches = array_reverse( $matches ); + + // Loop through each of the path matches. + foreach ( $matches as $match ) { + + + // Get public post types that match the rewrite slug. + $post_types = $this->get_post_types_by_slug( $match ); + + if ( ! empty( $post_types ) ) { + + $post_type_object = $post_types[0]; + + // Add support for a non-standard label of 'archive_title' (special use case). + $label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name; + + // Core filter hook. + $label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name ); + + // Add the post type archive link to the trail. + $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), $label ); + + $done_post_type = true; + + // Break out of the loop. + break; + } + } + } + } + } + + // If there's a single post type for the taxonomy, use it. + if ( false === $done_post_type && 1 === count( $taxonomy->object_type ) && post_type_exists( $taxonomy->object_type[0] ) ) { + + // If the post type is 'post'. + if ( 'post' === $taxonomy->object_type[0] ) { + $post_id = get_option( 'page_for_posts' ); + + if ( 'posts' !== get_option( 'show_on_front' ) && 0 < $post_id ) { + $this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) ); + } + // If the post type is not 'post'. + } else { + $post_type_object = get_post_type_object( $taxonomy->object_type[0] ); + + $label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name; + + // Core filter hook. + $label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name ); + + $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), $label ); + } + } + + // If the taxonomy is hierarchical, list its parent terms. + if ( is_taxonomy_hierarchical( $term->taxonomy ) && $term->parent ) { + $this->add_term_parents( $term->parent, $term->taxonomy ); + } + // Add the term name to the trail end. + if ( is_paged() ){ + $this->items[] = sprintf( '%s', esc_url( get_term_link( $term, $term->taxonomy ) ), single_term_title( '', false ) ); + } + elseif ( true === $this->args['show_title'] ) { + $this->items[] = single_term_title( '', false ); + } + } + + /** + * Adds the items to the trail items array for post type archives. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_post_type_archive_items() { + + // Get the post type object. + $post_type_object = get_post_type_object( get_query_var( 'post_type' ) ); + + if ( false !== $post_type_object->rewrite ) { + + // If 'with_front' is true, add $wp_rewrite->front to the trail. + if ( $post_type_object->rewrite['with_front'] ) { + $this->add_rewrite_front_items(); + } + // If there's a rewrite slug, check for parents. + if ( ! empty( $post_type_object->rewrite['slug'] ) ) { + $this->add_path_parents( $post_type_object->rewrite['slug'] ); + } + } + + // Add the post type [plural] name to the trail end. + if ( is_paged() || is_author() ) { + $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), post_type_archive_title( '', false ) ); + } + elseif ( true === $this->args['show_title'] ) { + $this->items[] = post_type_archive_title( '', false ); + } + // If viewing a post type archive by author. + if ( is_author() ) { + $this->add_user_archive_items(); + } + } + + /** + * Adds the items to the trail items array for user (author) archives. + * + * @since 1.0.0 + * @access protected + * @global object $wp_rewrite + * @return void + */ + protected function add_user_archive_items() { + global $wp_rewrite; + + // Add $wp_rewrite->front to the trail. + $this->add_rewrite_front_items(); + + // Get the user ID. + $user_id = get_query_var( 'author' ); + + // If $author_base exists, check for parent pages. + if ( ! empty( $wp_rewrite->author_base ) && ! is_post_type_archive() ) { + $this->add_path_parents( $wp_rewrite->author_base ); + } + // Add the author's display name to the trail end. + if ( is_paged() ) { + $this->items[] = sprintf( '%s', esc_url( get_author_posts_url( $user_id ) ), get_the_author_meta( 'display_name', $user_id ) ); + } + elseif ( true === $this->args['show_title'] ) { + $this->items[] = get_the_author_meta( 'display_name', $user_id ); + } + } + + /** + * Adds the items to the trail items array for minute + hour archives. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_minute_hour_archive_items() { + + // Add $wp_rewrite->front to the trail. + $this->add_rewrite_front_items(); + + // Add the minute + hour item. + if ( true === $this->args['show_title'] ) { + $this->items[] = sprintf( $this->labels['archive_minute_hour'], get_the_time( esc_html_x( 'g:i a', 'minute and hour archives time format', 'astra' ) ) ); + } + } + + /** + * Adds the items to the trail items array for minute archives. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_minute_archive_items() { + + // Add $wp_rewrite->front to the trail. + $this->add_rewrite_front_items(); + + // Add the minute item. + if ( true === $this->args['show_title'] ) { + $this->items[] = sprintf( $this->labels['archive_minute'], get_the_time( esc_html_x( 'i', 'minute archives time format', 'astra' ) ) ); + } + } + + /** + * Adds the items to the trail items array for hour archives. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_hour_archive_items() { + + // Add $wp_rewrite->front to the trail. + $this->add_rewrite_front_items(); + + // Add the hour item. + if ( true === $this->args['show_title'] ) { + $this->items[] = sprintf( $this->labels['archive_hour'], get_the_time( esc_html_x( 'g a', 'hour archives time format', 'astra' ) ) ); + } + } + + /** + * Adds the items to the trail items array for day archives. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_day_archive_items() { + + // Add $wp_rewrite->front to the trail. + $this->add_rewrite_front_items(); + + // Get year, month, and day. + $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) ); + $month = sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'astra' ) ) ); + $day = sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'astra' ) ) ); + + // Add the year and month items. + $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); + $this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month ); + + // Add the day item. + if ( is_paged() ) { + $this->items[] = sprintf( '%s', esc_url( get_day_link( get_the_time( 'Y' ) ), get_the_time( 'm' ), get_the_time( 'd' ) ), $day ); + } + elseif ( true === $this->args['show_title'] ) { + $this->items[] = $day; + } + } + + /** + * Adds the items to the trail items array for week archives. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_week_archive_items() { + + // Add $wp_rewrite->front to the trail. + $this->add_rewrite_front_items(); + + // Get the year and week. + $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) ); + $week = sprintf( $this->labels['archive_week'], get_the_time( esc_html_x( 'W', 'weekly archives date format', 'astra' ) ) ); + + // Add the year item. + $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); + + // Add the week item. + if ( is_paged() ) { + $this->items[] = esc_url( get_archives_link( add_query_arg( array( 'm' => get_the_time( 'Y' ), 'w' => get_the_time( 'W' ) ), home_url() ), $week, false ) ); + } + elseif ( true === $this->args['show_title'] ) { + $this->items[] = $week; + } + } + + /** + * Adds the items to the trail items array for month archives. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_month_archive_items() { + + // Add $wp_rewrite->front to the trail. + $this->add_rewrite_front_items(); + + // Get the year and month. + $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) ); + $month = sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'astra' ) ) ); + + // Add the year item. + $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); + + // Add the month item. + if ( is_paged() ) { + $this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month ); + } + elseif ( true === $this->args['show_title'] ) { + $this->items[] = $month; + } + } + + /** + * Adds the items to the trail items array for year archives. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_year_archive_items() { + + // Add $wp_rewrite->front to the trail. + $this->add_rewrite_front_items(); + + // Get the year. + $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) ); + + // Add the year item. + if ( is_paged() ) { + $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); + } + elseif ( true === $this->args['show_title'] ) { + $this->items[] = $year; + } + } + + /** + * Adds the items to the trail items array for archives that don't have a more specific method + * defined in this class. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_default_archive_items() { + + // If this is a date-/time-based archive, add $wp_rewrite->front to the trail. + if ( is_date() || is_time() ) { + $this->add_rewrite_front_items(); + } + if ( true === $this->args['show_title'] ) { + $this->items[] = $this->labels['archives']; + } + } + + /** + * Adds the items to the trail items array for search results. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_search_items() { + + if ( is_paged() ) { + $this->items[] = sprintf( '%s', esc_url( get_search_link() ), sprintf( $this->labels['search'], get_search_query() ) ); + } + elseif ( true === $this->args['show_title'] ) { + $this->items[] = sprintf( $this->labels['search'], get_search_query() ); + } + } + + /** + * Adds the items to the trail items array for 404 pages. + * + * @since 1.0.0 + * @access protected + * @return void + */ + protected function add_404_items() { + + if ( true === $this->args['show_title'] ) { + $this->items[] = $this->labels['error_404']; + } + } + + /** + * Adds a specific post's parents to the items array. + * + * @since 1.0.0 + * @access protected + * @param int $post_id + * @return void + */ + protected function add_post_parents( $post_id ) { + $parents = array(); + + while ( $post_id ) { + + // Get the post by ID. + $post = get_post( $post_id ); + + // If we hit a page that's set as the front page, bail. + if ( 'page' == $post->post_type && 'page' == get_option( 'show_on_front' ) && $post_id == get_option( 'page_on_front' ) ) { + break; + } + // Add the formatted post link to the array of parents. + $parents[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) ); + + // If there's no longer a post parent, break out of the loop. + if ( 0 >= $post->post_parent ) { + break; + } + // Change the post ID to the parent post to continue looping. + $post_id = $post->post_parent; + } + + // Get the post hierarchy based off the final parent post. + $this->add_post_hierarchy( $post_id ); + + // Display terms for specific post type taxonomy if requested. + if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) ) { + $this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] ); + } + // Merge the parent items into the items array. + $this->items = array_merge( $this->items, array_reverse( $parents ) ); + } + + /** + * Adds a specific post's hierarchy to the items array. The hierarchy is determined by post type's + * rewrite arguments and whether it has an archive page. + * + * @since 1.0.0 + * @access protected + * @param int $post_id + * @return void + */ + protected function add_post_hierarchy( $post_id ) { + + // Get the post type. + $post_type = get_post_type( $post_id ); + $post_type_object = get_post_type_object( $post_type ); + + // If this is the 'post' post type, get the rewrite front items and map the rewrite tags. + if ( 'post' === $post_type ) { + + // Add $wp_rewrite->front to the trail. + $this->add_rewrite_front_items(); + + // Map the rewrite tags. + $this->map_rewrite_tags( $post_id, get_option( 'permalink_structure' ) ); + } + + // If the post type has rewrite rules. + elseif ( false !== $post_type_object->rewrite ) { + + // If 'with_front' is true, add $wp_rewrite->front to the trail. + if ( $post_type_object->rewrite['with_front'] ) { + $this->add_rewrite_front_items(); + } + // If there's a path, check for parents. + if ( ! empty( $post_type_object->rewrite['slug'] ) ) { + $this->add_path_parents( $post_type_object->rewrite['slug'] ); + } + } + + // If there's an archive page, add it to the trail. + if ( $post_type_object->has_archive ) { + + // Add support for a non-standard label of 'archive_title' (special use case). + $label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name; + + // Core filter hook. + $label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name ); + + $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type ) ), $label ); + } + + // Map the rewrite tags if there's a `%` in the slug. + if ( 'post' !== $post_type && ! empty( $post_type_object->rewrite['slug'] ) && false !== strpos( $post_type_object->rewrite['slug'], '%' ) ) { + $this->map_rewrite_tags( $post_id, $post_type_object->rewrite['slug'] ); + } + } + + /** + * Gets post types by slug. This is needed because the get_post_types() function doesn't exactly + * match the 'has_archive' argument when it's set as a string instead of a boolean. + * + * @since 0.6.0 + * @access protected + * @param int $slug The post type archive slug to search for. + * @return void + */ + protected function get_post_types_by_slug( $slug ) { + + $return = array(); + + $post_types = get_post_types( array(), 'objects' ); + + foreach ( $post_types as $type ) { + + if ( $slug === $type->has_archive || ( true === $type->has_archive && $slug === $type->rewrite['slug'] ) ) { + $return[] = $type; + } + } + + return $return; + } + + /** + * Adds a post's terms from a specific taxonomy to the items array. + * + * @since 1.0.0 + * @access protected + * @param int $post_id The ID of the post to get the terms for. + * @param string $taxonomy The taxonomy to get the terms from. + * @return void + */ + protected function add_post_terms( $post_id, $taxonomy ) { + + + // Get the post categories. + $terms = get_the_terms( $post_id, $taxonomy ); + + // Check that categories were returned. + if ( $terms && ! is_wp_error( $terms ) ) { + + // Sort the terms by ID and get the first category. + if ( function_exists( 'wp_list_sort' ) ) { + $terms = wp_list_sort( $terms, 'term_id' ); + } + else { + usort( $terms, '_usort_terms_by_ID' ); + } + $term = get_term( $terms[0], $taxonomy ); + + // If the category has a parent, add the hierarchy to the trail. + if ( 0 < $term->parent ) { + $this->add_term_parents( $term->parent, $taxonomy ); + } + // Add the category archive link to the trail. + $this->items[] = sprintf( '%s', esc_url( get_term_link( $term, $taxonomy ) ), $term->name ); + } + } + + /** + * Get parent posts by path. Currently, this method only supports getting parents of the 'page' + * post type. The goal of this function is to create a clear path back to home given what would + * normally be a "ghost" directory. If any page matches the given path, it'll be added. + * + * @since 1.0.0 + * @access protected + * @param string $path The path (slug) to search for posts by. + * @return void + */ + function add_path_parents( $path ) { + + // Trim '/' off $path in case we just got a simple '/' instead of a real path. + $path = trim( $path, '/' ); + + // If there's no path, return. + if ( empty( $path ) ) { + return; + } + // Get parent post by the path. + $post = get_page_by_path( $path ); + + if ( ! empty( $post ) ) { + $this->add_post_parents( $post->ID ); + } + + elseif ( is_null( $post ) ) { + + // Separate post names into separate paths by '/'. + $path = trim( $path, '/' ); + preg_match_all( "/\/.*?\z/", $path, $matches ); + + // If matches are found for the path. + if ( isset( $matches ) ) { + + // Reverse the array of matches to search for posts in the proper order. + $matches = array_reverse( $matches ); + + // Loop through each of the path matches. + foreach ( $matches as $match ) { + + // If a match is found. + if ( isset( $match[0] ) ) { + + // Get the parent post by the given path. + $path = str_replace( $match[0], '', $path ); + $post = get_page_by_path( trim( $path, '/' ) ); + + // If a parent post is found, set the $post_id and break out of the loop. + if ( ! empty( $post ) && 0 < $post->ID ) { + $this->add_post_parents( $post->ID ); + break; + } + } + } + } + } + } + + /** + * Searches for term parents of hierarchical taxonomies. This function is similar to the WordPress + * function get_category_parents() but handles any type of taxonomy. + * + * @since 1.0.0 + * @param int $term_id ID of the term to get the parents of. + * @param string $taxonomy Name of the taxonomy for the given term. + * @return void + */ + function add_term_parents( $term_id, $taxonomy ) { + + // Set up some default arrays. + $parents = array(); + + // While there is a parent ID, add the parent term link to the $parents array. + while ( $term_id ) { + + // Get the parent term. + $term = get_term( $term_id, $taxonomy ); + + // Add the formatted term link to the array of parent terms. + $parents[] = sprintf( '%s', esc_url( get_term_link( $term, $taxonomy ) ), $term->name ); + + // Set the parent term's parent as the parent ID. + $term_id = $term->parent; + } + + // If we have parent terms, reverse the array to put them in the proper order for the trail. + if ( ! empty( $parents ) ) { + $this->items = array_merge( $this->items, array_reverse( $parents ) ); + } + } + + /** + * Turns %tag% from permalink structures into usable links for the breadcrumb trail. This feels kind of + * hackish for now because we're checking for specific %tag% examples and only doing it for the 'post' + * post type. In the future, maybe it'll handle a wider variety of possibilities, especially for custom post + * types. + * + * @since 0.6.0 + * @access protected + * @param int $post_id ID of the post whose parents we want. + * @param string $path Path of a potential parent page. + * @param array $args Mixed arguments for the menu. + * @return array + */ + protected function map_rewrite_tags( $post_id, $path ) { + + $post = get_post( $post_id ); + + // Trim '/' from both sides of the $path. + $path = trim( $path, '/' ); + + // Split the $path into an array of strings. + $matches = explode( '/', $path ); + + // If matches are found for the path. + if ( is_array( $matches ) ) { + + // Loop through each of the matches, adding each to the $trail array. + foreach ( $matches as $match ) { + + // Trim any '/' from the $match. + $tag = trim( $match, '/' ); + + // If using the %year% tag, add a link to the yearly archive. + if ( '%year%' == $tag ) { + $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y', $post_id ) ) ), sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) ) ); + } + // If using the %monthnum% tag, add a link to the monthly archive. + elseif ( '%monthnum%' == $tag ) { + $this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ) ) ), sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'astra' ) ) ) ); + } + // If using the %day% tag, add a link to the daily archive. + elseif ( '%day%' == $tag ) { + $this->items[] = sprintf( '%s', esc_url( get_day_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ), get_the_time( 'd', $post_id ) ) ), sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'astra' ) ) ) ); + } + // If using the %author% tag, add a link to the post author archive. + elseif ( '%author%' == $tag ) { + $this->items[] = sprintf( '%s', esc_url( get_author_posts_url( $post->post_author ) ), get_the_author_meta( 'display_name', $post->post_author ) ); + } + // If using the %category% tag, add a link to the first category archive to match permalinks. + elseif ( taxonomy_exists( trim( $tag, '%' ) ) ) { + + // Force override terms in this post type. + $this->post_taxonomy[ $post->post_type ] = false; + + // Add the post categories. + $this->add_post_terms( $post_id, trim( $tag, '%' ) ); + } + } + } + } } \ No newline at end of file diff --git a/inc/addons/breadcrumbs/class-astra-breadcrumbs-loader.php b/inc/addons/breadcrumbs/class-astra-breadcrumbs-loader.php index ddf3377..e7586ff 100644 --- a/inc/addons/breadcrumbs/class-astra-breadcrumbs-loader.php +++ b/inc/addons/breadcrumbs/class-astra-breadcrumbs-loader.php @@ -1,190 +1,190 @@ - '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['breadcrumb-active-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['breadcrumb-hover-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['breadcrumb-separator-color'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['breadcrumb-bg-color'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['breadcrumb-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', - ); - - /** - * Breadcrumb Font Defaults - */ - $defaults['breadcrumb-font-family'] = 'inherit'; - $defaults['breadcrumb-font-weight'] = 'inherit'; - $defaults['breadcrumb-text-transform'] = ''; - $defaults['breadcrumb-font-size'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ); - - return $defaults; - } - - /** - * Add postMessage support for site title and description for the Theme Customizer. - * - * @param WP_Customize_Manager $wp_customize Theme Customizer object. - */ - public function customize_register( $wp_customize ) { - - /** - * Register Panel & Sections - */ - // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-configs.php'; - require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-color-configs.php'; - require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-typo-configs.php'; - // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - } - - /** - * Customizer Preview - */ - public function preview_scripts() { - /** - * Load unminified if SCRIPT_DEBUG is true. - */ - /* Directory and Extension */ - $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; - $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; - wp_enqueue_script( 'astra-breadcrumbs-customizer-preview-js', ASTRA_THEME_BREADCRUMBS_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); - } - } -} - -/** -* Kicking this off by calling 'get_instance()' method -*/ -Astra_Breadcrumbs_Loader::get_instance(); + '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['breadcrumb-active-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['breadcrumb-hover-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['breadcrumb-separator-color'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['breadcrumb-bg-color'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['breadcrumb-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', + ); + + /** + * Breadcrumb Font Defaults + */ + $defaults['breadcrumb-font-family'] = 'inherit'; + $defaults['breadcrumb-font-weight'] = 'inherit'; + $defaults['breadcrumb-text-transform'] = ''; + $defaults['breadcrumb-font-size'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ); + + return $defaults; + } + + /** + * Add postMessage support for site title and description for the Theme Customizer. + * + * @param WP_Customize_Manager $wp_customize Theme Customizer object. + */ + public function customize_register( $wp_customize ) { + + /** + * Register Panel & Sections + */ + // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-configs.php'; + require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-color-configs.php'; + require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-typo-configs.php'; + // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + } + + /** + * Customizer Preview + */ + public function preview_scripts() { + /** + * Load unminified if SCRIPT_DEBUG is true. + */ + /* Directory and Extension */ + $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; + $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; + wp_enqueue_script( 'astra-breadcrumbs-customizer-preview-js', ASTRA_THEME_BREADCRUMBS_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); + } + } +} + +/** +* Kicking this off by calling 'get_instance()' method +*/ +Astra_Breadcrumbs_Loader::get_instance(); diff --git a/inc/addons/breadcrumbs/class-astra-breadcrumbs-markup.php b/inc/addons/breadcrumbs/class-astra-breadcrumbs-markup.php index e5285a3..a689037 100644 --- a/inc/addons/breadcrumbs/class-astra-breadcrumbs-markup.php +++ b/inc/addons/breadcrumbs/class-astra-breadcrumbs-markup.php @@ -1,157 +1,157 @@ - -
'; - } - astra_get_breadcrumb(); - if ( $breadcrumb_position && ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) ) { - echo '
-
'; - } - } - - /** - * Astra Breadcrumbs Rules - * - * Checks the rules defined for displaying Breadcrumb on different pages. - * - * @since 1.8.0 - * - * @return boolean - */ - public static function astra_breadcrumb_rules() { - - // Display Breadcrumb default true. - $display_breadcrumb = true; - - if ( is_front_page() && '1' == astra_get_option( 'breadcrumb-disable-home-page' ) ) { - $display_breadcrumb = false; - } - - if ( is_home() && '1' == astra_get_option( 'breadcrumb-disable-blog-posts-page' ) ) { - $display_breadcrumb = false; - } - - if ( is_search() && '1' == astra_get_option( 'breadcrumb-disable-search' ) ) { - $display_breadcrumb = false; - } - - if ( ( is_archive() ) && '1' == astra_get_option( 'breadcrumb-disable-archive' ) ) { - $display_breadcrumb = false; - } - - if ( is_page() && '1' == astra_get_option( 'breadcrumb-disable-single-page' ) ) { - $display_breadcrumb = false; - } - - if ( is_single() && '1' == astra_get_option( 'breadcrumb-disable-single-post' ) ) { - $display_breadcrumb = false; - } - - if ( is_singular() && '1' == astra_get_option( 'breadcrumb-disable-singular' ) ) { - $display_breadcrumb = false; - } - - if ( is_404() && '1' == astra_get_option( 'breadcrumb-disable-404-page' ) ) { - $display_breadcrumb = false; - } - - return apply_filters( 'astra_breadcrumb_enabled', $display_breadcrumb ); - } - } -} - -/** -* Kicking this off by calling 'get_instance()' method -*/ -Astra_Breadcrumbs_Markup::get_instance(); + +
'; + } + astra_get_breadcrumb(); + if ( $breadcrumb_position && ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) ) { + echo '
+
'; + } + } + + /** + * Astra Breadcrumbs Rules + * + * Checks the rules defined for displaying Breadcrumb on different pages. + * + * @since 1.8.0 + * + * @return boolean + */ + public static function astra_breadcrumb_rules() { + + // Display Breadcrumb default true. + $display_breadcrumb = true; + + if ( is_front_page() && '1' == astra_get_option( 'breadcrumb-disable-home-page' ) ) { + $display_breadcrumb = false; + } + + if ( is_home() && '1' == astra_get_option( 'breadcrumb-disable-blog-posts-page' ) ) { + $display_breadcrumb = false; + } + + if ( is_search() && '1' == astra_get_option( 'breadcrumb-disable-search' ) ) { + $display_breadcrumb = false; + } + + if ( ( is_archive() ) && '1' == astra_get_option( 'breadcrumb-disable-archive' ) ) { + $display_breadcrumb = false; + } + + if ( is_page() && '1' == astra_get_option( 'breadcrumb-disable-single-page' ) ) { + $display_breadcrumb = false; + } + + if ( is_single() && '1' == astra_get_option( 'breadcrumb-disable-single-post' ) ) { + $display_breadcrumb = false; + } + + if ( is_singular() && '1' == astra_get_option( 'breadcrumb-disable-singular' ) ) { + $display_breadcrumb = false; + } + + if ( is_404() && '1' == astra_get_option( 'breadcrumb-disable-404-page' ) ) { + $display_breadcrumb = false; + } + + return apply_filters( 'astra_breadcrumb_enabled', $display_breadcrumb ); + } + } +} + +/** +* Kicking this off by calling 'get_instance()' method +*/ +Astra_Breadcrumbs_Markup::get_instance(); diff --git a/inc/addons/breadcrumbs/class-astra-breadcrumbs.php b/inc/addons/breadcrumbs/class-astra-breadcrumbs.php index 4a7b00f..5269f65 100644 --- a/inc/addons/breadcrumbs/class-astra-breadcrumbs.php +++ b/inc/addons/breadcrumbs/class-astra-breadcrumbs.php @@ -1,105 +1,105 @@ - $breadcrumb_enable, - ); - } - - if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] ) { - $options['yoast-seo-breadcrumbs'] = 'Yoast SEO Breadcrumbs'; - } - - if ( function_exists( 'bcn_display' ) ) { - $options['breadcrumb-navxt'] = 'Breadcrumb NavXT'; - } - - if ( function_exists( 'rank_math_the_breadcrumbs' ) ) { - $options['rank-math'] = 'Rank Math'; - } - - return $options; - } - } - - /** - * Kicking this off by calling 'get_instance()' method - */ - Astra_Breadcrumbs::get_instance(); - -} + $breadcrumb_enable, + ); + } + + if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] ) { + $options['yoast-seo-breadcrumbs'] = 'Yoast SEO Breadcrumbs'; + } + + if ( function_exists( 'bcn_display' ) ) { + $options['breadcrumb-navxt'] = 'Breadcrumb NavXT'; + } + + if ( function_exists( 'rank_math_the_breadcrumbs' ) ) { + $options['rank-math'] = 'Rank Math'; + } + + return $options; + } + } + + /** + * Kicking this off by calling 'get_instance()' method + */ + Astra_Breadcrumbs::get_instance(); + +} diff --git a/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-color-configs.php b/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-color-configs.php index a5a2ddd..28a7272 100644 --- a/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-color-configs.php +++ b/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-color-configs.php @@ -1,206 +1,206 @@ - ASTRA_THEME_SETTINGS . '[breadcrumb-bg-color]', - 'type' => 'control', - 'default' => astra_get_option( 'breadcrumb-bg-color' ), - 'section' => 'section-breadcrumb', - 'transport' => 'postMessage', - 'control' => 'ast-responsive-color', - 'title' => __( 'Background Color', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? - Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, - ), - 'priority' => 72, - ), - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-active-color-responsive]', - 'default' => astra_get_option( 'breadcrumb-active-color-responsive' ), - 'type' => 'control', - 'section' => 'section-breadcrumb', - 'transport' => 'postMessage', - 'control' => 'ast-responsive-color', - 'title' => __( 'Text Color', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? - Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, - ), - 'priority' => 72, - ), - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-color]', - 'default' => astra_get_option( 'breadcrumb-separator-color' ), - 'type' => 'control', - 'section' => 'section-breadcrumb', - 'transport' => 'postMessage', - 'control' => 'ast-responsive-color', - 'title' => __( 'Separator Color', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? - Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, - ), - 'priority' => 72, - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]', - 'default' => astra_get_option( 'section-breadcrumb-color' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Content Link Color', 'astra' ), - 'section' => 'section-breadcrumb', - 'transport' => 'postMessage', - 'priority' => 72, - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? - Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, - ), - 'responsive' => true, - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - array( - 'name' => 'breadcrumb-text-color-responsive', - 'default' => astra_get_option( 'breadcrumb-text-color-responsive' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]', - 'section' => 'section-breadcrumb', - 'transport' => 'postMessage', - 'tab' => __( 'Normal', 'astra' ), - 'control' => 'ast-responsive-color', - 'title' => __( 'Normal', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'priority' => 15, - ), - - array( - 'name' => 'breadcrumb-hover-color-responsive', - 'default' => astra_get_option( 'breadcrumb-hover-color-responsive' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]', - 'section' => 'section-breadcrumb', - 'transport' => 'postMessage', - 'tab' => __( 'Hover', 'astra' ), - 'control' => 'ast-responsive-color', - 'title' => __( 'Hover', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'priority' => 20, - ), - ); - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { - array_push( - $_configs, - /** - * Option: Divider - * Option: breadcrumb color Section divider - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-color-divider]', - 'type' => 'control', - 'control' => 'ast-heading', - 'section' => 'section-breadcrumb', - 'title' => __( 'Colors', 'astra' ), - 'priority' => 71, - 'settings' => array(), - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - ) - ); - } - return array_merge( $configurations, $_configs ); - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -new Astra_Breadcrumbs_Color_Configs(); + ASTRA_THEME_SETTINGS . '[breadcrumb-bg-color]', + 'type' => 'control', + 'default' => astra_get_option( 'breadcrumb-bg-color' ), + 'section' => 'section-breadcrumb', + 'transport' => 'postMessage', + 'control' => 'ast-responsive-color', + 'title' => __( 'Background Color', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? + Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, + ), + 'priority' => 72, + ), + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-active-color-responsive]', + 'default' => astra_get_option( 'breadcrumb-active-color-responsive' ), + 'type' => 'control', + 'section' => 'section-breadcrumb', + 'transport' => 'postMessage', + 'control' => 'ast-responsive-color', + 'title' => __( 'Text Color', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? + Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, + ), + 'priority' => 72, + ), + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-color]', + 'default' => astra_get_option( 'breadcrumb-separator-color' ), + 'type' => 'control', + 'section' => 'section-breadcrumb', + 'transport' => 'postMessage', + 'control' => 'ast-responsive-color', + 'title' => __( 'Separator Color', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? + Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, + ), + 'priority' => 72, + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]', + 'default' => astra_get_option( 'section-breadcrumb-color' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Content Link Color', 'astra' ), + 'section' => 'section-breadcrumb', + 'transport' => 'postMessage', + 'priority' => 72, + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? + Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, + ), + 'responsive' => true, + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + array( + 'name' => 'breadcrumb-text-color-responsive', + 'default' => astra_get_option( 'breadcrumb-text-color-responsive' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]', + 'section' => 'section-breadcrumb', + 'transport' => 'postMessage', + 'tab' => __( 'Normal', 'astra' ), + 'control' => 'ast-responsive-color', + 'title' => __( 'Normal', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'priority' => 15, + ), + + array( + 'name' => 'breadcrumb-hover-color-responsive', + 'default' => astra_get_option( 'breadcrumb-hover-color-responsive' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]', + 'section' => 'section-breadcrumb', + 'transport' => 'postMessage', + 'tab' => __( 'Hover', 'astra' ), + 'control' => 'ast-responsive-color', + 'title' => __( 'Hover', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'priority' => 20, + ), + ); + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { + array_push( + $_configs, + /** + * Option: Divider + * Option: breadcrumb color Section divider + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-color-divider]', + 'type' => 'control', + 'control' => 'ast-heading', + 'section' => 'section-breadcrumb', + 'title' => __( 'Colors', 'astra' ), + 'priority' => 71, + 'settings' => array(), + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + ) + ); + } + return array_merge( $configurations, $_configs ); + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +new Astra_Breadcrumbs_Color_Configs(); diff --git a/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-configs.php b/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-configs.php index e4f60a8..e1800dd 100644 --- a/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-configs.php +++ b/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-configs.php @@ -1,503 +1,503 @@ - __( 'Default', 'astra' ), - ), - 'breadcrumb-list' - ); - - $_section = 'section-breadcrumb'; - - $positions = array( - 'none' => __( 'None', 'astra' ), - 'astra_masthead_content' => __( 'Inside', 'astra' ), - 'astra_header_markup_after' => __( 'After Header', 'astra' ), - 'astra_entry_top' => __( 'Before Title', 'astra' ), - ); - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - $positions = array( - 'none' => __( 'None', 'astra' ), - 'astra_header_primary_container_after' => __( 'Inside', 'astra' ), - 'astra_header_after' => __( 'After', 'astra' ), - 'astra_entry_top' => __( 'Before Title', 'astra' ), - ); - } - - $_configs = array( - - /* - * Breadcrumb - */ - array( - 'name' => $_section, - 'type' => 'section', - 'priority' => 20, - 'title' => __( 'Breadcrumb', 'astra' ), - 'description_hidden' => true, - 'description' => $this->section_get_description( - array( - 'description' => '

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

', - 'links' => array( - array( - 'text' => __( 'Breadcrumb Overview', 'astra' ) . ' »', - 'attrs' => array( - 'href' => astra_get_pro_url( 'https://wpastra.com/docs/add-breadcrumbs-with-astra/', 'customizer', 'sidebar', 'helpful-information' ), - ), - ), - ), - ) - ), - ), - - /** - * Option: Breadcrumb Position - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'default' => astra_get_option( 'breadcrumb-position', 'none' ), - 'section' => $_section, - 'title' => __( 'Header Position', 'astra' ), - 'type' => 'control', - 'control' => 'ast-select', - 'priority' => 5, - 'choices' => $positions, - 'partial' => array( - 'selector' => '.ast-breadcrumbs-wrapper .ast-breadcrumbs .trail-items', - 'container_inclusive' => false, - ), - 'context' => Astra_Builder_Helper::$general_tab, - 'responsive' => false, - 'renderAs' => 'text', - ), - - /** - * Option: Disable Breadcrumb on Categories - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-home-page]', - 'default' => astra_get_option( 'breadcrumb-disable-home-page' ), - 'type' => 'control', - 'section' => $_section, - 'title' => __( 'Disable on Home Page?', 'astra' ), - 'priority' => 25, - 'control' => 'ast-toggle-control', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), - ), - - - /** - * Option: Disable Breadcrumb on Categories - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-blog-posts-page]', - 'default' => astra_get_option( 'breadcrumb-disable-blog-posts-page' ), - 'type' => 'control', - 'section' => $_section, - 'description' => __( 'Latest posts page or when any page is selected as blog page', 'astra' ), - 'title' => __( 'Disable on Blog / Posts Page?', 'astra' ), - 'priority' => 25, - 'control' => 'ast-toggle-control', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Disable Breadcrumb on Search - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-search]', - 'default' => astra_get_option( 'breadcrumb-disable-search' ), - 'type' => 'control', - 'section' => $_section, - 'title' => __( 'Disable on Search?', 'astra' ), - 'priority' => 30, - 'control' => 'ast-toggle-control', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Disable Breadcrumb on Archive - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-archive]', - 'default' => astra_get_option( 'breadcrumb-disable-archive' ), - 'type' => 'control', - 'section' => $_section, - 'title' => __( 'Disable on Archive?', 'astra' ), - 'priority' => 35, - 'control' => 'ast-toggle-control', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Disable Breadcrumb on Single Page - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-single-page]', - 'default' => astra_get_option( 'breadcrumb-disable-single-page' ), - 'type' => 'control', - 'section' => $_section, - 'title' => __( 'Disable on Single Page?', 'astra' ), - 'priority' => 40, - 'control' => 'ast-toggle-control', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Disable Breadcrumb on Single Post - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-single-post]', - 'default' => astra_get_option( 'breadcrumb-disable-single-post' ), - 'type' => 'control', - 'section' => $_section, - 'title' => __( 'Disable on Single Post?', 'astra' ), - 'priority' => 45, - 'control' => 'ast-toggle-control', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Disable Breadcrumb on Singular - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-singular]', - 'default' => astra_get_option( 'breadcrumb-disable-singular' ), - 'type' => 'control', - 'section' => $_section, - 'description' => __( 'All Pages, All Posts, All Attachments', 'astra' ), - 'title' => __( 'Disable on Singular?', 'astra' ), - 'priority' => 50, - 'control' => 'ast-toggle-control', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Disable Breadcrumb on 404 Page - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-404-page]', - 'default' => astra_get_option( 'breadcrumb-disable-404-page' ), - 'type' => 'control', - 'section' => $_section, - - 'title' => __( 'Disable on 404 Page?', 'astra' ), - 'priority' => 55, - 'control' => 'ast-toggle-control', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Breadcrumb Alignment - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-alignment]', - 'default' => astra_get_option( 'breadcrumb-alignment', 'left' ), - 'section' => $_section, - 'transport' => 'postMessage', - 'title' => __( 'Alignment', 'astra' ), - 'type' => 'control', - 'control' => 'ast-selector', - 'priority' => 65, - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'choices' => array( - 'left' => 'align-left', - 'center' => 'align-center', - 'right' => 'align-right', - ), - 'responsive' => false, - ), - - /** - * Option: Breadcrumb Spacing - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-spacing]', - 'default' => astra_get_option( 'breadcrumb-spacing' ), - 'type' => 'control', - 'transport' => 'postMessage', - 'control' => 'ast-responsive-spacing', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), - 'priority' => 83, - 'title' => __( 'Spacing', 'astra' ), - 'linked_choices' => true, - 'unit_choices' => array( 'px', 'em', '%' ), - 'choices' => array( - 'top' => __( 'Top', 'astra' ), - 'right' => __( 'Right', 'astra' ), - 'bottom' => __( 'Bottom', 'astra' ), - 'left' => __( 'Left', 'astra' ), - ), - - 'section' => $_section, - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? - Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, - ), - ), - ); - - - if ( $this->is_third_party_breadcrumb_active() ) { - - $_configs[] = array( - 'name' => ASTRA_THEME_SETTINGS . '[select-breadcrumb-source]', - 'default' => astra_get_option( 'select-breadcrumb-source', 'default' ), - 'section' => $_section, - 'title' => __( 'Breadcrumb Source', 'astra' ), - 'type' => 'control', - 'control' => 'ast-select', - 'priority' => 10, - 'choices' => $breadcrumb_source_list, - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'divider' => array( 'ast_class' => 'ast-top-divider' ), - ); - } - - if ( $this->is_selected_breadcrumb_active() ) { - - $_configs[] = array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-divider]', - 'type' => 'control', - 'control' => 'ast-divider', - 'section' => $_section, - 'settings' => array(), - 'priority' => 15, - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - ); - $_configs[] = array( - 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator]', - 'type' => 'control', - 'control' => 'text', - 'section' => $_section, - 'default' => astra_get_option( 'breadcrumb-separator' ) ? astra_get_option( 'breadcrumb-separator' ) : '\00bb', - 'priority' => 15, - 'title' => __( 'Separator', 'astra' ), - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'transport' => 'postMessage', - ); - } - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - $_configs[] = array( - 'name' => $_section . '-ast-context-tabs', - 'section' => $_section, - 'type' => 'control', - 'control' => 'ast-builder-header-control', - 'priority' => 0, - 'description' => '', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - ), - ); - - } - - - return array_merge( $configurations, $_configs ); - - } - - /** - * Is third-party breadcrumb active. - * Decide if the Source option should be visible depending on third party plugins. - * - * @return boolean True - If the option should be displayed, False - If the option should be hidden. - */ - public function is_third_party_breadcrumb_active() { - - // Check if breadcrumb is turned on from WPSEO option. - $breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false; - $wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable; - if ( ! is_array( $wpseo_option ) ) { - unset( $wpseo_option ); - $wpseo_option = array( - 'breadcrumbs-enable' => $breadcrumb_enable, - ); - } - - if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] ) { - // Check if breadcrumb is turned on from SEO Yoast plugin. - return true; - } elseif ( function_exists( 'bcn_display' ) ) { - // Check if breadcrumb is turned on from Breadcrumb NavXT plugin. - return true; - } elseif ( function_exists( 'rank_math_the_breadcrumbs' ) ) { - // Check if breadcrumb is turned on from Rank Math plugin. - return true; - } else { - return false; - } - } - - /** - * Is selected third-party breadcrumb active. - * Decide if the Separator option should be visible depending on third party plugins. - * - * @return boolean True - If the option should be displayed, False - If the option should be hidden. - */ - public function is_selected_breadcrumb_active() { - - // Check if breadcrumb is turned on from WPSEO option. - $selected_breadcrumb_source = astra_get_option( 'select-breadcrumb-source' ); - $breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false; - $wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable; - if ( ! is_array( $wpseo_option ) ) { - - unset( $wpseo_option ); - $wpseo_option = array( - 'breadcrumbs-enable' => $breadcrumb_enable, - ); - } - - if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && 'yoast-seo-breadcrumbs' === $selected_breadcrumb_source ) { - // Check if breadcrumb is turned on from SEO Yoast plugin. - return false; - } elseif ( function_exists( 'bcn_display' ) && 'breadcrumb-navxt' === $selected_breadcrumb_source ) { - // Check if breadcrumb is turned on from Breadcrumb NavXT plugin. - return false; - } elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && 'rank-math' === $selected_breadcrumb_source ) { - // Check if breadcrumb is turned on from Rank Math plugin. - return false; - } else { - return true; - } - } - } -} - -new Astra_Breadcrumbs_Configs(); + __( 'Default', 'astra' ), + ), + 'breadcrumb-list' + ); + + $_section = 'section-breadcrumb'; + + $positions = array( + 'none' => __( 'None', 'astra' ), + 'astra_masthead_content' => __( 'Inside', 'astra' ), + 'astra_header_markup_after' => __( 'After Header', 'astra' ), + 'astra_entry_top' => __( 'Before Title', 'astra' ), + ); + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + $positions = array( + 'none' => __( 'None', 'astra' ), + 'astra_header_primary_container_after' => __( 'Inside', 'astra' ), + 'astra_header_after' => __( 'After', 'astra' ), + 'astra_entry_top' => __( 'Before Title', 'astra' ), + ); + } + + $_configs = array( + + /* + * Breadcrumb + */ + array( + 'name' => $_section, + 'type' => 'section', + 'priority' => 20, + 'title' => __( 'Breadcrumb', 'astra' ), + 'description_hidden' => true, + 'description' => $this->section_get_description( + array( + 'description' => '

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

', + 'links' => array( + array( + 'text' => __( 'Breadcrumb Overview', 'astra' ) . ' »', + 'attrs' => array( + 'href' => astra_get_pro_url( 'https://wpastra.com/docs/add-breadcrumbs-with-astra/', 'customizer', 'sidebar', 'helpful-information' ), + ), + ), + ), + ) + ), + ), + + /** + * Option: Breadcrumb Position + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'default' => astra_get_option( 'breadcrumb-position', 'none' ), + 'section' => $_section, + 'title' => __( 'Header Position', 'astra' ), + 'type' => 'control', + 'control' => 'ast-select', + 'priority' => 5, + 'choices' => $positions, + 'partial' => array( + 'selector' => '.ast-breadcrumbs-wrapper .ast-breadcrumbs .trail-items', + 'container_inclusive' => false, + ), + 'context' => Astra_Builder_Helper::$general_tab, + 'responsive' => false, + 'renderAs' => 'text', + ), + + /** + * Option: Disable Breadcrumb on Categories + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-home-page]', + 'default' => astra_get_option( 'breadcrumb-disable-home-page' ), + 'type' => 'control', + 'section' => $_section, + 'title' => __( 'Disable on Home Page?', 'astra' ), + 'priority' => 25, + 'control' => 'ast-toggle-control', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), + ), + + + /** + * Option: Disable Breadcrumb on Categories + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-blog-posts-page]', + 'default' => astra_get_option( 'breadcrumb-disable-blog-posts-page' ), + 'type' => 'control', + 'section' => $_section, + 'description' => __( 'Latest posts page or when any page is selected as blog page', 'astra' ), + 'title' => __( 'Disable on Blog / Posts Page?', 'astra' ), + 'priority' => 25, + 'control' => 'ast-toggle-control', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Disable Breadcrumb on Search + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-search]', + 'default' => astra_get_option( 'breadcrumb-disable-search' ), + 'type' => 'control', + 'section' => $_section, + 'title' => __( 'Disable on Search?', 'astra' ), + 'priority' => 30, + 'control' => 'ast-toggle-control', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Disable Breadcrumb on Archive + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-archive]', + 'default' => astra_get_option( 'breadcrumb-disable-archive' ), + 'type' => 'control', + 'section' => $_section, + 'title' => __( 'Disable on Archive?', 'astra' ), + 'priority' => 35, + 'control' => 'ast-toggle-control', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Disable Breadcrumb on Single Page + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-single-page]', + 'default' => astra_get_option( 'breadcrumb-disable-single-page' ), + 'type' => 'control', + 'section' => $_section, + 'title' => __( 'Disable on Single Page?', 'astra' ), + 'priority' => 40, + 'control' => 'ast-toggle-control', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Disable Breadcrumb on Single Post + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-single-post]', + 'default' => astra_get_option( 'breadcrumb-disable-single-post' ), + 'type' => 'control', + 'section' => $_section, + 'title' => __( 'Disable on Single Post?', 'astra' ), + 'priority' => 45, + 'control' => 'ast-toggle-control', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Disable Breadcrumb on Singular + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-singular]', + 'default' => astra_get_option( 'breadcrumb-disable-singular' ), + 'type' => 'control', + 'section' => $_section, + 'description' => __( 'All Pages, All Posts, All Attachments', 'astra' ), + 'title' => __( 'Disable on Singular?', 'astra' ), + 'priority' => 50, + 'control' => 'ast-toggle-control', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Disable Breadcrumb on 404 Page + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-404-page]', + 'default' => astra_get_option( 'breadcrumb-disable-404-page' ), + 'type' => 'control', + 'section' => $_section, + + 'title' => __( 'Disable on 404 Page?', 'astra' ), + 'priority' => 55, + 'control' => 'ast-toggle-control', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Breadcrumb Alignment + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-alignment]', + 'default' => astra_get_option( 'breadcrumb-alignment', 'left' ), + 'section' => $_section, + 'transport' => 'postMessage', + 'title' => __( 'Alignment', 'astra' ), + 'type' => 'control', + 'control' => 'ast-selector', + 'priority' => 65, + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'choices' => array( + 'left' => 'align-left', + 'center' => 'align-center', + 'right' => 'align-right', + ), + 'responsive' => false, + ), + + /** + * Option: Breadcrumb Spacing + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-spacing]', + 'default' => astra_get_option( 'breadcrumb-spacing' ), + 'type' => 'control', + 'transport' => 'postMessage', + 'control' => 'ast-responsive-spacing', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), + 'priority' => 83, + 'title' => __( 'Spacing', 'astra' ), + 'linked_choices' => true, + 'unit_choices' => array( 'px', 'em', '%' ), + 'choices' => array( + 'top' => __( 'Top', 'astra' ), + 'right' => __( 'Right', 'astra' ), + 'bottom' => __( 'Bottom', 'astra' ), + 'left' => __( 'Left', 'astra' ), + ), + + 'section' => $_section, + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? + Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, + ), + ), + ); + + + if ( $this->is_third_party_breadcrumb_active() ) { + + $_configs[] = array( + 'name' => ASTRA_THEME_SETTINGS . '[select-breadcrumb-source]', + 'default' => astra_get_option( 'select-breadcrumb-source', 'default' ), + 'section' => $_section, + 'title' => __( 'Breadcrumb Source', 'astra' ), + 'type' => 'control', + 'control' => 'ast-select', + 'priority' => 10, + 'choices' => $breadcrumb_source_list, + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'divider' => array( 'ast_class' => 'ast-top-divider' ), + ); + } + + if ( $this->is_selected_breadcrumb_active() ) { + + $_configs[] = array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-divider]', + 'type' => 'control', + 'control' => 'ast-divider', + 'section' => $_section, + 'settings' => array(), + 'priority' => 15, + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + ); + $_configs[] = array( + 'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator]', + 'type' => 'control', + 'control' => 'text', + 'section' => $_section, + 'default' => astra_get_option( 'breadcrumb-separator' ) ? astra_get_option( 'breadcrumb-separator' ) : '\00bb', + 'priority' => 15, + 'title' => __( 'Separator', 'astra' ), + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'transport' => 'postMessage', + ); + } + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + $_configs[] = array( + 'name' => $_section . '-ast-context-tabs', + 'section' => $_section, + 'type' => 'control', + 'control' => 'ast-builder-header-control', + 'priority' => 0, + 'description' => '', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + ), + ); + + } + + + return array_merge( $configurations, $_configs ); + + } + + /** + * Is third-party breadcrumb active. + * Decide if the Source option should be visible depending on third party plugins. + * + * @return boolean True - If the option should be displayed, False - If the option should be hidden. + */ + public function is_third_party_breadcrumb_active() { + + // Check if breadcrumb is turned on from WPSEO option. + $breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false; + $wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable; + if ( ! is_array( $wpseo_option ) ) { + unset( $wpseo_option ); + $wpseo_option = array( + 'breadcrumbs-enable' => $breadcrumb_enable, + ); + } + + if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] ) { + // Check if breadcrumb is turned on from SEO Yoast plugin. + return true; + } elseif ( function_exists( 'bcn_display' ) ) { + // Check if breadcrumb is turned on from Breadcrumb NavXT plugin. + return true; + } elseif ( function_exists( 'rank_math_the_breadcrumbs' ) ) { + // Check if breadcrumb is turned on from Rank Math plugin. + return true; + } else { + return false; + } + } + + /** + * Is selected third-party breadcrumb active. + * Decide if the Separator option should be visible depending on third party plugins. + * + * @return boolean True - If the option should be displayed, False - If the option should be hidden. + */ + public function is_selected_breadcrumb_active() { + + // Check if breadcrumb is turned on from WPSEO option. + $selected_breadcrumb_source = astra_get_option( 'select-breadcrumb-source' ); + $breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false; + $wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable; + if ( ! is_array( $wpseo_option ) ) { + + unset( $wpseo_option ); + $wpseo_option = array( + 'breadcrumbs-enable' => $breadcrumb_enable, + ); + } + + if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && 'yoast-seo-breadcrumbs' === $selected_breadcrumb_source ) { + // Check if breadcrumb is turned on from SEO Yoast plugin. + return false; + } elseif ( function_exists( 'bcn_display' ) && 'breadcrumb-navxt' === $selected_breadcrumb_source ) { + // Check if breadcrumb is turned on from Breadcrumb NavXT plugin. + return false; + } elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && 'rank-math' === $selected_breadcrumb_source ) { + // Check if breadcrumb is turned on from Rank Math plugin. + return false; + } else { + return true; + } + } + } +} + +new Astra_Breadcrumbs_Configs(); diff --git a/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-typo-configs.php b/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-typo-configs.php index 2afd280..51f879b 100644 --- a/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-typo-configs.php +++ b/inc/addons/breadcrumbs/customizer/class-astra-breadcrumbs-typo-configs.php @@ -1,179 +1,179 @@ - ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', - 'default' => astra_get_option( 'section-breadcrumb-typo' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Content Font', 'astra' ), - 'section' => 'section-breadcrumb', - 'transport' => 'postMessage', - 'priority' => 73, - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', - 'operator' => '!=', - 'value' => 'none', - ), - ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? - Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Font Family - */ - array( - 'name' => 'breadcrumb-font-family', - 'default' => astra_get_option( 'breadcrumb-font-family' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', - 'section' => 'section-breadcrumb', - 'control' => 'ast-font', - 'font_type' => 'ast-font-family', - 'title' => __( 'Family', 'astra' ), - 'connect' => 'breadcrumb-font-weight', - 'priority' => 5, - ), - - /** - * Option: Font Size - */ - array( - 'name' => 'breadcrumb-font-size', - 'control' => 'ast-responsive', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', - 'section' => 'section-breadcrumb', - 'default' => astra_get_option( 'breadcrumb-font-size' ), - 'transport' => 'postMessage', - 'title' => __( 'Size', 'astra' ), - 'priority' => 10, - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - - /** - * Option: Font Weight - */ - array( - 'name' => 'breadcrumb-font-weight', - 'control' => 'ast-font', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', - 'section' => 'section-breadcrumb', - 'font_type' => 'ast-font-weight', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), - 'default' => astra_get_option( 'breadcrumb-font-weight' ), - 'title' => __( 'Weight', 'astra' ), - 'connect' => 'breadcrumb-font-family', - 'priority' => 15, - ), - - /** - * Option: Text Transform - */ - array( - 'name' => 'breadcrumb-text-transform', - 'control' => 'ast-select', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', - 'section' => 'section-breadcrumb', - 'default' => astra_get_option( 'breadcrumb-text-transform' ), - 'title' => __( 'Text Transform', 'astra' ), - 'transport' => 'postMessage', - 'priority' => 20, - 'choices' => array( - '' => __( 'Inherit', 'astra' ), - 'none' => __( 'None', 'astra' ), - 'capitalize' => __( 'Capitalize', 'astra' ), - 'uppercase' => __( 'Uppercase', 'astra' ), - 'lowercase' => __( 'Lowercase', 'astra' ), - ), - ), - - /** - * Option: Line Height - */ - array( - 'name' => 'breadcrumb-line-height', - 'control' => 'ast-slider', - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'default' => astra_get_option( 'breadcrumb-line-height' ), - 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', - 'section' => 'section-breadcrumb', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'title' => __( 'Line Height', 'astra' ), - 'suffix' => 'em', - 'priority' => 25, - 'input_attrs' => array( - 'min' => 1, - 'step' => 0.01, - 'max' => 5, - ), - ), - - ); - - return array_merge( $configurations, $_configs ); - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -new Astra_Breadcrumbs_Typo_Configs(); + ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', + 'default' => astra_get_option( 'section-breadcrumb-typo' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Content Font', 'astra' ), + 'section' => 'section-breadcrumb', + 'transport' => 'postMessage', + 'priority' => 73, + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]', + 'operator' => '!=', + 'value' => 'none', + ), + ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? + Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Font Family + */ + array( + 'name' => 'breadcrumb-font-family', + 'default' => astra_get_option( 'breadcrumb-font-family' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', + 'section' => 'section-breadcrumb', + 'control' => 'ast-font', + 'font_type' => 'ast-font-family', + 'title' => __( 'Family', 'astra' ), + 'connect' => 'breadcrumb-font-weight', + 'priority' => 5, + ), + + /** + * Option: Font Size + */ + array( + 'name' => 'breadcrumb-font-size', + 'control' => 'ast-responsive', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', + 'section' => 'section-breadcrumb', + 'default' => astra_get_option( 'breadcrumb-font-size' ), + 'transport' => 'postMessage', + 'title' => __( 'Size', 'astra' ), + 'priority' => 10, + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Font Weight + */ + array( + 'name' => 'breadcrumb-font-weight', + 'control' => 'ast-font', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', + 'section' => 'section-breadcrumb', + 'font_type' => 'ast-font-weight', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), + 'default' => astra_get_option( 'breadcrumb-font-weight' ), + 'title' => __( 'Weight', 'astra' ), + 'connect' => 'breadcrumb-font-family', + 'priority' => 15, + ), + + /** + * Option: Text Transform + */ + array( + 'name' => 'breadcrumb-text-transform', + 'control' => 'ast-select', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', + 'section' => 'section-breadcrumb', + 'default' => astra_get_option( 'breadcrumb-text-transform' ), + 'title' => __( 'Text Transform', 'astra' ), + 'transport' => 'postMessage', + 'priority' => 20, + 'choices' => array( + '' => __( 'Inherit', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + ), + + /** + * Option: Line Height + */ + array( + 'name' => 'breadcrumb-line-height', + 'control' => 'ast-slider', + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'default' => astra_get_option( 'breadcrumb-line-height' ), + 'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]', + 'section' => 'section-breadcrumb', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'title' => __( 'Line Height', 'astra' ), + 'suffix' => 'em', + 'priority' => 25, + 'input_attrs' => array( + 'min' => 1, + 'step' => 0.01, + 'max' => 5, + ), + ), + + ); + + return array_merge( $configurations, $_configs ); + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +new Astra_Breadcrumbs_Typo_Configs(); diff --git a/inc/addons/breadcrumbs/dynamic-css/dynamic.css.php b/inc/addons/breadcrumbs/dynamic-css/dynamic.css.php index 1aa68c9..23132a5 100644 --- a/inc/addons/breadcrumbs/dynamic-css/dynamic.css.php +++ b/inc/addons/breadcrumbs/dynamic-css/dynamic.css.php @@ -1,539 +1,539 @@ - array( - 'display' => 'inline-block', - 'margin' => '0', - 'padding' => '0', - 'border' => 'none', - 'background' => 'inherit', - 'text-indent' => '0', - ), - '.ast-breadcrumbs .trail-browse' => array( - 'font-size' => 'inherit', - 'font-style' => 'inherit', - 'font-weight' => 'inherit', - 'color' => 'inherit', - ), - '.ast-breadcrumbs .trail-items' => array( - 'list-style' => 'none', - ), - '.trail-items li::after' => array( - 'padding' => '0 0.3em', - 'content' => '"\00bb"', - ), - '.trail-items li:last-of-type::after' => array( - 'display' => 'none', - ), - ), - '', - '' - ); - - if ( 'none' === $breadcrumb_position ) { - return $dynamic_css; - } - - /** - * Set CSS Params - */ - - $default_color_array = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $breadcrumb_text_color = astra_get_option( 'breadcrumb-text-color-responsive', $default_color_array ); - $breadcrumb_active_color = astra_get_option( 'breadcrumb-active-color-responsive', $default_color_array ); - $breadcrumb_hover_color = astra_get_option( 'breadcrumb-hover-color-responsive', $default_color_array ); - $breadcrumb_separator_color = astra_get_option( 'breadcrumb-separator-color', $default_color_array ); - $breadcrumb_bg_color = astra_get_option( 'breadcrumb-bg-color', $default_color_array ); - - $breadcrumb_font_family = astra_get_option( 'breadcrumb-font-family' ); - $breadcrumb_font_weight = astra_get_option( 'breadcrumb-font-weight' ); - $breadcrumb_font_size = astra_get_option( 'breadcrumb-font-size' ); - $breadcrumb_line_height = astra_get_option( 'breadcrumb-line-height' ); - $breadcrumb_text_transform = astra_get_option( 'breadcrumb-text-transform' ); - - $breadcrumb_spacing = astra_get_option( 'breadcrumb-spacing' ); - - $breadcrumb_alignment = astra_get_option( 'breadcrumb-alignment' ); - - /** - * Generate dynamic CSS based on the Breadcrumb Source option selected from the customizer. - */ - $breadcrumb_source = astra_get_option( 'select-breadcrumb-source' ); - - /** - * Generate Dynamic CSS - */ - - $css = ''; - $breadcrumbs_default_css = array(); - $breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false; - $wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable; - if ( ! is_array( $wpseo_option ) ) { - unset( $wpseo_option ); - $wpseo_option = array( - 'breadcrumbs-enable' => $breadcrumb_enable, - ); - } - - $css .= astra_parse_css( - array( - '.trail-items li::after' => array( - 'content' => '"' . astra_get_option( 'breadcrumb-separator', '\00bb' ) . '"', - ), - ), - '', - '' - ); - - /** - * Breadcrumb Colors & Typography - */ - if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && $breadcrumb_source && 'yoast-seo-breadcrumbs' == $breadcrumb_source ) { - - /* Yoast SEO Breadcrumb CSS - Desktop */ - $breadcrumbs_desktop = array( - '.ast-breadcrumbs-wrapper a' => array( - 'color' => esc_attr( $breadcrumb_text_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper .breadcrumb_last' => array( - 'color' => esc_attr( $breadcrumb_active_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper span' => array( - 'color' => esc_attr( $breadcrumb_separator_color['desktop'] ), - ), - - '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array( - 'font-family' => astra_get_font_family( $breadcrumb_font_family ), - 'font-weight' => esc_attr( $breadcrumb_font_weight ), - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'desktop' ), - 'line-height' => esc_attr( $breadcrumb_line_height ), - 'text-transform' => esc_attr( $breadcrumb_text_transform ), - ), - ); - - /* Yoast SEO Breadcrumb CSS - Tablet */ - $breadcrumbs_tablet = array( - '.ast-breadcrumbs-wrapper a' => array( - 'color' => esc_attr( $breadcrumb_text_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper .breadcrumb_last' => array( - 'color' => esc_attr( $breadcrumb_active_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper span' => array( - 'color' => esc_attr( $breadcrumb_separator_color['tablet'] ), - ), - - '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array( - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ), - ), - ); - - /* Yoast SEO Breadcrumb CSS - Mobile */ - $breadcrumbs_mobile = array( - '.ast-breadcrumbs-wrapper a' => array( - 'color' => esc_attr( $breadcrumb_text_color['mobile'] ), - ), - '.ast-breadcrumbs-wrapper .breadcrumb_last' => array( - 'color' => esc_attr( $breadcrumb_active_color['mobile'] ), - ), - '.ast-breadcrumbs-wrapper a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['mobile'] ), - ), - '.ast-breadcrumbs-wrapper span' => array( - 'color' => esc_attr( $breadcrumb_separator_color['mobile'] ), - ), - - '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array( - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ), - ), - ); - } elseif ( function_exists( 'bcn_display' ) && $breadcrumb_source && 'breadcrumb-navxt' == $breadcrumb_source ) { - - /* Breadcrumb NavXT CSS - Desktop */ - $breadcrumbs_desktop = array( - '.ast-breadcrumbs-wrapper a' => array( - 'color' => esc_attr( $breadcrumb_text_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper .current-item' => array( - 'color' => esc_attr( $breadcrumb_active_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper .breadcrumbs' => array( - 'color' => esc_attr( $breadcrumb_separator_color['desktop'] ), - ), - - '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array( - 'font-family' => astra_get_font_family( $breadcrumb_font_family ), - 'font-weight' => esc_attr( $breadcrumb_font_weight ), - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'desktop' ), - 'line-height' => esc_attr( $breadcrumb_line_height ), - 'text-transform' => esc_attr( $breadcrumb_text_transform ), - ), - ); - - /* Breadcrumb NavXT CSS - Tablet */ - $breadcrumbs_tablet = array( - '.ast-breadcrumbs-wrapper a' => array( - 'color' => esc_attr( $breadcrumb_text_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper .current-item' => array( - 'color' => esc_attr( $breadcrumb_active_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper .breadcrumbs' => array( - 'color' => esc_attr( $breadcrumb_separator_color['tablet'] ), - ), - - '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array( - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ), - ), - ); - - /* Breadcrumb NavXT CSS - Mobile */ - $breadcrumbs_mobile = array( - '.ast-breadcrumbs-wrapper a' => array( - 'color' => esc_attr( $breadcrumb_text_color['mobile'] ), - ), - '.ast-breadcrumbs-wrapper .current-item' => array( - 'color' => esc_attr( $breadcrumb_active_color['mobile'] ), - ), - '.ast-breadcrumbs-wrapper a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['mobile'] ), - ), - '.ast-breadcrumbs-wrapper .breadcrumbs' => array( - 'color' => esc_attr( $breadcrumb_separator_color['mobile'] ), - ), - - '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array( - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ), - ), - ); - } elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && $breadcrumb_source && 'rank-math' == $breadcrumb_source ) { - - /* Rank Math CSS - Desktop */ - $breadcrumbs_desktop = array( - '.ast-breadcrumbs-wrapper a' => array( - 'color' => esc_attr( $breadcrumb_text_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper .last' => array( - 'color' => esc_attr( $breadcrumb_active_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper .separator' => array( - 'color' => esc_attr( $breadcrumb_separator_color['desktop'] ), - ), - - '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array( - 'font-family' => astra_get_font_family( $breadcrumb_font_family ), - 'font-weight' => esc_attr( $breadcrumb_font_weight ), - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'desktop' ), - 'line-height' => esc_attr( $breadcrumb_line_height ), - 'text-transform' => esc_attr( $breadcrumb_text_transform ), - ), - ); - - /* Rank Math CSS - Tablet */ - $breadcrumbs_tablet = array( - '.ast-breadcrumbs-wrapper a' => array( - 'color' => esc_attr( $breadcrumb_text_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper .last' => array( - 'color' => esc_attr( $breadcrumb_active_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper .separator' => array( - 'color' => esc_attr( $breadcrumb_separator_color['tablet'] ), - ), - - '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array( - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ), - ), - ); - - /* Rank Math CSS - Mobile */ - $breadcrumbs_mobile = array( - '.ast-breadcrumbs-wrapper a' => array( - 'color' => esc_attr( $breadcrumb_text_color['mobile'] ), - ), - '.ast-breadcrumbs-wrapper .last' => array( - 'color' => esc_attr( $breadcrumb_active_color['mobile'] ), - ), - '.ast-breadcrumbs-wrapper a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['mobile'] ), - ), - '.ast-breadcrumbs-wrapper .separator' => array( - 'color' => esc_attr( $breadcrumb_separator_color['mobile'] ), - ), - - '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array( - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ), - ), - ); - } else { - - /* Default Breadcrumb CSS - Desktop */ - $breadcrumbs_desktop = array( - '.ast-breadcrumbs-wrapper .trail-items a' => array( - 'color' => esc_attr( $breadcrumb_text_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper .trail-items .trail-end' => array( - 'color' => esc_attr( $breadcrumb_active_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper .trail-items a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['desktop'] ), - ), - '.ast-breadcrumbs-wrapper .trail-items li::after' => array( - 'color' => esc_attr( $breadcrumb_separator_color['desktop'] ), - ), - - '.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array( - 'font-family' => astra_get_font_family( $breadcrumb_font_family ), - 'font-weight' => esc_attr( $breadcrumb_font_weight ), - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'desktop' ), - 'line-height' => esc_attr( $breadcrumb_line_height ), - 'text-transform' => esc_attr( $breadcrumb_text_transform ), - ), - ); - - /* Default Breadcrumb CSS - Tablet */ - $breadcrumbs_tablet = array( - '.ast-breadcrumbs-wrapper .trail-items a' => array( - 'color' => esc_attr( $breadcrumb_text_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper .trail-items .trail-end' => array( - 'color' => esc_attr( $breadcrumb_active_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper .trail-items a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['tablet'] ), - ), - '.ast-breadcrumbs-wrapper .trail-items li::after' => array( - 'color' => esc_attr( $breadcrumb_separator_color['tablet'] ), - ), - - '.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array( - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ), - ), - ); - - /* Default Breadcrumb CSS - Mobile */ - $breadcrumbs_mobile = array( - '.ast-breadcrumbs-wrapper .trail-items a' => array( - 'color' => esc_attr( $breadcrumb_text_color['mobile'] ), - ), - '.ast-breadcrumbs-wrapper .trail-items .trail-end' => array( - 'color' => esc_attr( $breadcrumb_active_color['mobile'] ), - ), - '.ast-breadcrumbs-wrapper .trail-items a:hover' => array( - 'color' => esc_attr( $breadcrumb_hover_color['mobile'] ), - ), - - '.ast-breadcrumbs-wrapper .trail-items li::after' => array( - 'color' => esc_attr( $breadcrumb_separator_color['mobile'] ), - ), - - '.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array( - 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ), - ), - ); - } - - /* Breadcrumb CSS for Background Color */ - $breadcrumbs_desktop['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array( - 'background-color' => esc_attr( $breadcrumb_bg_color['desktop'] ), - ); - $breadcrumbs_tablet['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array( - 'background-color' => esc_attr( $breadcrumb_bg_color['tablet'] ), - ); - $breadcrumbs_mobile['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array( - 'background-color' => esc_attr( $breadcrumb_bg_color['mobile'] ), - ); - - /* Breadcrumb CSS for Spacing */ - if ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) { - // After Header. - $breadcrumbs_desktop['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array( - 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ), - ); - $breadcrumbs_tablet['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array( - 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ), - ); - $breadcrumbs_mobile['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array( - 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ), - ); - $breadcrumbs_default_css['.ast-header-breadcrumb'] = array( - 'padding-top' => '10px', - 'padding-bottom' => '10px', - ); - } elseif ( 'astra_masthead_content' === $breadcrumb_position ) { - // Inside Header. - $breadcrumbs_desktop['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb'] = array( - 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ), - ); - $breadcrumbs_tablet['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb'] = array( - 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ), - ); - $breadcrumbs_mobile['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb'] = array( - 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ), - ); - $breadcrumbs_default_css['.ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-inner .rank-math-breadcrumb'] = array( - 'padding-bottom' => '10px', - ); - $breadcrumbs_default_css['.ast-header-break-point .ast-breadcrumbs-wrapper'] = array( - 'order' => '4', - ); - } else { - // Before Title. - $breadcrumbs_desktop['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb'] = array( - 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ), - ); - $breadcrumbs_tablet['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb'] = array( - 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ), - ); - $breadcrumbs_mobile['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb'] = array( - 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ), - ); - } - - /* Breadcrumb CSS for Alignment */ - $breadcrumbs_desktop['.ast-breadcrumbs-wrapper'] = array( - 'text-align' => esc_attr( $breadcrumb_alignment ), - ); - - $css .= astra_parse_css( $breadcrumbs_desktop ); - $css .= astra_parse_css( $breadcrumbs_tablet, '', astra_get_tablet_breakpoint() ); - $css .= astra_parse_css( $breadcrumbs_mobile, '', astra_get_mobile_breakpoint() ); - $css .= astra_parse_css( $breadcrumbs_default_css ); - - /* Breadcrumb default CSS */ - $css .= astra_parse_css( - array( - '.ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar.ast-header-breadcrumb' => array( - 'padding-top' => '1em', - 'padding-bottom' => '1em', - ), - ), - '', - '' - ); - - $css .= astra_parse_css( - array( - '.ast-header-break-point .main-header-bar.ast-header-breadcrumb' => array( - 'border-bottom-width' => '1px', - 'border-bottom-color' => '#eaeaea', - 'border-bottom-style' => 'solid', - ), - ), - '', - '' - ); - - $css .= astra_parse_css( - array( - '.ast-breadcrumbs-wrapper' => array( - 'line-height' => '1.4', - ), - ), - '', - '' - ); - - $css .= astra_parse_css( - array( - '.ast-breadcrumbs-wrapper .rank-math-breadcrumb p' => array( - 'margin-bottom' => '0px', - ), - ), - '', - '' - ); - - $css .= astra_parse_css( - array( - '.ast-breadcrumbs-wrapper' => array( - 'display' => 'block', - 'width' => '100%', - ), - ), - '', - '' - ); - - $dynamic_css .= $css; - - return $dynamic_css; -} + array( + 'display' => 'inline-block', + 'margin' => '0', + 'padding' => '0', + 'border' => 'none', + 'background' => 'inherit', + 'text-indent' => '0', + ), + '.ast-breadcrumbs .trail-browse' => array( + 'font-size' => 'inherit', + 'font-style' => 'inherit', + 'font-weight' => 'inherit', + 'color' => 'inherit', + ), + '.ast-breadcrumbs .trail-items' => array( + 'list-style' => 'none', + ), + '.trail-items li::after' => array( + 'padding' => '0 0.3em', + 'content' => '"\00bb"', + ), + '.trail-items li:last-of-type::after' => array( + 'display' => 'none', + ), + ), + '', + '' + ); + + if ( 'none' === $breadcrumb_position ) { + return $dynamic_css; + } + + /** + * Set CSS Params + */ + + $default_color_array = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $breadcrumb_text_color = astra_get_option( 'breadcrumb-text-color-responsive', $default_color_array ); + $breadcrumb_active_color = astra_get_option( 'breadcrumb-active-color-responsive', $default_color_array ); + $breadcrumb_hover_color = astra_get_option( 'breadcrumb-hover-color-responsive', $default_color_array ); + $breadcrumb_separator_color = astra_get_option( 'breadcrumb-separator-color', $default_color_array ); + $breadcrumb_bg_color = astra_get_option( 'breadcrumb-bg-color', $default_color_array ); + + $breadcrumb_font_family = astra_get_option( 'breadcrumb-font-family' ); + $breadcrumb_font_weight = astra_get_option( 'breadcrumb-font-weight' ); + $breadcrumb_font_size = astra_get_option( 'breadcrumb-font-size' ); + $breadcrumb_line_height = astra_get_option( 'breadcrumb-line-height' ); + $breadcrumb_text_transform = astra_get_option( 'breadcrumb-text-transform' ); + + $breadcrumb_spacing = astra_get_option( 'breadcrumb-spacing' ); + + $breadcrumb_alignment = astra_get_option( 'breadcrumb-alignment' ); + + /** + * Generate dynamic CSS based on the Breadcrumb Source option selected from the customizer. + */ + $breadcrumb_source = astra_get_option( 'select-breadcrumb-source' ); + + /** + * Generate Dynamic CSS + */ + + $css = ''; + $breadcrumbs_default_css = array(); + $breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false; + $wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable; + if ( ! is_array( $wpseo_option ) ) { + unset( $wpseo_option ); + $wpseo_option = array( + 'breadcrumbs-enable' => $breadcrumb_enable, + ); + } + + $css .= astra_parse_css( + array( + '.trail-items li::after' => array( + 'content' => '"' . astra_get_option( 'breadcrumb-separator', '\00bb' ) . '"', + ), + ), + '', + '' + ); + + /** + * Breadcrumb Colors & Typography + */ + if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && $breadcrumb_source && 'yoast-seo-breadcrumbs' == $breadcrumb_source ) { + + /* Yoast SEO Breadcrumb CSS - Desktop */ + $breadcrumbs_desktop = array( + '.ast-breadcrumbs-wrapper a' => array( + 'color' => esc_attr( $breadcrumb_text_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper .breadcrumb_last' => array( + 'color' => esc_attr( $breadcrumb_active_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper span' => array( + 'color' => esc_attr( $breadcrumb_separator_color['desktop'] ), + ), + + '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array( + 'font-family' => astra_get_font_family( $breadcrumb_font_family ), + 'font-weight' => esc_attr( $breadcrumb_font_weight ), + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'desktop' ), + 'line-height' => esc_attr( $breadcrumb_line_height ), + 'text-transform' => esc_attr( $breadcrumb_text_transform ), + ), + ); + + /* Yoast SEO Breadcrumb CSS - Tablet */ + $breadcrumbs_tablet = array( + '.ast-breadcrumbs-wrapper a' => array( + 'color' => esc_attr( $breadcrumb_text_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper .breadcrumb_last' => array( + 'color' => esc_attr( $breadcrumb_active_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper span' => array( + 'color' => esc_attr( $breadcrumb_separator_color['tablet'] ), + ), + + '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array( + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ), + ), + ); + + /* Yoast SEO Breadcrumb CSS - Mobile */ + $breadcrumbs_mobile = array( + '.ast-breadcrumbs-wrapper a' => array( + 'color' => esc_attr( $breadcrumb_text_color['mobile'] ), + ), + '.ast-breadcrumbs-wrapper .breadcrumb_last' => array( + 'color' => esc_attr( $breadcrumb_active_color['mobile'] ), + ), + '.ast-breadcrumbs-wrapper a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['mobile'] ), + ), + '.ast-breadcrumbs-wrapper span' => array( + 'color' => esc_attr( $breadcrumb_separator_color['mobile'] ), + ), + + '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array( + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ), + ), + ); + } elseif ( function_exists( 'bcn_display' ) && $breadcrumb_source && 'breadcrumb-navxt' == $breadcrumb_source ) { + + /* Breadcrumb NavXT CSS - Desktop */ + $breadcrumbs_desktop = array( + '.ast-breadcrumbs-wrapper a' => array( + 'color' => esc_attr( $breadcrumb_text_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper .current-item' => array( + 'color' => esc_attr( $breadcrumb_active_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper .breadcrumbs' => array( + 'color' => esc_attr( $breadcrumb_separator_color['desktop'] ), + ), + + '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array( + 'font-family' => astra_get_font_family( $breadcrumb_font_family ), + 'font-weight' => esc_attr( $breadcrumb_font_weight ), + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'desktop' ), + 'line-height' => esc_attr( $breadcrumb_line_height ), + 'text-transform' => esc_attr( $breadcrumb_text_transform ), + ), + ); + + /* Breadcrumb NavXT CSS - Tablet */ + $breadcrumbs_tablet = array( + '.ast-breadcrumbs-wrapper a' => array( + 'color' => esc_attr( $breadcrumb_text_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper .current-item' => array( + 'color' => esc_attr( $breadcrumb_active_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper .breadcrumbs' => array( + 'color' => esc_attr( $breadcrumb_separator_color['tablet'] ), + ), + + '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array( + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ), + ), + ); + + /* Breadcrumb NavXT CSS - Mobile */ + $breadcrumbs_mobile = array( + '.ast-breadcrumbs-wrapper a' => array( + 'color' => esc_attr( $breadcrumb_text_color['mobile'] ), + ), + '.ast-breadcrumbs-wrapper .current-item' => array( + 'color' => esc_attr( $breadcrumb_active_color['mobile'] ), + ), + '.ast-breadcrumbs-wrapper a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['mobile'] ), + ), + '.ast-breadcrumbs-wrapper .breadcrumbs' => array( + 'color' => esc_attr( $breadcrumb_separator_color['mobile'] ), + ), + + '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array( + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ), + ), + ); + } elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && $breadcrumb_source && 'rank-math' == $breadcrumb_source ) { + + /* Rank Math CSS - Desktop */ + $breadcrumbs_desktop = array( + '.ast-breadcrumbs-wrapper a' => array( + 'color' => esc_attr( $breadcrumb_text_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper .last' => array( + 'color' => esc_attr( $breadcrumb_active_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper .separator' => array( + 'color' => esc_attr( $breadcrumb_separator_color['desktop'] ), + ), + + '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array( + 'font-family' => astra_get_font_family( $breadcrumb_font_family ), + 'font-weight' => esc_attr( $breadcrumb_font_weight ), + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'desktop' ), + 'line-height' => esc_attr( $breadcrumb_line_height ), + 'text-transform' => esc_attr( $breadcrumb_text_transform ), + ), + ); + + /* Rank Math CSS - Tablet */ + $breadcrumbs_tablet = array( + '.ast-breadcrumbs-wrapper a' => array( + 'color' => esc_attr( $breadcrumb_text_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper .last' => array( + 'color' => esc_attr( $breadcrumb_active_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper .separator' => array( + 'color' => esc_attr( $breadcrumb_separator_color['tablet'] ), + ), + + '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array( + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ), + ), + ); + + /* Rank Math CSS - Mobile */ + $breadcrumbs_mobile = array( + '.ast-breadcrumbs-wrapper a' => array( + 'color' => esc_attr( $breadcrumb_text_color['mobile'] ), + ), + '.ast-breadcrumbs-wrapper .last' => array( + 'color' => esc_attr( $breadcrumb_active_color['mobile'] ), + ), + '.ast-breadcrumbs-wrapper a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['mobile'] ), + ), + '.ast-breadcrumbs-wrapper .separator' => array( + 'color' => esc_attr( $breadcrumb_separator_color['mobile'] ), + ), + + '.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array( + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ), + ), + ); + } else { + + /* Default Breadcrumb CSS - Desktop */ + $breadcrumbs_desktop = array( + '.ast-breadcrumbs-wrapper .trail-items a' => array( + 'color' => esc_attr( $breadcrumb_text_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper .trail-items .trail-end' => array( + 'color' => esc_attr( $breadcrumb_active_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper .trail-items a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['desktop'] ), + ), + '.ast-breadcrumbs-wrapper .trail-items li::after' => array( + 'color' => esc_attr( $breadcrumb_separator_color['desktop'] ), + ), + + '.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array( + 'font-family' => astra_get_font_family( $breadcrumb_font_family ), + 'font-weight' => esc_attr( $breadcrumb_font_weight ), + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'desktop' ), + 'line-height' => esc_attr( $breadcrumb_line_height ), + 'text-transform' => esc_attr( $breadcrumb_text_transform ), + ), + ); + + /* Default Breadcrumb CSS - Tablet */ + $breadcrumbs_tablet = array( + '.ast-breadcrumbs-wrapper .trail-items a' => array( + 'color' => esc_attr( $breadcrumb_text_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper .trail-items .trail-end' => array( + 'color' => esc_attr( $breadcrumb_active_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper .trail-items a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['tablet'] ), + ), + '.ast-breadcrumbs-wrapper .trail-items li::after' => array( + 'color' => esc_attr( $breadcrumb_separator_color['tablet'] ), + ), + + '.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array( + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ), + ), + ); + + /* Default Breadcrumb CSS - Mobile */ + $breadcrumbs_mobile = array( + '.ast-breadcrumbs-wrapper .trail-items a' => array( + 'color' => esc_attr( $breadcrumb_text_color['mobile'] ), + ), + '.ast-breadcrumbs-wrapper .trail-items .trail-end' => array( + 'color' => esc_attr( $breadcrumb_active_color['mobile'] ), + ), + '.ast-breadcrumbs-wrapper .trail-items a:hover' => array( + 'color' => esc_attr( $breadcrumb_hover_color['mobile'] ), + ), + + '.ast-breadcrumbs-wrapper .trail-items li::after' => array( + 'color' => esc_attr( $breadcrumb_separator_color['mobile'] ), + ), + + '.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array( + 'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ), + ), + ); + } + + /* Breadcrumb CSS for Background Color */ + $breadcrumbs_desktop['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array( + 'background-color' => esc_attr( $breadcrumb_bg_color['desktop'] ), + ); + $breadcrumbs_tablet['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array( + 'background-color' => esc_attr( $breadcrumb_bg_color['tablet'] ), + ); + $breadcrumbs_mobile['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array( + 'background-color' => esc_attr( $breadcrumb_bg_color['mobile'] ), + ); + + /* Breadcrumb CSS for Spacing */ + if ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) { + // After Header. + $breadcrumbs_desktop['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array( + 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ), + ); + $breadcrumbs_tablet['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array( + 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ), + ); + $breadcrumbs_mobile['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array( + 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ), + ); + $breadcrumbs_default_css['.ast-header-breadcrumb'] = array( + 'padding-top' => '10px', + 'padding-bottom' => '10px', + ); + } elseif ( 'astra_masthead_content' === $breadcrumb_position ) { + // Inside Header. + $breadcrumbs_desktop['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb'] = array( + 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ), + ); + $breadcrumbs_tablet['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb'] = array( + 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ), + ); + $breadcrumbs_mobile['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb'] = array( + 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ), + ); + $breadcrumbs_default_css['.ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-inner .rank-math-breadcrumb'] = array( + 'padding-bottom' => '10px', + ); + $breadcrumbs_default_css['.ast-header-break-point .ast-breadcrumbs-wrapper'] = array( + 'order' => '4', + ); + } else { + // Before Title. + $breadcrumbs_desktop['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb'] = array( + 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ), + ); + $breadcrumbs_tablet['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb'] = array( + 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ), + ); + $breadcrumbs_mobile['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb'] = array( + 'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ), + ); + } + + /* Breadcrumb CSS for Alignment */ + $breadcrumbs_desktop['.ast-breadcrumbs-wrapper'] = array( + 'text-align' => esc_attr( $breadcrumb_alignment ), + ); + + $css .= astra_parse_css( $breadcrumbs_desktop ); + $css .= astra_parse_css( $breadcrumbs_tablet, '', astra_get_tablet_breakpoint() ); + $css .= astra_parse_css( $breadcrumbs_mobile, '', astra_get_mobile_breakpoint() ); + $css .= astra_parse_css( $breadcrumbs_default_css ); + + /* Breadcrumb default CSS */ + $css .= astra_parse_css( + array( + '.ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar.ast-header-breadcrumb' => array( + 'padding-top' => '1em', + 'padding-bottom' => '1em', + ), + ), + '', + '' + ); + + $css .= astra_parse_css( + array( + '.ast-header-break-point .main-header-bar.ast-header-breadcrumb' => array( + 'border-bottom-width' => '1px', + 'border-bottom-color' => '#eaeaea', + 'border-bottom-style' => 'solid', + ), + ), + '', + '' + ); + + $css .= astra_parse_css( + array( + '.ast-breadcrumbs-wrapper' => array( + 'line-height' => '1.4', + ), + ), + '', + '' + ); + + $css .= astra_parse_css( + array( + '.ast-breadcrumbs-wrapper .rank-math-breadcrumb p' => array( + 'margin-bottom' => '0px', + ), + ), + '', + '' + ); + + $css .= astra_parse_css( + array( + '.ast-breadcrumbs-wrapper' => array( + 'display' => 'block', + 'width' => '100%', + ), + ), + '', + '' + ); + + $dynamic_css .= $css; + + return $dynamic_css; +} diff --git a/inc/addons/heading-colors/class-astra-heading-colors-loader.php b/inc/addons/heading-colors/class-astra-heading-colors-loader.php index 3a27549..666631d 100644 --- a/inc/addons/heading-colors/class-astra-heading-colors-loader.php +++ b/inc/addons/heading-colors/class-astra-heading-colors-loader.php @@ -1,161 +1,161 @@ - to
- */ - $defaults['h1-color'] = ''; - $defaults['h2-color'] = ''; - $defaults['h3-color'] = ''; - $defaults['h4-color'] = ''; - $defaults['h5-color'] = ''; - $defaults['h6-color'] = ''; - - // Header

. - $defaults['font-family-h1'] = 'inherit'; - $defaults['font-weight-h1'] = 'inherit'; - $defaults['text-transform-h1'] = ''; - $defaults['line-height-h1'] = ''; - - // Header

. - $defaults['font-family-h2'] = 'inherit'; - $defaults['font-weight-h2'] = 'inherit'; - $defaults['text-transform-h2'] = ''; - $defaults['line-height-h2'] = ''; - - // Header

. - $defaults['font-family-h3'] = 'inherit'; - $defaults['font-weight-h3'] = 'inherit'; - $defaults['text-transform-h3'] = ''; - $defaults['line-height-h3'] = ''; - - /** - * Theme button Font Defaults - */ - $defaults['font-weight-button'] = 'inherit'; - $defaults['font-family-button'] = 'inherit'; - $defaults['font-size-button'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ); - $defaults['text-transform-button'] = ''; - - /** - * Check backward compatibility for button line height. - */ - $defaults['theme-btn-line-height'] = 1; - $defaults['theme-btn-letter-spacing'] = ''; - - return $defaults; - } - - /** - * Load color configs for the Heading Colors. - * - * @param WP_Customize_Manager $wp_customize Theme Customizer object. - * - * @since 2.2.0 - */ - public function customize_register( $wp_customize ) { - - /** - * Register Panel & Sections - */ - require_once ASTRA_THEME_HEADING_COLORS_DIR . 'customizer/class-astra-heading-colors-configs.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - } - - /** - * Customizer Preview - * - * @since 2.2.0 - */ - public function preview_scripts() { - /** - * Load unminified if SCRIPT_DEBUG is true. - */ - /* Directory and Extension */ - $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; - $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; - wp_enqueue_script( 'astra-heading-colors-customizer-preview-js', ASTRA_THEME_HEADING_COLORS_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); - } -} - -/** -* Kicking this off by creating the object of the class. -*/ -new Astra_Heading_Colors_Loader(); + to

+ */ + $defaults['h1-color'] = ''; + $defaults['h2-color'] = ''; + $defaults['h3-color'] = ''; + $defaults['h4-color'] = ''; + $defaults['h5-color'] = ''; + $defaults['h6-color'] = ''; + + // Header

. + $defaults['font-family-h1'] = 'inherit'; + $defaults['font-weight-h1'] = 'inherit'; + $defaults['text-transform-h1'] = ''; + $defaults['line-height-h1'] = ''; + + // Header

. + $defaults['font-family-h2'] = 'inherit'; + $defaults['font-weight-h2'] = 'inherit'; + $defaults['text-transform-h2'] = ''; + $defaults['line-height-h2'] = ''; + + // Header

. + $defaults['font-family-h3'] = 'inherit'; + $defaults['font-weight-h3'] = 'inherit'; + $defaults['text-transform-h3'] = ''; + $defaults['line-height-h3'] = ''; + + /** + * Theme button Font Defaults + */ + $defaults['font-weight-button'] = 'inherit'; + $defaults['font-family-button'] = 'inherit'; + $defaults['font-size-button'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ); + $defaults['text-transform-button'] = ''; + + /** + * Check backward compatibility for button line height. + */ + $defaults['theme-btn-line-height'] = 1; + $defaults['theme-btn-letter-spacing'] = ''; + + return $defaults; + } + + /** + * Load color configs for the Heading Colors. + * + * @param WP_Customize_Manager $wp_customize Theme Customizer object. + * + * @since 2.2.0 + */ + public function customize_register( $wp_customize ) { + + /** + * Register Panel & Sections + */ + require_once ASTRA_THEME_HEADING_COLORS_DIR . 'customizer/class-astra-heading-colors-configs.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + } + + /** + * Customizer Preview + * + * @since 2.2.0 + */ + public function preview_scripts() { + /** + * Load unminified if SCRIPT_DEBUG is true. + */ + /* Directory and Extension */ + $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; + $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; + wp_enqueue_script( 'astra-heading-colors-customizer-preview-js', ASTRA_THEME_HEADING_COLORS_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); + } +} + +/** +* Kicking this off by creating the object of the class. +*/ +new Astra_Heading_Colors_Loader(); diff --git a/inc/addons/heading-colors/class-astra-heading-colors.php b/inc/addons/heading-colors/class-astra-heading-colors.php index 7de04b8..01fe4db 100644 --- a/inc/addons/heading-colors/class-astra-heading-colors.php +++ b/inc/addons/heading-colors/class-astra-heading-colors.php @@ -1,47 +1,47 @@ - astra_get_option( 'heading-base-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'transport' => 'postMessage', - 'priority' => 18, - 'name' => ASTRA_THEME_SETTINGS . '[heading-base-color]', - 'title' => __( 'Heading Color ( H1 - H6 )', 'astra' ), - 'section' => ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) ) ? 'section-colors-body' : 'section-colors-background', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Heading Typography starts here - h1 - h3 - */ - - /** - * Option: Heading

Font Family - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-family-h1]', - 'type' => 'control', - 'control' => 'ast-font', - 'font-type' => 'ast-font-family', - 'default' => astra_get_option( 'font-family-h1' ), - 'title' => __( 'Family', 'astra' ), - 'section' => 'section-content-typo', - 'priority' => 5, - 'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h1]', - 'transport' => 'postMessage', - ), - - /** - * Option: Heading

Font Weight - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-weight-h1]', - 'type' => 'control', - 'control' => 'ast-font', - 'font-type' => 'ast-font-weight', - 'title' => __( 'Weight', 'astra' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), - 'default' => astra_get_option( 'font-weight-h1' ), - 'section' => 'section-content-typo', - 'priority' => 7, - 'connect' => ASTRA_THEME_SETTINGS . '[font-family-h1]', - 'transport' => 'postMessage', - ), - - /** - * Option: Heading

Text Transform - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[text-transform-h1]', - 'section' => 'section-content-typo', - 'default' => astra_get_option( 'text-transform-h1' ), - 'title' => __( 'Text Transform', 'astra' ), - 'type' => 'control', - 'control' => 'ast-select', - 'priority' => 8, - 'choices' => array( - '' => __( 'Inherit', 'astra' ), - 'none' => __( 'None', 'astra' ), - 'capitalize' => __( 'Capitalize', 'astra' ), - 'uppercase' => __( 'Uppercase', 'astra' ), - 'lowercase' => __( 'Lowercase', 'astra' ), - ), - 'transport' => 'postMessage', - ), - - /** - * Option: Heading

Line Height - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[line-height-h1]', - 'section' => 'section-content-typo', - 'default' => astra_get_option( 'line-height-h1' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'type' => 'control', - 'control' => 'ast-slider', - 'title' => __( 'Line Height', 'astra' ), - 'transport' => 'postMessage', - 'priority' => 8, - 'suffix' => 'em', - 'input_attrs' => array( - 'min' => 1, - 'step' => 0.01, - 'max' => 5, - ), - ), - - /** - * Option: Heading

Font Family - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-family-h2]', - 'type' => 'control', - 'control' => 'ast-font', - 'font-type' => 'ast-font-family', - 'title' => __( 'Family', 'astra' ), - 'default' => astra_get_option( 'font-family-h2' ), - 'section' => 'section-content-typo', - 'priority' => 10, - 'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h2]', - 'transport' => 'postMessage', - ), - - /** - * Option: Heading

Font Weight - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-weight-h2]', - 'type' => 'control', - 'control' => 'ast-font', - 'font-type' => 'ast-font-weight', - 'title' => __( 'Weight', 'astra' ), - 'section' => 'section-content-typo', - 'default' => astra_get_option( 'font-weight-h2' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), - 'priority' => 12, - 'connect' => ASTRA_THEME_SETTINGS . '[font-family-h2]', - 'transport' => 'postMessage', - ), - - /** - * Option: Heading

Text Transform - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[text-transform-h2]', - 'section' => 'section-content-typo', - 'default' => astra_get_option( 'text-transform-h2' ), - 'title' => __( 'Text Transform', 'astra' ), - 'type' => 'control', - 'control' => 'ast-select', - 'transport' => 'postMessage', - 'priority' => 13, - 'choices' => array( - '' => __( 'Inherit', 'astra' ), - 'none' => __( 'None', 'astra' ), - 'capitalize' => __( 'Capitalize', 'astra' ), - 'uppercase' => __( 'Uppercase', 'astra' ), - 'lowercase' => __( 'Lowercase', 'astra' ), - ), - 'transport' => 'postMessage', - ), - - /** - * Option: Heading

Line Height - */ - - array( - 'name' => ASTRA_THEME_SETTINGS . '[line-height-h2]', - 'section' => 'section-content-typo', - 'type' => 'control', - 'control' => 'ast-slider', - 'default' => astra_get_option( 'line-height-h2' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'transport' => 'postMessage', - 'title' => __( 'Line Height', 'astra' ), - 'priority' => 14, - 'suffix' => 'em', - 'input_attrs' => array( - 'min' => 1, - 'step' => 0.01, - 'max' => 5, - ), - ), - - /** - * Option: Heading

Font Family - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-family-h3]', - 'type' => 'control', - 'control' => 'ast-font', - 'font-type' => 'ast-font-family', - 'default' => astra_get_option( 'font-family-h3' ), - 'title' => __( 'Family', 'astra' ), - 'section' => 'section-content-typo', - 'priority' => 15, - 'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h3]', - 'transport' => 'postMessage', - ), - - /** - * Option: Heading

Font Weight - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-weight-h3]', - 'type' => 'control', - 'control' => 'ast-font', - 'font-type' => 'ast-font-weight', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), - 'default' => astra_get_option( 'font-weight-h3' ), - 'title' => __( 'Weight', 'astra' ), - 'section' => 'section-content-typo', - 'priority' => 17, - 'connect' => ASTRA_THEME_SETTINGS . '[font-family-h3]', - 'transport' => 'postMessage', - ), - - /** - * Option: Heading

Text Transform - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[text-transform-h3]', - 'type' => 'control', - 'section' => 'section-content-typo', - 'title' => __( 'Text Transform', 'astra' ), - 'default' => astra_get_option( 'text-transform-h3' ), - 'transport' => 'postMessage', - 'control' => 'ast-select', - 'priority' => 18, - 'choices' => array( - '' => __( 'Inherit', 'astra' ), - 'none' => __( 'None', 'astra' ), - 'capitalize' => __( 'Capitalize', 'astra' ), - 'uppercase' => __( 'Uppercase', 'astra' ), - 'lowercase' => __( 'Lowercase', 'astra' ), - ), - 'transport' => 'postMessage', - ), - - /** - * Option: Heading

Line Height - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[line-height-h3]', - 'type' => 'control', - 'control' => 'ast-slider', - 'section' => 'section-content-typo', - 'title' => __( 'Line Height', 'astra' ), - 'transport' => 'postMessage', - 'default' => astra_get_option( 'line-height-h3' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'priority' => 19, - 'suffix' => 'em', - 'input_attrs' => array( - 'min' => 1, - 'step' => 0.01, - 'max' => 5, - ), - ), - - - /** - * Option: Button Typography Heading - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[button-text-typography]', - 'default' => astra_get_option( 'button-text-typography' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Button Font', 'astra' ), - 'section' => 'section-buttons', - 'transport' => 'postMessage', - 'priority' => 25, - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Button Font Family - */ - array( - 'name' => 'font-family-button', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', - 'section' => 'section-buttons', - 'control' => 'ast-font', - 'font_type' => 'ast-font-family', - 'title' => __( 'Family', 'astra' ), - 'default' => astra_get_option( 'font-family-button' ), - 'connect' => ASTRA_THEME_SETTINGS . '[font-weight-button]', - 'priority' => 1, - ), - - /** - * Option: Button Font Size - */ - array( - 'name' => 'font-size-button', - 'transport' => 'postMessage', - 'title' => __( 'Size', 'astra' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', - 'section' => 'section-buttons', - 'control' => 'ast-responsive', - 'priority' => 2, - 'default' => astra_get_option( 'font-size-button' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - - /** - * Option: Button Font Weight - */ - array( - 'name' => 'font-weight-button', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', - 'section' => 'section-buttons', - 'control' => 'ast-font', - 'font_type' => 'ast-font-weight', - 'title' => __( 'Weight', 'astra' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), - 'default' => astra_get_option( 'font-weight-button' ), - 'connect' => 'font-family-button', - 'priority' => 3, - ), - - /** - * Option: Button Text Transform - */ - array( - 'name' => 'text-transform-button', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'text-transform-button' ), - 'title' => __( 'Text Transform', 'astra' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', - 'section' => 'section-buttons', - 'control' => 'ast-select', - 'priority' => 4, - 'choices' => array( - '' => __( 'Inherit', 'astra' ), - 'none' => __( 'None', 'astra' ), - 'capitalize' => __( 'Capitalize', 'astra' ), - 'uppercase' => __( 'Uppercase', 'astra' ), - 'lowercase' => __( 'Lowercase', 'astra' ), - ), - ), - - /** - * Option: Theme Button Line Height - */ - array( - 'name' => 'theme-btn-line-height', - 'control' => 'ast-slider', - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'default' => astra_get_option( 'theme-btn-line-height' ), - 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', - 'section' => 'section-buttons', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'title' => __( 'Line Height', 'astra' ), - 'suffix' => 'em', - 'priority' => 5, - 'input_attrs' => array( - 'min' => 1, - 'step' => 0.01, - 'max' => 5, - ), - ), - - /** - * Option: Theme Button Line Height - */ - array( - 'name' => 'theme-btn-letter-spacing', - 'control' => 'ast-slider', - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'default' => astra_get_option( 'theme-btn-letter-spacing' ), - 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', - 'section' => 'section-buttons', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'title' => __( 'Letter Spacing', 'astra' ), - 'suffix' => 'px', - 'priority' => 6, - 'input_attrs' => array( - 'min' => 1, - 'step' => 1, - 'max' => 100, - ), - ), - - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Heading_Colors_Configs(); + astra_get_option( 'heading-base-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'transport' => 'postMessage', + 'priority' => 18, + 'name' => ASTRA_THEME_SETTINGS . '[heading-base-color]', + 'title' => __( 'Heading Color ( H1 - H6 )', 'astra' ), + 'section' => ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) ) ? 'section-colors-body' : 'section-colors-background', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Heading Typography starts here - h1 - h3 + */ + + /** + * Option: Heading

Font Family + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-family-h1]', + 'type' => 'control', + 'control' => 'ast-font', + 'font-type' => 'ast-font-family', + 'default' => astra_get_option( 'font-family-h1' ), + 'title' => __( 'Family', 'astra' ), + 'section' => 'section-content-typo', + 'priority' => 5, + 'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h1]', + 'transport' => 'postMessage', + ), + + /** + * Option: Heading

Font Weight + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-weight-h1]', + 'type' => 'control', + 'control' => 'ast-font', + 'font-type' => 'ast-font-weight', + 'title' => __( 'Weight', 'astra' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), + 'default' => astra_get_option( 'font-weight-h1' ), + 'section' => 'section-content-typo', + 'priority' => 7, + 'connect' => ASTRA_THEME_SETTINGS . '[font-family-h1]', + 'transport' => 'postMessage', + ), + + /** + * Option: Heading

Text Transform + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[text-transform-h1]', + 'section' => 'section-content-typo', + 'default' => astra_get_option( 'text-transform-h1' ), + 'title' => __( 'Text Transform', 'astra' ), + 'type' => 'control', + 'control' => 'ast-select', + 'priority' => 8, + 'choices' => array( + '' => __( 'Inherit', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + 'transport' => 'postMessage', + ), + + /** + * Option: Heading

Line Height + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[line-height-h1]', + 'section' => 'section-content-typo', + 'default' => astra_get_option( 'line-height-h1' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'type' => 'control', + 'control' => 'ast-slider', + 'title' => __( 'Line Height', 'astra' ), + 'transport' => 'postMessage', + 'priority' => 8, + 'suffix' => 'em', + 'input_attrs' => array( + 'min' => 1, + 'step' => 0.01, + 'max' => 5, + ), + ), + + /** + * Option: Heading

Font Family + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-family-h2]', + 'type' => 'control', + 'control' => 'ast-font', + 'font-type' => 'ast-font-family', + 'title' => __( 'Family', 'astra' ), + 'default' => astra_get_option( 'font-family-h2' ), + 'section' => 'section-content-typo', + 'priority' => 10, + 'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h2]', + 'transport' => 'postMessage', + ), + + /** + * Option: Heading

Font Weight + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-weight-h2]', + 'type' => 'control', + 'control' => 'ast-font', + 'font-type' => 'ast-font-weight', + 'title' => __( 'Weight', 'astra' ), + 'section' => 'section-content-typo', + 'default' => astra_get_option( 'font-weight-h2' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), + 'priority' => 12, + 'connect' => ASTRA_THEME_SETTINGS . '[font-family-h2]', + 'transport' => 'postMessage', + ), + + /** + * Option: Heading

Text Transform + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[text-transform-h2]', + 'section' => 'section-content-typo', + 'default' => astra_get_option( 'text-transform-h2' ), + 'title' => __( 'Text Transform', 'astra' ), + 'type' => 'control', + 'control' => 'ast-select', + 'transport' => 'postMessage', + 'priority' => 13, + 'choices' => array( + '' => __( 'Inherit', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + 'transport' => 'postMessage', + ), + + /** + * Option: Heading

Line Height + */ + + array( + 'name' => ASTRA_THEME_SETTINGS . '[line-height-h2]', + 'section' => 'section-content-typo', + 'type' => 'control', + 'control' => 'ast-slider', + 'default' => astra_get_option( 'line-height-h2' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'transport' => 'postMessage', + 'title' => __( 'Line Height', 'astra' ), + 'priority' => 14, + 'suffix' => 'em', + 'input_attrs' => array( + 'min' => 1, + 'step' => 0.01, + 'max' => 5, + ), + ), + + /** + * Option: Heading

Font Family + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-family-h3]', + 'type' => 'control', + 'control' => 'ast-font', + 'font-type' => 'ast-font-family', + 'default' => astra_get_option( 'font-family-h3' ), + 'title' => __( 'Family', 'astra' ), + 'section' => 'section-content-typo', + 'priority' => 15, + 'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h3]', + 'transport' => 'postMessage', + ), + + /** + * Option: Heading

Font Weight + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-weight-h3]', + 'type' => 'control', + 'control' => 'ast-font', + 'font-type' => 'ast-font-weight', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), + 'default' => astra_get_option( 'font-weight-h3' ), + 'title' => __( 'Weight', 'astra' ), + 'section' => 'section-content-typo', + 'priority' => 17, + 'connect' => ASTRA_THEME_SETTINGS . '[font-family-h3]', + 'transport' => 'postMessage', + ), + + /** + * Option: Heading

Text Transform + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[text-transform-h3]', + 'type' => 'control', + 'section' => 'section-content-typo', + 'title' => __( 'Text Transform', 'astra' ), + 'default' => astra_get_option( 'text-transform-h3' ), + 'transport' => 'postMessage', + 'control' => 'ast-select', + 'priority' => 18, + 'choices' => array( + '' => __( 'Inherit', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + 'transport' => 'postMessage', + ), + + /** + * Option: Heading

Line Height + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[line-height-h3]', + 'type' => 'control', + 'control' => 'ast-slider', + 'section' => 'section-content-typo', + 'title' => __( 'Line Height', 'astra' ), + 'transport' => 'postMessage', + 'default' => astra_get_option( 'line-height-h3' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'priority' => 19, + 'suffix' => 'em', + 'input_attrs' => array( + 'min' => 1, + 'step' => 0.01, + 'max' => 5, + ), + ), + + + /** + * Option: Button Typography Heading + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[button-text-typography]', + 'default' => astra_get_option( 'button-text-typography' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Button Font', 'astra' ), + 'section' => 'section-buttons', + 'transport' => 'postMessage', + 'priority' => 25, + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Button Font Family + */ + array( + 'name' => 'font-family-button', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', + 'section' => 'section-buttons', + 'control' => 'ast-font', + 'font_type' => 'ast-font-family', + 'title' => __( 'Family', 'astra' ), + 'default' => astra_get_option( 'font-family-button' ), + 'connect' => ASTRA_THEME_SETTINGS . '[font-weight-button]', + 'priority' => 1, + ), + + /** + * Option: Button Font Size + */ + array( + 'name' => 'font-size-button', + 'transport' => 'postMessage', + 'title' => __( 'Size', 'astra' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', + 'section' => 'section-buttons', + 'control' => 'ast-responsive', + 'priority' => 2, + 'default' => astra_get_option( 'font-size-button' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Button Font Weight + */ + array( + 'name' => 'font-weight-button', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', + 'section' => 'section-buttons', + 'control' => 'ast-font', + 'font_type' => 'ast-font-weight', + 'title' => __( 'Weight', 'astra' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), + 'default' => astra_get_option( 'font-weight-button' ), + 'connect' => 'font-family-button', + 'priority' => 3, + ), + + /** + * Option: Button Text Transform + */ + array( + 'name' => 'text-transform-button', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'text-transform-button' ), + 'title' => __( 'Text Transform', 'astra' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', + 'section' => 'section-buttons', + 'control' => 'ast-select', + 'priority' => 4, + 'choices' => array( + '' => __( 'Inherit', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + ), + + /** + * Option: Theme Button Line Height + */ + array( + 'name' => 'theme-btn-line-height', + 'control' => 'ast-slider', + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'default' => astra_get_option( 'theme-btn-line-height' ), + 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', + 'section' => 'section-buttons', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'title' => __( 'Line Height', 'astra' ), + 'suffix' => 'em', + 'priority' => 5, + 'input_attrs' => array( + 'min' => 1, + 'step' => 0.01, + 'max' => 5, + ), + ), + + /** + * Option: Theme Button Line Height + */ + array( + 'name' => 'theme-btn-letter-spacing', + 'control' => 'ast-slider', + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'default' => astra_get_option( 'theme-btn-letter-spacing' ), + 'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]', + 'section' => 'section-buttons', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'title' => __( 'Letter Spacing', 'astra' ), + 'suffix' => 'px', + 'priority' => 6, + 'input_attrs' => array( + 'min' => 1, + 'step' => 1, + 'max' => 100, + ), + ), + + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Heading_Colors_Configs(); diff --git a/inc/addons/heading-colors/dynamic-css/dynamic.css.php b/inc/addons/heading-colors/dynamic-css/dynamic.css.php index e591b9c..a60bd47 100644 --- a/inc/addons/heading-colors/dynamic-css/dynamic.css.php +++ b/inc/addons/heading-colors/dynamic-css/dynamic.css.php @@ -1,54 +1,54 @@ - array( - 'color' => esc_attr( $heading_base_color ), - ), - ); - - /* Parse CSS from array() */ - $css_output = astra_parse_css( $css_output ); - - $dynamic_css .= $css_output; - - return $dynamic_css; -} + array( + 'color' => esc_attr( $heading_base_color ), + ), + ); + + /* Parse CSS from array() */ + $css_output = astra_parse_css( $css_output ); + + $dynamic_css .= $css_output; + + return $dynamic_css; +} diff --git a/inc/addons/transparent-header/class-astra-ext-transparent-header.php b/inc/addons/transparent-header/class-astra-ext-transparent-header.php index 68dff6c..162d8ff 100644 --- a/inc/addons/transparent-header/class-astra-ext-transparent-header.php +++ b/inc/addons/transparent-header/class-astra-ext-transparent-header.php @@ -1,64 +1,64 @@ - 150, - 'tablet' => 120, - 'mobile' => 100, - ); - $defaults['transparent-header-enable'] = 0; - $defaults['transparent-header-disable-archive'] = 1; - $defaults['transparent-header-disable-latest-posts-index'] = 1; - $defaults['transparent-header-on-devices'] = 'both'; - $defaults['transparent-header-main-sep'] = ''; - $defaults['transparent-header-main-sep-color'] = ''; - - /** - * Transparent Header - */ - $defaults['transparent-header-bg-color'] = ''; - $defaults['transparent-header-color-site-title'] = ''; - $defaults['transparent-header-color-h-site-title'] = ''; - $defaults['transparent-menu-bg-color'] = ''; - $defaults['transparent-menu-color'] = ''; - $defaults['transparent-menu-h-color'] = ''; - $defaults['transparent-submenu-bg-color'] = ''; - $defaults['transparent-submenu-color'] = ''; - $defaults['transparent-submenu-h-color'] = ''; - - /** - * Transparent Header Responsive Colors - */ - $defaults['transparent-header-bg-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['transparent-header-color-site-title-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['transparent-header-color-h-site-title-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['transparent-menu-bg-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['transparent-menu-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['transparent-menu-h-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['transparent-submenu-bg-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['transparent-submenu-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['transparent-submenu-h-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - $defaults['transparent-content-section-text-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - $defaults['transparent-content-section-link-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - $defaults['transparent-content-section-link-h-color-responsive'] = array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ); - - return $defaults; - } - - /** - * Add postMessage support for site title and description for the Theme Customizer. - * - * @param WP_Customize_Manager $wp_customize Theme Customizer object. - */ - public function customize_register( $wp_customize ) { - - // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - /** - * Register Panel & Sections - */ - require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/class-astra-transparent-header-panels-and-sections.php'; - - /** - * Sections - */ - require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/sections/class-astra-customizer-colors-transparent-header-configs.php'; - // Check Transparent Header is activated. - require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/sections/class-astra-customizer-transparent-header-configs.php'; - // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - } - - /** - * Customizer Preview - */ - public function preview_scripts() { - /** - * Load unminified if SCRIPT_DEBUG is true. - */ - /* Directory and Extension */ - $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; - $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; - wp_enqueue_script( 'astra-transparent-header-customizer-preview-js', ASTRA_THEME_TRANSPARENT_HEADER_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); - - // Localize variables for further JS. - wp_localize_script( - 'astra-transparent-header-customizer-preview-js', - 'AstraBuilderTransparentData', - array( - 'is_astra_hf_builder_active' => Astra_Builder_Helper::$is_header_footer_builder_active, - 'is_flex_based_css' => Astra_Builder_Helper::apply_flex_based_css(), - ) - ); - } - } -} - -/** -* Kicking this off by calling 'get_instance()' method -*/ -Astra_Ext_Transparent_Header_Loader::get_instance(); + 150, + 'tablet' => 120, + 'mobile' => 100, + ); + $defaults['transparent-header-enable'] = 0; + $defaults['transparent-header-disable-archive'] = 1; + $defaults['transparent-header-disable-latest-posts-index'] = 1; + $defaults['transparent-header-on-devices'] = 'both'; + $defaults['transparent-header-main-sep'] = ''; + $defaults['transparent-header-main-sep-color'] = ''; + + /** + * Transparent Header + */ + $defaults['transparent-header-bg-color'] = ''; + $defaults['transparent-header-color-site-title'] = ''; + $defaults['transparent-header-color-h-site-title'] = ''; + $defaults['transparent-menu-bg-color'] = ''; + $defaults['transparent-menu-color'] = ''; + $defaults['transparent-menu-h-color'] = ''; + $defaults['transparent-submenu-bg-color'] = ''; + $defaults['transparent-submenu-color'] = ''; + $defaults['transparent-submenu-h-color'] = ''; + + /** + * Transparent Header Responsive Colors + */ + $defaults['transparent-header-bg-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['transparent-header-color-site-title-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['transparent-header-color-h-site-title-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['transparent-menu-bg-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['transparent-menu-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['transparent-menu-h-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['transparent-submenu-bg-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['transparent-submenu-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['transparent-submenu-h-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + $defaults['transparent-content-section-text-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + $defaults['transparent-content-section-link-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + $defaults['transparent-content-section-link-h-color-responsive'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ); + + return $defaults; + } + + /** + * Add postMessage support for site title and description for the Theme Customizer. + * + * @param WP_Customize_Manager $wp_customize Theme Customizer object. + */ + public function customize_register( $wp_customize ) { + + // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + /** + * Register Panel & Sections + */ + require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/class-astra-transparent-header-panels-and-sections.php'; + + /** + * Sections + */ + require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/sections/class-astra-customizer-colors-transparent-header-configs.php'; + // Check Transparent Header is activated. + require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/sections/class-astra-customizer-transparent-header-configs.php'; + // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + } + + /** + * Customizer Preview + */ + public function preview_scripts() { + /** + * Load unminified if SCRIPT_DEBUG is true. + */ + /* Directory and Extension */ + $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; + $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; + wp_enqueue_script( 'astra-transparent-header-customizer-preview-js', ASTRA_THEME_TRANSPARENT_HEADER_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); + + // Localize variables for further JS. + wp_localize_script( + 'astra-transparent-header-customizer-preview-js', + 'AstraBuilderTransparentData', + array( + 'is_astra_hf_builder_active' => Astra_Builder_Helper::$is_header_footer_builder_active, + 'is_flex_based_css' => Astra_Builder_Helper::apply_flex_based_css(), + ) + ); + } + } +} + +/** +* Kicking this off by calling 'get_instance()' method +*/ +Astra_Ext_Transparent_Header_Loader::get_instance(); diff --git a/inc/addons/transparent-header/classes/class-astra-ext-transparent-header-markup.php b/inc/addons/transparent-header/classes/class-astra-ext-transparent-header-markup.php index 4c1462e..bd6a0a0 100644 --- a/inc/addons/transparent-header/classes/class-astra-ext-transparent-header-markup.php +++ b/inc/addons/transparent-header/classes/class-astra-ext-transparent-header-markup.php @@ -1,386 +1,386 @@ - - * - * @since 1.0.0 - */ - public function transparent_header_logo() { - - $inherit_desk_logo = astra_get_option( 'different-transparent-logo', false ); - $transparent_header_logo = astra_get_option( 'transparent-header-logo' ); - - if ( self::is_transparent_header() && '1' == $inherit_desk_logo && '' !== $transparent_header_logo ) { - // Logo For None Effect. - add_filter( 'astra_has_custom_logo', '__return_true' ); - add_filter( 'get_custom_logo', array( $this, 'transparent_custom_logo' ), 10, 2 ); - } - } - - - /** - * Replace transparent header logo. - * - * @param sting $html Size name. - * @param int $blog_id Icon. - * - * @return string html markup of logo. - */ - public function transparent_custom_logo( $html, $blog_id ) { - - $trans_logo = astra_get_option( 'transparent-header-logo' ); - $transparent_header_devices = astra_get_option( 'transparent-header-on-devices' ); - - if ( '' !== $trans_logo ) { - - /* Replace transparent header logo and width */ - add_filter( 'wp_get_attachment_image_attributes', array( $this, 'replace_trans_header_attr' ), 10, 3 ); - - $custom_logo_id = attachment_url_to_postid( $trans_logo ); - - $size = 'ast-transparent-logo-size'; - - if ( is_customize_preview() ) { - $size = 'full'; - } - - $html = sprintf( - '', - esc_url( home_url( '/' ) ), - wp_get_attachment_image( - $custom_logo_id, - $size, - false, - array( - 'class' => 'custom-logo', - ) - ) - ); - - if ( 'mobile' === $transparent_header_devices ) { - - $html .= sprintf( - '', - esc_url( home_url( '/' ) ), - wp_get_attachment_image( - get_theme_mod( 'custom_logo' ), - $size, - false, - array( - 'class' => 'custom-logo', - ) - ) - ); - } - - if ( 'desktop' === $transparent_header_devices ) { - - $html .= sprintf( - '', - esc_url( home_url( '/' ) ), - wp_get_attachment_image( - get_theme_mod( 'custom_logo' ), - $size, - false, - array( - 'class' => 'custom-logo', - ) - ) - ); - } - - remove_filter( 'wp_get_attachment_image_attributes', array( $this, 'replace_trans_header_attr' ) ); - } - - return $html; - } - - - - /** - * Replace transparent header logo. - * - * @param array $attr Image. - * @param object $attachment Image obj. - * @param sting $size Size name. - * - * @return array Image attr. - */ - public function replace_trans_header_attr( $attr, $attachment, $size ) { - - $trans_logo = astra_get_option( 'transparent-header-logo' ); - $custom_logo_id = attachment_url_to_postid( $trans_logo ); - - if ( $custom_logo_id == $attachment->ID ) { - - $attach_data = array(); - if ( ! is_customize_preview() ) { - $attach_data = wp_get_attachment_image_src( $attachment->ID, 'ast-transparent-logo-size' ); - if ( isset( $attach_data[0] ) ) { - $attr['src'] = $attach_data[0]; - } - } - - $file_type = wp_check_filetype( $attr['src'] ); - $file_extension = $file_type['ext']; - - if ( 'svg' == $file_extension ) { - $attr['class'] = 'astra-logo-svg'; - } - - $diff_retina_logo = astra_get_option( 'different-transparent-retina-logo' ); - - if ( '1' == $diff_retina_logo ) { - - $retina_logo = astra_get_option( 'transparent-header-retina-logo' ); - - $attr['srcset'] = ''; - - if ( apply_filters( 'astra_transparent_header_retina', true ) && '' !== $retina_logo ) { - $cutom_logo = wp_get_attachment_image_src( $custom_logo_id, 'full' ); - $cutom_logo_url = $cutom_logo[0]; - - if ( astra_check_is_ie() ) { - // Replace header logo url to retina logo url. - $attr['src'] = $retina_logo; - } - - $attr['srcset'] = $cutom_logo_url . ' 1x, ' . $retina_logo . ' 2x'; - - } - } - } - - return $attr; - } - - /** - * Add Meta Options - * - * @param array $meta_option Page Meta. - * @return array - */ - public function add_options( $meta_option ) { - - $meta_option['theme-transparent-header-meta'] = array( - 'sanitize' => 'FILTER_DEFAULT', - ); - - return $meta_option; - } - - /** - * Transparent Header Meta Field markup - * - * Loads appropriate template file based on the style option selected in options panel. - * - * @param array $meta Page Meta. - * @since 1.0.0 - */ - public function add_options_markup( $meta ) { - - /** - * Get options - */ - $trans_header_meta = ( isset( $meta['theme-transparent-header-meta']['default'] ) ) ? $meta['theme-transparent-header-meta']['default'] : 'default'; - $show_meta_field = ! astra_check_is_bb_themer_layout(); - ?> - - -
-

-
-

- -
- - - (int) $max_value, - 'height' => 0, - 'crop' => false, - ); - } - - return $sizes; - } - } -} - -/** -* Kicking this off by calling 'get_instance()' method -*/ -Astra_Ext_Transparent_Header_Markup::get_instance(); + + * + * @since 1.0.0 + */ + public function transparent_header_logo() { + + $inherit_desk_logo = astra_get_option( 'different-transparent-logo', false ); + $transparent_header_logo = astra_get_option( 'transparent-header-logo' ); + + if ( self::is_transparent_header() && '1' == $inherit_desk_logo && '' !== $transparent_header_logo ) { + // Logo For None Effect. + add_filter( 'astra_has_custom_logo', '__return_true' ); + add_filter( 'get_custom_logo', array( $this, 'transparent_custom_logo' ), 10, 2 ); + } + } + + + /** + * Replace transparent header logo. + * + * @param sting $html Size name. + * @param int $blog_id Icon. + * + * @return string html markup of logo. + */ + public function transparent_custom_logo( $html, $blog_id ) { + + $trans_logo = astra_get_option( 'transparent-header-logo' ); + $transparent_header_devices = astra_get_option( 'transparent-header-on-devices' ); + + if ( '' !== $trans_logo ) { + + /* Replace transparent header logo and width */ + add_filter( 'wp_get_attachment_image_attributes', array( $this, 'replace_trans_header_attr' ), 10, 3 ); + + $custom_logo_id = attachment_url_to_postid( $trans_logo ); + + $size = 'ast-transparent-logo-size'; + + if ( is_customize_preview() ) { + $size = 'full'; + } + + $html = sprintf( + '', + esc_url( home_url( '/' ) ), + wp_get_attachment_image( + $custom_logo_id, + $size, + false, + array( + 'class' => 'custom-logo', + ) + ) + ); + + if ( 'mobile' === $transparent_header_devices ) { + + $html .= sprintf( + '', + esc_url( home_url( '/' ) ), + wp_get_attachment_image( + get_theme_mod( 'custom_logo' ), + $size, + false, + array( + 'class' => 'custom-logo', + ) + ) + ); + } + + if ( 'desktop' === $transparent_header_devices ) { + + $html .= sprintf( + '', + esc_url( home_url( '/' ) ), + wp_get_attachment_image( + get_theme_mod( 'custom_logo' ), + $size, + false, + array( + 'class' => 'custom-logo', + ) + ) + ); + } + + remove_filter( 'wp_get_attachment_image_attributes', array( $this, 'replace_trans_header_attr' ) ); + } + + return $html; + } + + + + /** + * Replace transparent header logo. + * + * @param array $attr Image. + * @param object $attachment Image obj. + * @param sting $size Size name. + * + * @return array Image attr. + */ + public function replace_trans_header_attr( $attr, $attachment, $size ) { + + $trans_logo = astra_get_option( 'transparent-header-logo' ); + $custom_logo_id = attachment_url_to_postid( $trans_logo ); + + if ( $custom_logo_id == $attachment->ID ) { + + $attach_data = array(); + if ( ! is_customize_preview() ) { + $attach_data = wp_get_attachment_image_src( $attachment->ID, 'ast-transparent-logo-size' ); + if ( isset( $attach_data[0] ) ) { + $attr['src'] = $attach_data[0]; + } + } + + $file_type = wp_check_filetype( $attr['src'] ); + $file_extension = $file_type['ext']; + + if ( 'svg' == $file_extension ) { + $attr['class'] = 'astra-logo-svg'; + } + + $diff_retina_logo = astra_get_option( 'different-transparent-retina-logo' ); + + if ( '1' == $diff_retina_logo ) { + + $retina_logo = astra_get_option( 'transparent-header-retina-logo' ); + + $attr['srcset'] = ''; + + if ( apply_filters( 'astra_transparent_header_retina', true ) && '' !== $retina_logo ) { + $cutom_logo = wp_get_attachment_image_src( $custom_logo_id, 'full' ); + $cutom_logo_url = $cutom_logo[0]; + + if ( astra_check_is_ie() ) { + // Replace header logo url to retina logo url. + $attr['src'] = $retina_logo; + } + + $attr['srcset'] = $cutom_logo_url . ' 1x, ' . $retina_logo . ' 2x'; + + } + } + } + + return $attr; + } + + /** + * Add Meta Options + * + * @param array $meta_option Page Meta. + * @return array + */ + public function add_options( $meta_option ) { + + $meta_option['theme-transparent-header-meta'] = array( + 'sanitize' => 'FILTER_DEFAULT', + ); + + return $meta_option; + } + + /** + * Transparent Header Meta Field markup + * + * Loads appropriate template file based on the style option selected in options panel. + * + * @param array $meta Page Meta. + * @since 1.0.0 + */ + public function add_options_markup( $meta ) { + + /** + * Get options + */ + $trans_header_meta = ( isset( $meta['theme-transparent-header-meta']['default'] ) ) ? $meta['theme-transparent-header-meta']['default'] : 'default'; + $show_meta_field = ! astra_check_is_bb_themer_layout(); + ?> + + +
+

+
+

+ +
+ + + (int) $max_value, + 'height' => 0, + 'crop' => false, + ); + } + + return $sizes; + } + } +} + +/** +* Kicking this off by calling 'get_instance()' method +*/ +Astra_Ext_Transparent_Header_Markup::get_instance(); diff --git a/inc/addons/transparent-header/classes/class-astra-transparent-header-panels-and-sections.php b/inc/addons/transparent-header/classes/class-astra-transparent-header-panels-and-sections.php index 42a8bc3..724cfa0 100644 --- a/inc/addons/transparent-header/classes/class-astra-transparent-header-panels-and-sections.php +++ b/inc/addons/transparent-header/classes/class-astra-transparent-header-panels-and-sections.php @@ -1,71 +1,71 @@ - 'section-transparent-header', - 'title' => __( 'Transparent Header', 'astra' ), - 'panel' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 'panel-header-builder-group' : 'panel-header-group', - 'type' => 'section', - 'priority' => 33, - ), - - array( - 'name' => 'section-colors-header-group', - 'type' => 'section', - 'title' => __( 'Header', 'astra' ), - 'panel' => 'panel-colors-background', - 'priority' => 20, - ), - ); - - return array_merge( $configurations, $_configs ); - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -new Astra_Transparent_Header_Panels_And_Sections(); + 'section-transparent-header', + 'title' => __( 'Transparent Header', 'astra' ), + 'panel' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 'panel-header-builder-group' : 'panel-header-group', + 'type' => 'section', + 'priority' => 33, + ), + + array( + 'name' => 'section-colors-header-group', + 'type' => 'section', + 'title' => __( 'Header', 'astra' ), + 'panel' => 'panel-colors-background', + 'priority' => 20, + ), + ); + + return array_merge( $configurations, $_configs ); + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +new Astra_Transparent_Header_Panels_And_Sections(); diff --git a/inc/addons/transparent-header/classes/dynamic-css/dynamic.css.php b/inc/addons/transparent-header/classes/dynamic-css/dynamic.css.php index 3f8cb0b..7de0a50 100644 --- a/inc/addons/transparent-header/classes/dynamic-css/dynamic.css.php +++ b/inc/addons/transparent-header/classes/dynamic-css/dynamic.css.php @@ -1,498 +1,498 @@ - array( - 'display' => 'none', - ), - ); - $css .= astra_parse_css( $css_output ); - } - - // Desktop Transparent Heder Logo Width. - $css_output = array( - '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array( - 'width' => astra_get_css_value( $transparent_header_logo_width['desktop'], 'px' ), - 'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['desktop-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['desktop-svg-height'] : '', 'px' ), - ), - '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array( - ' max-width' => astra_get_css_value( $transparent_header_logo_width['desktop'], 'px' ), - ), - ); - $css .= astra_parse_css( $css_output ); - - // Tablet Transparent Heder Logo Width. - $tablet_css_output = array( - '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array( - 'width' => astra_get_css_value( $transparent_header_logo_width['tablet'], 'px' ), - 'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['tablet-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['tablet-svg-height'] : '', 'px' ), - ), - '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array( - ' max-width' => astra_get_css_value( $transparent_header_logo_width['tablet'], 'px' ), - ), - ); - $css .= astra_parse_css( $tablet_css_output, '', astra_get_tablet_breakpoint() ); - - // Mobile Transparent Heder Logo Width. - $mobile_css_output = array( - '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array( - 'width' => astra_get_css_value( $transparent_header_logo_width['mobile'], 'px' ), - 'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['mobile-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['mobile-svg-height'] : '', 'px' ), - ), - '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array( - ' max-width' => astra_get_css_value( $transparent_header_logo_width['mobile'], 'px' ), - ), - ); - $css .= astra_parse_css( $mobile_css_output, '', astra_get_mobile_breakpoint( 1 ) ); - - $transparent_header_base = array( - '.ast-theme-transparent-header #masthead' => array( - 'position' => 'absolute', - 'left' => '0', - 'right' => '0', - ), - - '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar' => array( - 'background' => 'none', - ), - - 'body.elementor-editor-active.ast-theme-transparent-header #masthead, .fl-builder-edit .ast-theme-transparent-header #masthead, body.vc_editor.ast-theme-transparent-header #masthead, body.brz-ed.ast-theme-transparent-header #masthead' => array( - 'z-index' => '0', - ), - - '.ast-header-break-point.ast-replace-site-logo-transparent.ast-theme-transparent-header .custom-mobile-logo-link' => array( - 'display' => 'none', - ), - - '.ast-header-break-point.ast-replace-site-logo-transparent.ast-theme-transparent-header .transparent-custom-logo' => array( - 'display' => 'inline-block', - ), - - '.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar' => array( - 'background-image' => 'none', - 'background-color' => 'transparent', - ), - - '.ast-theme-transparent-header .ast-below-header' => array( - 'background-image' => 'none', - 'background-color' => 'transparent', - ), - ); - - /** - * Transparent Header Colors - */ - $transparent_header_desktop = array( - - '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array( - 'background-color' => esc_attr( $transparent_bg_color_desktop ), - ), - '.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array( - 'background-color' => esc_attr( $transparent_bg_color_desktop ), - ), - - '.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar, .ast-theme-transparent-header .ast-below-header, .ast-header-break-point.ast-theme-transparent-header .ast-above-header, .ast-header-break-point.ast-theme-transparent-header .ast-below-header' => array( - 'background-color' => esc_attr( $transparent_bg_color_desktop ), - ), - - '.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited' => array( - 'color' => esc_attr( $transparent_color_site_title_desktop ), - ), - '.ast-theme-transparent-header .site-header .site-title a:hover' => array( - 'color' => esc_attr( $transparent_color_h_site_title_desktop ), - ), - - '.ast-theme-transparent-header .site-header .site-description' => array( - 'color' => esc_attr( $transparent_color_site_title_desktop ), - ), - - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array( - 'background-color' => esc_attr( $transparent_menu_bg_color_desktop ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array( - 'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_color_desktop ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .main-header-menu .menu-link' => array( - 'color' => esc_attr( $transparent_menu_color_desktop ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_desktop ), - ), - // Content Section text color. - '.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array( - 'color' => esc_attr( $transparent_content_section_text_color_desktop ), - ), - // Content Section link color. - '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a' => array( - 'color' => esc_attr( $transparent_content_section_link_color_desktop ), - ), - // Content Section link hover color. - '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a:hover' => array( - 'color' => esc_attr( $transparent_content_section_link_h_color_desktop ), - ), - ); - - $transparent_header_tablet = array( - - '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array( - 'background-color' => esc_attr( $transparent_bg_color_tablet ), - ), - '.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array( - 'background-color' => esc_attr( $transparent_bg_color_tablet ), - ), - '.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar, .ast-theme-transparent-header .ast-below-header, .ast-header-break-point.ast-theme-transparent-header .ast-above-header, .ast-header-break-point.ast-theme-transparent-header .ast-below-header' => array( - 'background-color' => esc_attr( $transparent_bg_color_tablet ), - ), - - '.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:hover, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:focus, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:visited' => array( - 'color' => esc_attr( $transparent_color_site_title_tablet ), - ), - '.ast-theme-transparent-header .site-header .site-title a:hover' => array( - 'color' => esc_attr( $transparent_color_h_site_title_tablet ), - ), - - '.ast-theme-transparent-header .site-header .site-description' => array( - 'color' => esc_attr( $transparent_color_site_title_tablet ), - ), - - '.ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array( - 'background-color' => esc_attr( $transparent_menu_bg_color_tablet ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array( - 'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_color_tablet ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-link' => array( - 'color' => esc_attr( $transparent_menu_color_tablet ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_tablet ), - ), - // Content Section text color. - '.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array( - 'color' => esc_attr( $transparent_content_section_text_color_tablet ), - ), - // Content Section link color. - '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a' => array( - 'color' => esc_attr( $transparent_content_section_link_color_tablet ), - ), - // Content Section link hover color. - '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover' => array( - 'color' => esc_attr( $transparent_content_section_link_h_color_tablet ), - ), - ); - - $transparent_header_mobile = array( - - '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array( - 'background-color' => esc_attr( $transparent_bg_color_mobile ), - ), - '.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array( - 'background-color' => esc_attr( $transparent_bg_color_mobile ), - ), - - '.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar, .ast-theme-transparent-header .ast-below-header, .ast-header-break-point.ast-theme-transparent-header .ast-above-header, .ast-header-break-point.ast-theme-transparent-header .ast-below-header' => array( - 'background-color' => esc_attr( $transparent_bg_color_mobile ), - ), - - '.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:hover, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:focus, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:visited' => array( - 'color' => esc_attr( $transparent_color_site_title_mobile ), - ), - '.ast-theme-transparent-header .site-header .site-title a:hover' => array( - 'color' => esc_attr( $transparent_color_h_site_title_mobile ), - ), - - '.ast-theme-transparent-header .site-header .site-description' => array( - 'color' => esc_attr( $transparent_color_site_title_mobile ), - ), - - '.ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array( - 'background-color' => esc_attr( $transparent_menu_bg_color_mobile ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array( - 'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_color_mobile ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-link' => array( - 'color' => esc_attr( $transparent_menu_color_mobile ), - ), - '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_mobile ), - ), - // Content Section text color. - '.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array( - 'color' => esc_attr( $transparent_content_section_text_color_mobile ), - ), - // Content Section link color. - '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a' => array( - 'color' => esc_attr( $transparent_content_section_link_color_mobile ), - ), - // Content Section link hover color. - '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover' => array( - 'color' => esc_attr( $transparent_content_section_link_h_color_mobile ), - ), - ); - - /* Parse CSS from array() */ - if ( 'both' === $transparent_header_devices || 'desktop' === $transparent_header_devices ) { - $css .= astra_parse_css( $transparent_header_base, astra_get_tablet_breakpoint() ); - - // If Transparent header is active on mobile + desktop, enqueue CSS without media queeries. - // If only for desktop add media query for the transparent header. - if ( 'both' === $transparent_header_devices ) { - $css .= astra_parse_css( $transparent_header_desktop ); - } else { - $css .= astra_parse_css( $transparent_header_desktop, astra_get_tablet_breakpoint( '', 1 ) ); - } - } - - if ( 'mobile' === $transparent_header_devices ) { - $css .= astra_parse_css( - array( - '.transparent-custom-logo' => array( - 'display' => 'none', - ), - ), - astra_get_tablet_breakpoint() - ); - - $css .= astra_parse_css( - array( - '.transparent-custom-logo' => array( - 'display' => 'block', - ), - ), - '', - astra_get_tablet_breakpoint() - ); - - $css .= astra_parse_css( - array( - '.ast-transparent-desktop-logo' => array( - 'display' => 'none', - ), - ), - '', - astra_get_tablet_breakpoint() - ); - } - - if ( 'desktop' === $transparent_header_devices ) { - $css .= astra_parse_css( - array( - '.transparent-custom-logo' => array( - 'display' => 'none', - ), - ), - '', - astra_get_tablet_breakpoint() - ); - - $css .= astra_parse_css( - array( - '.ast-transparent-mobile-logo' => array( - 'display' => 'none', - ), - ), - astra_get_tablet_breakpoint() - ); - - $css .= astra_parse_css( - array( - '.ast-transparent-mobile-logo' => array( - 'display' => 'block', - ), - ), - '', - astra_get_tablet_breakpoint() - ); - } - - if ( 'both' === $transparent_header_devices || 'mobile' === $transparent_header_devices ) { - $css .= astra_parse_css( $transparent_header_base, '', astra_get_tablet_breakpoint() ); - $css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() ); - $css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() ); - } - - $mobile_header_type = astra_get_option( 'mobile-header-type' ); - - if ( 'dropdown' === $mobile_header_type || is_customize_preview() ) { - $header_child_selector = '[CLASS*="-header-wrap"]:nth-last-child(2) > [CLASS*="-header-bar"]'; - } else { - $header_child_selector = '[CLASS*="-header-wrap"]:last-child > [CLASS*="-header-bar"]'; - } - - if ( 'both' === $transparent_header_devices && $transparent_header_separator ) { - - $selector = '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar'; - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - $selector = '.ast-theme-transparent-header #ast-desktop-header > ' . $header_child_selector . ', .ast-theme-transparent-header.ast-header-break-point #ast-mobile-header > ' . $header_child_selector; - } - - $css .= astra_parse_css( - array( - $selector => array( - 'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ), - 'border-bottom-style' => 'solid', - 'border-bottom-color' => esc_attr( $transparent_header_separator_color ), - ), - ) - ); - } - - if ( 'mobile' === $transparent_header_devices && $transparent_header_separator ) { - - $selector = '.ast-theme-transparent-header.ast-header-break-point .main-header-bar'; - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - $selector = '.ast-theme-transparent-header.ast-header-break-point #ast-mobile-header > ' . $header_child_selector; - } - - $css .= astra_parse_css( - array( - $selector => array( - 'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ), - 'border-bottom-style' => 'solid', - 'border-bottom-color' => esc_attr( $transparent_header_separator_color ), - ), - ), - '', - astra_get_tablet_breakpoint() - ); - } - - if ( 'desktop' === $transparent_header_devices && $transparent_header_separator ) { - - $selector = '.ast-theme-transparent-header .main-header-bar'; - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - $selector = '.ast-theme-transparent-header #ast-desktop-header > ' . $header_child_selector; - } - - $css .= astra_parse_css( - array( - $selector => array( - 'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ), - 'border-bottom-style' => 'solid', - 'border-bottom-color' => esc_attr( $transparent_header_separator_color ), - ), - ), - astra_get_tablet_breakpoint() - ); - } - - $dynamic_css .= $css; - - return $dynamic_css; -} + array( + 'display' => 'none', + ), + ); + $css .= astra_parse_css( $css_output ); + } + + // Desktop Transparent Heder Logo Width. + $css_output = array( + '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array( + 'width' => astra_get_css_value( $transparent_header_logo_width['desktop'], 'px' ), + 'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['desktop-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['desktop-svg-height'] : '', 'px' ), + ), + '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array( + ' max-width' => astra_get_css_value( $transparent_header_logo_width['desktop'], 'px' ), + ), + ); + $css .= astra_parse_css( $css_output ); + + // Tablet Transparent Heder Logo Width. + $tablet_css_output = array( + '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array( + 'width' => astra_get_css_value( $transparent_header_logo_width['tablet'], 'px' ), + 'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['tablet-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['tablet-svg-height'] : '', 'px' ), + ), + '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array( + ' max-width' => astra_get_css_value( $transparent_header_logo_width['tablet'], 'px' ), + ), + ); + $css .= astra_parse_css( $tablet_css_output, '', astra_get_tablet_breakpoint() ); + + // Mobile Transparent Heder Logo Width. + $mobile_css_output = array( + '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array( + 'width' => astra_get_css_value( $transparent_header_logo_width['mobile'], 'px' ), + 'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['mobile-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['mobile-svg-height'] : '', 'px' ), + ), + '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array( + ' max-width' => astra_get_css_value( $transparent_header_logo_width['mobile'], 'px' ), + ), + ); + $css .= astra_parse_css( $mobile_css_output, '', astra_get_mobile_breakpoint( 1 ) ); + + $transparent_header_base = array( + '.ast-theme-transparent-header #masthead' => array( + 'position' => 'absolute', + 'left' => '0', + 'right' => '0', + ), + + '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar' => array( + 'background' => 'none', + ), + + 'body.elementor-editor-active.ast-theme-transparent-header #masthead, .fl-builder-edit .ast-theme-transparent-header #masthead, body.vc_editor.ast-theme-transparent-header #masthead, body.brz-ed.ast-theme-transparent-header #masthead' => array( + 'z-index' => '0', + ), + + '.ast-header-break-point.ast-replace-site-logo-transparent.ast-theme-transparent-header .custom-mobile-logo-link' => array( + 'display' => 'none', + ), + + '.ast-header-break-point.ast-replace-site-logo-transparent.ast-theme-transparent-header .transparent-custom-logo' => array( + 'display' => 'inline-block', + ), + + '.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar' => array( + 'background-image' => 'none', + 'background-color' => 'transparent', + ), + + '.ast-theme-transparent-header .ast-below-header' => array( + 'background-image' => 'none', + 'background-color' => 'transparent', + ), + ); + + /** + * Transparent Header Colors + */ + $transparent_header_desktop = array( + + '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array( + 'background-color' => esc_attr( $transparent_bg_color_desktop ), + ), + '.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array( + 'background-color' => esc_attr( $transparent_bg_color_desktop ), + ), + + '.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar, .ast-theme-transparent-header .ast-below-header, .ast-header-break-point.ast-theme-transparent-header .ast-above-header, .ast-header-break-point.ast-theme-transparent-header .ast-below-header' => array( + 'background-color' => esc_attr( $transparent_bg_color_desktop ), + ), + + '.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited' => array( + 'color' => esc_attr( $transparent_color_site_title_desktop ), + ), + '.ast-theme-transparent-header .site-header .site-title a:hover' => array( + 'color' => esc_attr( $transparent_color_h_site_title_desktop ), + ), + + '.ast-theme-transparent-header .site-header .site-description' => array( + 'color' => esc_attr( $transparent_color_site_title_desktop ), + ), + + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array( + 'background-color' => esc_attr( $transparent_menu_bg_color_desktop ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array( + 'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_color_desktop ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .main-header-menu .menu-link' => array( + 'color' => esc_attr( $transparent_menu_color_desktop ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_desktop ), + ), + // Content Section text color. + '.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array( + 'color' => esc_attr( $transparent_content_section_text_color_desktop ), + ), + // Content Section link color. + '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a' => array( + 'color' => esc_attr( $transparent_content_section_link_color_desktop ), + ), + // Content Section link hover color. + '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a:hover' => array( + 'color' => esc_attr( $transparent_content_section_link_h_color_desktop ), + ), + ); + + $transparent_header_tablet = array( + + '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array( + 'background-color' => esc_attr( $transparent_bg_color_tablet ), + ), + '.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array( + 'background-color' => esc_attr( $transparent_bg_color_tablet ), + ), + '.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar, .ast-theme-transparent-header .ast-below-header, .ast-header-break-point.ast-theme-transparent-header .ast-above-header, .ast-header-break-point.ast-theme-transparent-header .ast-below-header' => array( + 'background-color' => esc_attr( $transparent_bg_color_tablet ), + ), + + '.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:hover, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:focus, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:visited' => array( + 'color' => esc_attr( $transparent_color_site_title_tablet ), + ), + '.ast-theme-transparent-header .site-header .site-title a:hover' => array( + 'color' => esc_attr( $transparent_color_h_site_title_tablet ), + ), + + '.ast-theme-transparent-header .site-header .site-description' => array( + 'color' => esc_attr( $transparent_color_site_title_tablet ), + ), + + '.ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array( + 'background-color' => esc_attr( $transparent_menu_bg_color_tablet ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array( + 'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_color_tablet ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-link' => array( + 'color' => esc_attr( $transparent_menu_color_tablet ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_tablet ), + ), + // Content Section text color. + '.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array( + 'color' => esc_attr( $transparent_content_section_text_color_tablet ), + ), + // Content Section link color. + '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a' => array( + 'color' => esc_attr( $transparent_content_section_link_color_tablet ), + ), + // Content Section link hover color. + '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover' => array( + 'color' => esc_attr( $transparent_content_section_link_h_color_tablet ), + ), + ); + + $transparent_header_mobile = array( + + '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array( + 'background-color' => esc_attr( $transparent_bg_color_mobile ), + ), + '.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array( + 'background-color' => esc_attr( $transparent_bg_color_mobile ), + ), + + '.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar, .ast-theme-transparent-header .ast-below-header, .ast-header-break-point.ast-theme-transparent-header .ast-above-header, .ast-header-break-point.ast-theme-transparent-header .ast-below-header' => array( + 'background-color' => esc_attr( $transparent_bg_color_mobile ), + ), + + '.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:hover, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:focus, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:visited' => array( + 'color' => esc_attr( $transparent_color_site_title_mobile ), + ), + '.ast-theme-transparent-header .site-header .site-title a:hover' => array( + 'color' => esc_attr( $transparent_color_h_site_title_mobile ), + ), + + '.ast-theme-transparent-header .site-header .site-description' => array( + 'color' => esc_attr( $transparent_color_site_title_mobile ), + ), + + '.ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation #site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array( + 'background-color' => esc_attr( $transparent_menu_bg_color_mobile ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array( + 'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_color_mobile ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-link' => array( + 'color' => esc_attr( $transparent_menu_color_mobile ), + ), + '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_mobile ), + ), + // Content Section text color. + '.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array( + 'color' => esc_attr( $transparent_content_section_text_color_mobile ), + ), + // Content Section link color. + '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a' => array( + 'color' => esc_attr( $transparent_content_section_link_color_mobile ), + ), + // Content Section link hover color. + '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover' => array( + 'color' => esc_attr( $transparent_content_section_link_h_color_mobile ), + ), + ); + + /* Parse CSS from array() */ + if ( 'both' === $transparent_header_devices || 'desktop' === $transparent_header_devices ) { + $css .= astra_parse_css( $transparent_header_base, astra_get_tablet_breakpoint() ); + + // If Transparent header is active on mobile + desktop, enqueue CSS without media queeries. + // If only for desktop add media query for the transparent header. + if ( 'both' === $transparent_header_devices ) { + $css .= astra_parse_css( $transparent_header_desktop ); + } else { + $css .= astra_parse_css( $transparent_header_desktop, astra_get_tablet_breakpoint( '', 1 ) ); + } + } + + if ( 'mobile' === $transparent_header_devices ) { + $css .= astra_parse_css( + array( + '.transparent-custom-logo' => array( + 'display' => 'none', + ), + ), + astra_get_tablet_breakpoint() + ); + + $css .= astra_parse_css( + array( + '.transparent-custom-logo' => array( + 'display' => 'block', + ), + ), + '', + astra_get_tablet_breakpoint() + ); + + $css .= astra_parse_css( + array( + '.ast-transparent-desktop-logo' => array( + 'display' => 'none', + ), + ), + '', + astra_get_tablet_breakpoint() + ); + } + + if ( 'desktop' === $transparent_header_devices ) { + $css .= astra_parse_css( + array( + '.transparent-custom-logo' => array( + 'display' => 'none', + ), + ), + '', + astra_get_tablet_breakpoint() + ); + + $css .= astra_parse_css( + array( + '.ast-transparent-mobile-logo' => array( + 'display' => 'none', + ), + ), + astra_get_tablet_breakpoint() + ); + + $css .= astra_parse_css( + array( + '.ast-transparent-mobile-logo' => array( + 'display' => 'block', + ), + ), + '', + astra_get_tablet_breakpoint() + ); + } + + if ( 'both' === $transparent_header_devices || 'mobile' === $transparent_header_devices ) { + $css .= astra_parse_css( $transparent_header_base, '', astra_get_tablet_breakpoint() ); + $css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() ); + $css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() ); + } + + $mobile_header_type = astra_get_option( 'mobile-header-type' ); + + if ( 'dropdown' === $mobile_header_type || is_customize_preview() ) { + $header_child_selector = '[CLASS*="-header-wrap"]:nth-last-child(2) > [CLASS*="-header-bar"]'; + } else { + $header_child_selector = '[CLASS*="-header-wrap"]:last-child > [CLASS*="-header-bar"]'; + } + + if ( 'both' === $transparent_header_devices && $transparent_header_separator ) { + + $selector = '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar'; + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + $selector = '.ast-theme-transparent-header #ast-desktop-header > ' . $header_child_selector . ', .ast-theme-transparent-header.ast-header-break-point #ast-mobile-header > ' . $header_child_selector; + } + + $css .= astra_parse_css( + array( + $selector => array( + 'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ), + 'border-bottom-style' => 'solid', + 'border-bottom-color' => esc_attr( $transparent_header_separator_color ), + ), + ) + ); + } + + if ( 'mobile' === $transparent_header_devices && $transparent_header_separator ) { + + $selector = '.ast-theme-transparent-header.ast-header-break-point .main-header-bar'; + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + $selector = '.ast-theme-transparent-header.ast-header-break-point #ast-mobile-header > ' . $header_child_selector; + } + + $css .= astra_parse_css( + array( + $selector => array( + 'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ), + 'border-bottom-style' => 'solid', + 'border-bottom-color' => esc_attr( $transparent_header_separator_color ), + ), + ), + '', + astra_get_tablet_breakpoint() + ); + } + + if ( 'desktop' === $transparent_header_devices && $transparent_header_separator ) { + + $selector = '.ast-theme-transparent-header .main-header-bar'; + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + $selector = '.ast-theme-transparent-header #ast-desktop-header > ' . $header_child_selector; + } + + $css .= astra_parse_css( + array( + $selector => array( + 'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ), + 'border-bottom-style' => 'solid', + 'border-bottom-color' => esc_attr( $transparent_header_separator_color ), + ), + ), + astra_get_tablet_breakpoint() + ); + } + + $dynamic_css .= $css; + + return $dynamic_css; +} diff --git a/inc/addons/transparent-header/classes/dynamic-css/header-sections-dynamic.css.php b/inc/addons/transparent-header/classes/dynamic-css/header-sections-dynamic.css.php index 25acf32..a2dcecf 100644 --- a/inc/addons/transparent-header/classes/dynamic-css/header-sections-dynamic.css.php +++ b/inc/addons/transparent-header/classes/dynamic-css/header-sections-dynamic.css.php @@ -1,561 +1,561 @@ - array( - 'background-color' => esc_attr( $transparent_menu_bg_color_desktop ), - ), - '.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array( - 'background-color' => esc_attr( $transparent_bg_color_desktop ), - ), - '.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array( - 'background-color' => esc_attr( $transparent_bg_color_desktop ), - ), - '.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array( - 'background-color' => esc_attr( $transparent_bg_color_desktop ), - ), - - '.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_desktop ), - ), - '.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_desktop ), - ), - - '.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_menu_color_desktop ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array( - 'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), - ), - - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array( - 'color' => esc_attr( $transparent_sub_menu_color_desktop ), - ), - - // Content Section text color. - '.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array( - 'color' => esc_attr( $transparent_content_section_text_color_desktop ), - ), - // Content Section link color. - '.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array( - 'color' => esc_attr( $transparent_content_section_link_color_desktop ), - ), - // Content Section link hover color. - '.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array( - 'color' => esc_attr( $transparent_content_section_link_h_color_desktop ), - ), - - ); - - $transparent_header_tablet = array( - '.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul.ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-section-separated .ast-below-header-actual-nav' => array( - 'background-color' => esc_attr( $transparent_menu_bg_color_tablet ), - ), - '.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array( - 'background-color' => esc_attr( $transparent_bg_color_tablet ), - ), - '.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array( - 'background-color' => esc_attr( $transparent_bg_color_tablet ), - ), - '.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array( - 'background-color' => esc_attr( $transparent_bg_color_tablet ), - ), - - '.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_tablet ), - ), - '.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_tablet ), - ), - - '.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_menu_color_tablet ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array( - 'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), - ), - - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array( - 'color' => esc_attr( $transparent_sub_menu_color_tablet ), - ), - - // Content Section text color. - '.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array( - 'color' => esc_attr( $transparent_content_section_text_color_tablet ), - ), - // Content Section link color. - '.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array( - 'color' => esc_attr( $transparent_content_section_link_color_tablet ), - ), - // Content Section link hover color. - '.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array( - 'color' => esc_attr( $transparent_content_section_link_h_color_tablet ), - ), - ); - - $transparent_header_mobile = array( - '.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul.ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-section-separated .ast-below-header-actual-nav' => array( - 'background-color' => esc_attr( $transparent_menu_bg_color_mobile ), - ), - '.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array( - 'background-color' => esc_attr( $transparent_bg_color_mobile ), - ), - '.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array( - 'background-color' => esc_attr( $transparent_bg_color_mobile ), - ), - '.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array( - 'background-color' => esc_attr( $transparent_bg_color_mobile ), - ), - - '.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_mobile ), - ), - '.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_mobile ), - ), - - '.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_menu_color_mobile ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array( - 'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), - ), - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), - ), - - '.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array( - 'color' => esc_attr( $transparent_sub_menu_color_mobile ), - ), - - // Content Section text color. - '.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array( - 'color' => esc_attr( $transparent_content_section_text_color_mobile ), - ), - // Content Section link color. - '.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array( - 'color' => esc_attr( $transparent_content_section_link_color_mobile ), - ), - // Content Section link hover color. - '.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array( - 'color' => esc_attr( $transparent_content_section_link_h_color_mobile ), - ), - ); - - /* Parse CSS from array() */ - $css .= astra_parse_css( $transparent_header_desktop ); - $css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() ); - $css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() ); - - return $dynamic_css . $css; - -} - - - -/** - * Transparent Below Header - */ -add_filter( 'astra_dynamic_theme_css', 'astra_ext_transparent_below_header_sections_dynamic_css' ); - -/** - * Dynamic CSS - * - * @param string $dynamic_css Astra Dynamic CSS. - * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. - * @return String Generated dynamic CSS. - */ -function astra_ext_transparent_below_header_sections_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { - - // set page width depending on site layout. - $below_header_layout = astra_get_option( 'below-header-layout', 'disabled' ); - - if ( 'disabled' === $below_header_layout ) { - return $dynamic_css; - } - - if ( false == Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) { - return $dynamic_css; - } - - /** - * Set colors - */ - - $transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'desktop' ); - $transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'tablet' ); - $transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'mobile' ); - - $transparent_color_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'desktop' ); - $transparent_color_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'tablet' ); - $transparent_color_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'mobile' ); - - $transparent_color_h_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'desktop' ); - $transparent_color_h_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'tablet' ); - $transparent_color_h_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'mobile' ); - - $transparent_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'desktop' ); - $transparent_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'desktop' ); - $transparent_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'desktop' ); - - $transparent_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'tablet' ); - $transparent_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'tablet' ); - $transparent_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'tablet' ); - - $transparent_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'mobile' ); - $transparent_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'mobile' ); - $transparent_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'mobile' ); - - $transparent_sub_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'desktop' ); - $transparent_sub_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'desktop' ); - $transparent_sub_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'desktop' ); - - $transparent_sub_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'tablet' ); - $transparent_sub_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'tablet' ); - $transparent_sub_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'tablet' ); - - $transparent_sub_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'mobile' ); - $transparent_sub_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'mobile' ); - $transparent_sub_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'mobile' ); - - $transparent_content_section_text_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'desktop' ); - $transparent_content_section_link_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'desktop' ); - $transparent_content_section_link_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'desktop' ); - - $transparent_content_section_text_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'tablet' ); - $transparent_content_section_link_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'tablet' ); - $transparent_content_section_link_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'tablet' ); - - $transparent_content_section_text_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'mobile' ); - $transparent_content_section_link_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'mobile' ); - $transparent_content_section_link_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'mobile' ); - - /** - * Generate Dynamic CSS - */ - - $css = ''; - /** - * Transparent Header Colors - */ - $transparent_header_desktop = array( - '.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array( - 'background-color' => esc_attr( $transparent_menu_bg_color_desktop ), - ), - '.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array( - 'background-color' => esc_attr( $transparent_bg_color_desktop ), - ), - '.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array( - 'background-color' => esc_attr( $transparent_bg_color_desktop ), - ), - '.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array( - 'background-color' => esc_attr( $transparent_bg_color_desktop ), - ), - /** - * Below Header Navigation - */ - - '.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array( - 'color' => esc_attr( $transparent_menu_color_desktop ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_desktop ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_menu_h_color_desktop ), - ), - - /** - * Below Header Dropdown Navigation - */ - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array( - 'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array( - 'color' => esc_attr( $transparent_sub_menu_color_desktop ), - ), - - /** - * Content Colors & Typography - */ - '.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array( - 'color' => esc_attr( $transparent_content_section_text_color_desktop ), - ), - - '.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array( - 'color' => esc_attr( $transparent_content_section_link_color_desktop ), - ), - - '.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array( - 'color' => esc_attr( $transparent_content_section_link_h_color_desktop ), - ), - ); - - $transparent_header_tablet = array( - - '.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array( - 'background-color' => esc_attr( $transparent_menu_bg_color_tablet ), - ), - '.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array( - 'background-color' => esc_attr( $transparent_bg_color_tablet ), - ), - '.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array( - 'background-color' => esc_attr( $transparent_bg_color_tablet ), - ), - '.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array( - 'background-color' => esc_attr( $transparent_bg_color_tablet ), - ), - /** - * Below Header Navigation - */ - - '.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array( - 'color' => esc_attr( $transparent_menu_color_tablet ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_tablet ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_menu_h_color_tablet ), - ), - - /** - * Below Header Dropdown Navigation - */ - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array( - 'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array( - 'color' => esc_attr( $transparent_sub_menu_color_tablet ), - ), - - /** - * Content Colors & Typography - */ - '.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array( - 'color' => esc_attr( $transparent_content_section_text_color_tablet ), - ), - - '.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array( - 'color' => esc_attr( $transparent_content_section_link_color_tablet ), - ), - - '.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array( - 'color' => esc_attr( $transparent_content_section_link_h_color_tablet ), - ), - ); - - $transparent_header_mobile = array( - - '.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array( - 'background-color' => esc_attr( $transparent_menu_bg_color_mobile ), - ), - '.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array( - 'background-color' => esc_attr( $transparent_bg_color_mobile ), - ), - '.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array( - 'background-color' => esc_attr( $transparent_bg_color_mobile ), - ), - '.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array( - 'background-color' => esc_attr( $transparent_bg_color_mobile ), - ), - /** - * Below Header Navigation - */ - - '.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array( - 'color' => esc_attr( $transparent_menu_color_mobile ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array( - 'color' => esc_attr( $transparent_menu_h_color_mobile ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( - 'color' => esc_attr( $transparent_menu_h_color_mobile ), - ), - - /** - * Below Header Dropdown Navigation - */ - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( - 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array( - 'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ), - ), - - '.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array( - 'color' => esc_attr( $transparent_sub_menu_color_mobile ), - ), - - /** - * Content Colors & Typography - */ - '.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array( - 'color' => esc_attr( $transparent_content_section_text_color_mobile ), - ), - - '.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array( - 'color' => esc_attr( $transparent_content_section_link_color_mobile ), - ), - - '.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array( - 'color' => esc_attr( $transparent_content_section_link_h_color_mobile ), - ), - ); - - /* Parse CSS from array() */ - $css .= astra_parse_css( $transparent_header_desktop ); - $css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() ); - $css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() ); - - return $dynamic_css . $css; -} + array( + 'background-color' => esc_attr( $transparent_menu_bg_color_desktop ), + ), + '.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array( + 'background-color' => esc_attr( $transparent_bg_color_desktop ), + ), + '.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array( + 'background-color' => esc_attr( $transparent_bg_color_desktop ), + ), + '.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array( + 'background-color' => esc_attr( $transparent_bg_color_desktop ), + ), + + '.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_desktop ), + ), + '.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_desktop ), + ), + + '.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_menu_color_desktop ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array( + 'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), + ), + + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array( + 'color' => esc_attr( $transparent_sub_menu_color_desktop ), + ), + + // Content Section text color. + '.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array( + 'color' => esc_attr( $transparent_content_section_text_color_desktop ), + ), + // Content Section link color. + '.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array( + 'color' => esc_attr( $transparent_content_section_link_color_desktop ), + ), + // Content Section link hover color. + '.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array( + 'color' => esc_attr( $transparent_content_section_link_h_color_desktop ), + ), + + ); + + $transparent_header_tablet = array( + '.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul.ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-section-separated .ast-below-header-actual-nav' => array( + 'background-color' => esc_attr( $transparent_menu_bg_color_tablet ), + ), + '.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array( + 'background-color' => esc_attr( $transparent_bg_color_tablet ), + ), + '.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array( + 'background-color' => esc_attr( $transparent_bg_color_tablet ), + ), + '.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array( + 'background-color' => esc_attr( $transparent_bg_color_tablet ), + ), + + '.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_tablet ), + ), + '.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_tablet ), + ), + + '.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_menu_color_tablet ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array( + 'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), + ), + + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array( + 'color' => esc_attr( $transparent_sub_menu_color_tablet ), + ), + + // Content Section text color. + '.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array( + 'color' => esc_attr( $transparent_content_section_text_color_tablet ), + ), + // Content Section link color. + '.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array( + 'color' => esc_attr( $transparent_content_section_link_color_tablet ), + ), + // Content Section link hover color. + '.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array( + 'color' => esc_attr( $transparent_content_section_link_h_color_tablet ), + ), + ); + + $transparent_header_mobile = array( + '.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul.ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-section-separated .ast-below-header-actual-nav' => array( + 'background-color' => esc_attr( $transparent_menu_bg_color_mobile ), + ), + '.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array( + 'background-color' => esc_attr( $transparent_bg_color_mobile ), + ), + '.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array( + 'background-color' => esc_attr( $transparent_bg_color_mobile ), + ), + '.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array( + 'background-color' => esc_attr( $transparent_bg_color_mobile ), + ), + + '.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_mobile ), + ), + '.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_mobile ), + ), + + '.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_menu_color_mobile ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array( + 'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), + ), + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), + ), + + '.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array( + 'color' => esc_attr( $transparent_sub_menu_color_mobile ), + ), + + // Content Section text color. + '.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array( + 'color' => esc_attr( $transparent_content_section_text_color_mobile ), + ), + // Content Section link color. + '.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array( + 'color' => esc_attr( $transparent_content_section_link_color_mobile ), + ), + // Content Section link hover color. + '.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array( + 'color' => esc_attr( $transparent_content_section_link_h_color_mobile ), + ), + ); + + /* Parse CSS from array() */ + $css .= astra_parse_css( $transparent_header_desktop ); + $css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() ); + $css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() ); + + return $dynamic_css . $css; + +} + + + +/** + * Transparent Below Header + */ +add_filter( 'astra_dynamic_theme_css', 'astra_ext_transparent_below_header_sections_dynamic_css' ); + +/** + * Dynamic CSS + * + * @param string $dynamic_css Astra Dynamic CSS. + * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. + * @return String Generated dynamic CSS. + */ +function astra_ext_transparent_below_header_sections_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { + + // set page width depending on site layout. + $below_header_layout = astra_get_option( 'below-header-layout', 'disabled' ); + + if ( 'disabled' === $below_header_layout ) { + return $dynamic_css; + } + + if ( false == Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) { + return $dynamic_css; + } + + /** + * Set colors + */ + + $transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'desktop' ); + $transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'tablet' ); + $transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'mobile' ); + + $transparent_color_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'desktop' ); + $transparent_color_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'tablet' ); + $transparent_color_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'mobile' ); + + $transparent_color_h_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'desktop' ); + $transparent_color_h_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'tablet' ); + $transparent_color_h_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'mobile' ); + + $transparent_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'desktop' ); + $transparent_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'desktop' ); + $transparent_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'desktop' ); + + $transparent_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'tablet' ); + $transparent_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'tablet' ); + $transparent_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'tablet' ); + + $transparent_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'mobile' ); + $transparent_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'mobile' ); + $transparent_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'mobile' ); + + $transparent_sub_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'desktop' ); + $transparent_sub_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'desktop' ); + $transparent_sub_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'desktop' ); + + $transparent_sub_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'tablet' ); + $transparent_sub_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'tablet' ); + $transparent_sub_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'tablet' ); + + $transparent_sub_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'mobile' ); + $transparent_sub_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'mobile' ); + $transparent_sub_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'mobile' ); + + $transparent_content_section_text_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'desktop' ); + $transparent_content_section_link_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'desktop' ); + $transparent_content_section_link_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'desktop' ); + + $transparent_content_section_text_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'tablet' ); + $transparent_content_section_link_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'tablet' ); + $transparent_content_section_link_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'tablet' ); + + $transparent_content_section_text_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'mobile' ); + $transparent_content_section_link_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'mobile' ); + $transparent_content_section_link_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'mobile' ); + + /** + * Generate Dynamic CSS + */ + + $css = ''; + /** + * Transparent Header Colors + */ + $transparent_header_desktop = array( + '.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array( + 'background-color' => esc_attr( $transparent_menu_bg_color_desktop ), + ), + '.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array( + 'background-color' => esc_attr( $transparent_bg_color_desktop ), + ), + '.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array( + 'background-color' => esc_attr( $transparent_bg_color_desktop ), + ), + '.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array( + 'background-color' => esc_attr( $transparent_bg_color_desktop ), + ), + /** + * Below Header Navigation + */ + + '.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array( + 'color' => esc_attr( $transparent_menu_color_desktop ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_desktop ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_menu_h_color_desktop ), + ), + + /** + * Below Header Dropdown Navigation + */ + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_desktop ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array( + 'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array( + 'color' => esc_attr( $transparent_sub_menu_color_desktop ), + ), + + /** + * Content Colors & Typography + */ + '.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array( + 'color' => esc_attr( $transparent_content_section_text_color_desktop ), + ), + + '.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array( + 'color' => esc_attr( $transparent_content_section_link_color_desktop ), + ), + + '.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array( + 'color' => esc_attr( $transparent_content_section_link_h_color_desktop ), + ), + ); + + $transparent_header_tablet = array( + + '.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array( + 'background-color' => esc_attr( $transparent_menu_bg_color_tablet ), + ), + '.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array( + 'background-color' => esc_attr( $transparent_bg_color_tablet ), + ), + '.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array( + 'background-color' => esc_attr( $transparent_bg_color_tablet ), + ), + '.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array( + 'background-color' => esc_attr( $transparent_bg_color_tablet ), + ), + /** + * Below Header Navigation + */ + + '.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array( + 'color' => esc_attr( $transparent_menu_color_tablet ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_tablet ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_menu_h_color_tablet ), + ), + + /** + * Below Header Dropdown Navigation + */ + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_tablet ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array( + 'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array( + 'color' => esc_attr( $transparent_sub_menu_color_tablet ), + ), + + /** + * Content Colors & Typography + */ + '.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array( + 'color' => esc_attr( $transparent_content_section_text_color_tablet ), + ), + + '.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array( + 'color' => esc_attr( $transparent_content_section_link_color_tablet ), + ), + + '.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array( + 'color' => esc_attr( $transparent_content_section_link_h_color_tablet ), + ), + ); + + $transparent_header_mobile = array( + + '.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array( + 'background-color' => esc_attr( $transparent_menu_bg_color_mobile ), + ), + '.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array( + 'background-color' => esc_attr( $transparent_bg_color_mobile ), + ), + '.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array( + 'background-color' => esc_attr( $transparent_bg_color_mobile ), + ), + '.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array( + 'background-color' => esc_attr( $transparent_bg_color_mobile ), + ), + /** + * Below Header Navigation + */ + + '.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array( + 'color' => esc_attr( $transparent_menu_color_mobile ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array( + 'color' => esc_attr( $transparent_menu_h_color_mobile ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array( + 'color' => esc_attr( $transparent_menu_h_color_mobile ), + ), + + /** + * Below Header Dropdown Navigation + */ + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array( + 'color' => esc_attr( $transparent_sub_menu_h_color_mobile ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array( + 'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ), + ), + + '.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array( + 'color' => esc_attr( $transparent_sub_menu_color_mobile ), + ), + + /** + * Content Colors & Typography + */ + '.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array( + 'color' => esc_attr( $transparent_content_section_text_color_mobile ), + ), + + '.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array( + 'color' => esc_attr( $transparent_content_section_link_color_mobile ), + ), + + '.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array( + 'color' => esc_attr( $transparent_content_section_link_h_color_mobile ), + ), + ); + + /* Parse CSS from array() */ + $css .= astra_parse_css( $transparent_header_desktop ); + $css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() ); + $css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() ); + + return $dynamic_css . $css; +} diff --git a/inc/addons/transparent-header/classes/index.php b/inc/addons/transparent-header/classes/index.php index 02f2fd6..7860b5b 100644 --- a/inc/addons/transparent-header/classes/index.php +++ b/inc/addons/transparent-header/classes/index.php @@ -1,9 +1,9 @@ - ASTRA_THEME_SETTINGS . '[transparent-header-bg-color-responsive]', - 'default' => astra_get_option( 'transparent-header-bg-color-responsive' ), - 'section' => 'section-transparent-header', - 'type' => 'control', - 'priority' => 34, - 'transport' => 'postMessage', - 'control' => 'ast-responsive-color', - 'title' => __( 'Background Overlay', 'astra' ), - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - 'responsive' => true, - 'rgba' => true, - ), - - /** - * Option: Site Title Color - */ - array( - 'name' => 'transparent-header-color-site-title-responsive', - 'default' => astra_get_option( 'transparent-header-color-site-title-responsive' ), - 'type' => 'sub-control', - 'priority' => 1, - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors]', - 'section' => 'section-transparent-header', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'title' => __( 'Normal', 'astra' ), - 'tab' => __( 'Normal', 'astra' ), - 'responsive' => true, - 'rgba' => true, - ), - - /** - * Option: Site Title Hover Color - */ - array( - 'name' => 'transparent-header-color-h-site-title-responsive', - 'default' => astra_get_option( 'transparent-header-color-h-site-title-responsive' ), - 'type' => 'sub-control', - 'priority' => 1, - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors]', - 'section' => 'section-transparent-header', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'title' => __( 'Hover', 'astra' ), - 'tab' => __( 'Hover', 'astra' ), - 'responsive' => true, - 'rgba' => true, - ), - - /** - * Option: Primary Menu Color - */ - array( - 'name' => 'transparent-menu-color-responsive', - 'default' => astra_get_option( 'transparent-menu-color-responsive' ), - 'type' => 'sub-control', - 'priority' => 2, - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-menu]', - 'section' => 'section-transparent-header', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'tab' => __( 'Normal', 'astra' ), - 'title' => __( 'Normal', 'astra' ), - 'responsive' => true, - 'rgba' => true, - ), - - /** - * Option: Menu Background Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-menu-bg-color-responsive]', - 'default' => astra_get_option( 'transparent-menu-bg-color-responsive' ), - 'type' => 'control', - 'priority' => 36, - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'control' => 'ast-responsive-color', - 'tab' => __( 'Normal', 'astra' ), - 'title' => __( 'Background', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - ), - - /** - * Option: Menu Hover Color - */ - array( - 'name' => 'transparent-menu-h-color-responsive', - 'default' => astra_get_option( 'transparent-menu-h-color-responsive' ), - 'type' => 'sub-control', - 'priority' => 3, - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-menu]', - 'section' => 'section-transparent-header', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'tab' => __( 'Hover', 'astra' ), - 'title' => __( 'Hover / Active', 'astra' ), - 'responsive' => true, - 'rgba' => true, - ), - - /** - * Option: Sub menu text color. - */ - array( - 'name' => 'transparent-submenu-color-responsive', - 'default' => astra_get_option( 'transparent-submenu-color-responsive' ), - 'type' => 'sub-control', - 'priority' => 3, - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-submenu]', - 'section' => 'section-transparent-header', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'tab' => __( 'Normal', 'astra' ), - 'title' => __( 'Normal', 'astra' ), - 'responsive' => true, - 'rgba' => true, - ), - - /** - * Option: Sub menu background color. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-submenu-bg-color-responsive]', - 'default' => astra_get_option( 'transparent-submenu-bg-color-responsive' ), - 'type' => 'control', - 'priority' => 38, - 'section' => 'section-transparent-header', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'tab' => __( 'Normal', 'astra' ), - 'title' => __( 'Background', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - ), - - /** - * Option: Sub menu active hover color. - */ - array( - 'name' => 'transparent-submenu-h-color-responsive', - 'default' => astra_get_option( 'transparent-submenu-h-color-responsive' ), - 'type' => 'sub-control', - 'priority' => 3, - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-submenu]', - 'section' => 'section-transparent-header', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'tab' => __( 'Hover', 'astra' ), - 'title' => __( 'Hover / Active', 'astra' ), - 'responsive' => true, - 'rgba' => true, - ), - - /** - * Option: Content Section Link color. - */ - array( - 'name' => 'transparent-content-section-link-color-responsive', - 'default' => astra_get_option( 'transparent-content-section-link-color-responsive' ), - 'type' => 'sub-control', - 'priority' => 4, - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-content]', - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'control' => 'ast-responsive-color', - 'tab' => __( 'Normal', 'astra' ), - 'title' => __( 'Normal', 'astra' ), - 'responsive' => true, - 'rgba' => true, - ), - - /** - * Option: Content Section Link Hover color. - */ - array( - 'name' => 'transparent-content-section-link-h-color-responsive', - 'default' => astra_get_option( 'transparent-content-section-link-h-color-responsive' ), - 'type' => 'sub-control', - 'priority' => 4, - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-content]', - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'control' => 'ast-responsive-color', - 'tab' => __( 'Hover', 'astra' ), - 'title' => __( 'Hover', 'astra' ), - 'responsive' => true, - 'rgba' => true, - ), - ); - - return array_merge( $configurations, $_configs ); - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -new Astra_Customizer_Colors_Transparent_Header_Configs(); + ASTRA_THEME_SETTINGS . '[transparent-header-bg-color-responsive]', + 'default' => astra_get_option( 'transparent-header-bg-color-responsive' ), + 'section' => 'section-transparent-header', + 'type' => 'control', + 'priority' => 34, + 'transport' => 'postMessage', + 'control' => 'ast-responsive-color', + 'title' => __( 'Background Overlay', 'astra' ), + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + 'responsive' => true, + 'rgba' => true, + ), + + /** + * Option: Site Title Color + */ + array( + 'name' => 'transparent-header-color-site-title-responsive', + 'default' => astra_get_option( 'transparent-header-color-site-title-responsive' ), + 'type' => 'sub-control', + 'priority' => 1, + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors]', + 'section' => 'section-transparent-header', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'title' => __( 'Normal', 'astra' ), + 'tab' => __( 'Normal', 'astra' ), + 'responsive' => true, + 'rgba' => true, + ), + + /** + * Option: Site Title Hover Color + */ + array( + 'name' => 'transparent-header-color-h-site-title-responsive', + 'default' => astra_get_option( 'transparent-header-color-h-site-title-responsive' ), + 'type' => 'sub-control', + 'priority' => 1, + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors]', + 'section' => 'section-transparent-header', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'title' => __( 'Hover', 'astra' ), + 'tab' => __( 'Hover', 'astra' ), + 'responsive' => true, + 'rgba' => true, + ), + + /** + * Option: Primary Menu Color + */ + array( + 'name' => 'transparent-menu-color-responsive', + 'default' => astra_get_option( 'transparent-menu-color-responsive' ), + 'type' => 'sub-control', + 'priority' => 2, + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-menu]', + 'section' => 'section-transparent-header', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'tab' => __( 'Normal', 'astra' ), + 'title' => __( 'Normal', 'astra' ), + 'responsive' => true, + 'rgba' => true, + ), + + /** + * Option: Menu Background Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-menu-bg-color-responsive]', + 'default' => astra_get_option( 'transparent-menu-bg-color-responsive' ), + 'type' => 'control', + 'priority' => 36, + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'control' => 'ast-responsive-color', + 'tab' => __( 'Normal', 'astra' ), + 'title' => __( 'Background', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + ), + + /** + * Option: Menu Hover Color + */ + array( + 'name' => 'transparent-menu-h-color-responsive', + 'default' => astra_get_option( 'transparent-menu-h-color-responsive' ), + 'type' => 'sub-control', + 'priority' => 3, + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-menu]', + 'section' => 'section-transparent-header', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'tab' => __( 'Hover', 'astra' ), + 'title' => __( 'Hover / Active', 'astra' ), + 'responsive' => true, + 'rgba' => true, + ), + + /** + * Option: Sub menu text color. + */ + array( + 'name' => 'transparent-submenu-color-responsive', + 'default' => astra_get_option( 'transparent-submenu-color-responsive' ), + 'type' => 'sub-control', + 'priority' => 3, + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-submenu]', + 'section' => 'section-transparent-header', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'tab' => __( 'Normal', 'astra' ), + 'title' => __( 'Normal', 'astra' ), + 'responsive' => true, + 'rgba' => true, + ), + + /** + * Option: Sub menu background color. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-submenu-bg-color-responsive]', + 'default' => astra_get_option( 'transparent-submenu-bg-color-responsive' ), + 'type' => 'control', + 'priority' => 38, + 'section' => 'section-transparent-header', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'tab' => __( 'Normal', 'astra' ), + 'title' => __( 'Background', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + ), + + /** + * Option: Sub menu active hover color. + */ + array( + 'name' => 'transparent-submenu-h-color-responsive', + 'default' => astra_get_option( 'transparent-submenu-h-color-responsive' ), + 'type' => 'sub-control', + 'priority' => 3, + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-submenu]', + 'section' => 'section-transparent-header', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'tab' => __( 'Hover', 'astra' ), + 'title' => __( 'Hover / Active', 'astra' ), + 'responsive' => true, + 'rgba' => true, + ), + + /** + * Option: Content Section Link color. + */ + array( + 'name' => 'transparent-content-section-link-color-responsive', + 'default' => astra_get_option( 'transparent-content-section-link-color-responsive' ), + 'type' => 'sub-control', + 'priority' => 4, + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-content]', + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'control' => 'ast-responsive-color', + 'tab' => __( 'Normal', 'astra' ), + 'title' => __( 'Normal', 'astra' ), + 'responsive' => true, + 'rgba' => true, + ), + + /** + * Option: Content Section Link Hover color. + */ + array( + 'name' => 'transparent-content-section-link-h-color-responsive', + 'default' => astra_get_option( 'transparent-content-section-link-h-color-responsive' ), + 'type' => 'sub-control', + 'priority' => 4, + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-content]', + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'control' => 'ast-responsive-color', + 'tab' => __( 'Hover', 'astra' ), + 'title' => __( 'Hover', 'astra' ), + 'responsive' => true, + 'rgba' => true, + ), + ); + + return array_merge( $configurations, $_configs ); + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +new Astra_Customizer_Colors_Transparent_Header_Configs(); diff --git a/inc/addons/transparent-header/classes/sections/class-astra-customizer-transparent-header-configs.php b/inc/addons/transparent-header/classes/sections/class-astra-customizer-transparent-header-configs.php index fc820fb..693c2b2 100644 --- a/inc/addons/transparent-header/classes/sections/class-astra-customizer-transparent-header-configs.php +++ b/inc/addons/transparent-header/classes/sections/class-astra-customizer-transparent-header-configs.php @@ -1,1200 +1,1200 @@ - ASTRA_THEME_SETTINGS . '[transparent-header-enable]', - 'default' => astra_get_option( 'transparent-header-enable' ), - 'type' => 'control', - 'section' => $_section, - 'title' => __( 'Enable on Complete Website', 'astra' ), - 'priority' => 20, - 'control' => 'ast-toggle-control', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Disable Transparent Header on Archive Pages - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-archive]', - 'default' => astra_get_option( 'transparent-header-disable-archive' ), - 'type' => 'control', - 'section' => $_section, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', - 'operator' => '==', - 'value' => '1', - ), - ), - 'title' => __( 'Disable on 404, Search & Archives?', 'astra' ), - 'description' => __( 'This setting is generally not recommended on special pages such as archive, search, 404, etc. If you would like to enable it, uncheck this option', 'astra' ), - 'priority' => 25, - 'control' => 'ast-toggle-control', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Disable Transparent Header on Archive Pages - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-index]', - 'default' => astra_get_option( 'transparent-header-disable-index' ), - 'type' => 'control', - 'section' => $_section, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', - 'operator' => '==', - 'value' => '1', - ), - ), - 'title' => __( 'Disable on Blog page?', 'astra' ), - 'description' => __( 'Blog Page is when Latest Posts are selected to be displayed on a particular page.', 'astra' ), - 'priority' => 25, - 'control' => 'ast-toggle-control', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - - /** - * Option: Disable Transparent Header on Your latest posts index Page - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-latest-posts-index]', - 'default' => astra_get_option( 'transparent-header-disable-latest-posts-index' ), - 'type' => 'control', - 'section' => $_section, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', - 'operator' => '==', - 'value' => '1', - ), - ), - 'title' => __( 'Disable on Latest Posts Page?', 'astra' ), - 'description' => __( "Latest Posts page is your site's front page when the latest posts are displayed on the home page.", 'astra' ), - 'priority' => 25, - 'control' => 'ast-toggle-control', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - - /** - * Option: Disable Transparent Header on Pages - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-page]', - 'default' => astra_get_option( 'transparent-header-disable-page' ), - 'type' => 'control', - 'section' => $_section, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', - 'operator' => '==', - 'value' => '1', - ), - ), - 'title' => __( 'Disable on Pages?', 'astra' ), - 'priority' => 25, - 'control' => 'ast-toggle-control', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - - /** - * Option: Disable Transparent Header on Posts - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-posts]', - 'default' => astra_get_option( 'transparent-header-disable-posts' ), - 'type' => 'control', - 'section' => $_section, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', - 'operator' => '==', - 'value' => '1', - ), - ), - 'title' => __( 'Disable on Posts?', 'astra' ), - 'priority' => 25, - 'control' => 'ast-toggle-control', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Sticky Header Display On - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-on-devices]', - 'default' => astra_get_option( 'transparent-header-on-devices' ), - 'type' => 'control', - 'section' => $_section, - 'priority' => 27, - 'title' => __( 'Enable On', 'astra' ), - 'control' => 'ast-selector', - 'choices' => array( - 'desktop' => __( 'Desktop', 'astra' ), - 'mobile' => __( 'Mobile', 'astra' ), - 'both' => __( 'Desktop + Mobile', 'astra' ), - ), - 'responsive' => false, - 'renderAs' => 'text', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - - array( - 'name' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', - 'default' => astra_get_option( 'different-transparent-logo', false ), - 'type' => 'control', - 'section' => $_section, - 'title' => __( 'Different Logo for Transparent Header?', 'astra' ), - 'priority' => 30, - 'control' => 'ast-toggle-control', - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[different-transparent-logo-separator]', - 'type' => 'control', - 'section' => $_section, - 'settings' => array(), - 'priority' => 30, - 'control' => 'ast-divider', - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', - 'operator' => '==', - 'value' => true, - ), - ), - ), - - /** - * Option: Transparent header logo selector - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-logo]', - 'default' => astra_get_option( 'transparent-header-logo' ), - 'type' => 'control', - 'control' => 'image', - 'sanitize_callback' => 'esc_url_raw', - 'section' => $_section, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', - 'operator' => '==', - 'value' => true, - ), - ), - 'priority' => 30.1, - 'title' => __( 'Logo', 'astra' ), - 'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ), - 'partial' => array( - 'selector' => '.ast-replace-site-logo-transparent .site-branding .site-logo-img', - 'container_inclusive' => false, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Different retina logo - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[different-transparent-retina-logo]', - 'default' => astra_get_option( 'different-transparent-retina-logo' ), - 'type' => 'control', - 'section' => $_section, - 'title' => __( 'Different Logo For Retina Devices?', 'astra' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', - 'operator' => '==', - 'value' => true, - ), - ), - 'priority' => 30.2, - 'control' => 'ast-toggle-control', - 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), - ), - - /** - * Option: Transparent header logo selector - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-retina-logo]', - 'default' => astra_get_option( 'transparent-header-retina-logo' ), - 'type' => 'control', - 'control' => 'image', - 'sanitize_callback' => 'esc_url_raw', - 'section' => $_section, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-retina-logo]', - 'operator' => '==', - 'value' => true, - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', - 'operator' => '==', - 'value' => true, - ), - ), - 'priority' => 30.3, - 'title' => __( 'Retina Logo', 'astra' ), - 'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Transparent header logo width - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-logo-width]', - 'default' => astra_get_option( 'transparent-header-logo-width' ), - 'type' => 'control', - 'transport' => 'postMessage', - 'control' => 'ast-responsive-slider', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), - 'section' => $_section, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', - 'operator' => '==', - 'value' => true, - ), - ), - 'suffix' => 'px', - 'priority' => 30.4, - 'title' => __( 'Logo Width', 'astra' ), - 'input_attrs' => array( - 'min' => 50, - 'step' => 1, - 'max' => 600, - ), - ), - - /** - * Option: Bottom Border Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-main-sep]', - 'default' => astra_get_option( 'transparent-header-main-sep' ), - 'type' => 'control', - 'transport' => 'postMessage', - 'control' => 'ast-slider', - 'section' => $_section, - 'priority' => 32, - 'title' => __( 'Bottom Border Size', 'astra' ), - 'suffix' => 'px', - 'input_attrs' => array( - 'min' => 0, - 'step' => 1, - 'max' => 600, - ), - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - ), - - /** - * Option: Bottom Border Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-main-sep-color]', - 'default' => astra_get_option( 'transparent-header-main-sep-color' ), - 'type' => 'control', - 'transport' => 'postMessage', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'section' => $_section, - 'priority' => 32, - 'title' => __( 'Bottom Border Color', 'astra' ), - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-main-sep]', - 'operator' => '>=', - 'value' => 1, - ), - ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, - ), - ), - - /** - * Option: Transparent Header Styling - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[divider-sec-transparent-styling]', - 'type' => 'control', - 'control' => 'ast-heading', - 'section' => $_section, - 'title' => __( 'Colors & Background', 'astra' ), - 'priority' => 32, - 'settings' => array(), - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors]', - 'default' => astra_get_option( 'transparent-header-colors' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Site Title', 'astra' ), - 'section' => $_section, - 'transport' => 'postMessage', - 'priority' => 34, - 'context' => ( Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - 'responsive' => true, - 'divider' => array( 'ast_class' => 'ast-top-divider' ), - ), - - - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-menu]', - 'default' => astra_get_option( 'transparent-header-colors-menu' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Text / Link', 'astra' ), - 'section' => $_section, - 'transport' => 'postMessage', - 'priority' => 35, - 'context' => ( Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - 'responsive' => true, - 'divider' => array( - 'ast_class' => 'ast-top-divider', - 'ast_title' => __( 'Menu Color', 'astra' ), - ), - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-submenu]', - 'default' => astra_get_option( 'transparent-header-colors-submenu' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Text / Link', 'astra' ), - 'section' => $_section, - 'transport' => 'postMessage', - 'priority' => 37, - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - 'responsive' => true, - 'divider' => array( - 'ast_class' => 'ast-top-divider', - 'ast_title' => __( 'Submenu Color', 'astra' ), - ), - ), - ); - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - $_hfb_configs = array( - /** - * Option: Header Builder Tabs - */ - array( - 'name' => $_section . '-ast-context-tabs', - 'section' => $_section, - 'type' => 'control', - 'control' => 'ast-builder-header-control', - 'priority' => 0, - 'description' => '', - ), - - /** - * Option: Transparent Header Builder - Social Element configs. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-social-text-colors-content]', - 'default' => astra_get_option( 'transparent-header-social-colors-content' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Text', 'astra' ), - 'section' => $_section, - 'transport' => 'postMessage', - 'priority' => 40, - 'context' => Astra_Builder_Helper::$design_tab, - 'responsive' => true, - 'divider' => array( - 'ast_class' => 'ast-top-divider', - 'ast_title' => __( 'Social Color', 'astra' ), - ), - ), - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-social-background-colors-content]', - 'default' => astra_get_option( 'transparent-header-social-colors-content' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Background', 'astra' ), - 'section' => $_section, - 'transport' => 'postMessage', - 'priority' => 40, - 'context' => Astra_Builder_Helper::$design_tab, - 'responsive' => true, - ), - - - /** - * Option: Social Text Color - */ - array( - 'name' => 'transparent-header-social-icons-color', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'transparent-header-social-icons-color' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-text-colors-content]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Normal', 'astra' ), - 'control' => 'ast-responsive-color', - 'responsive' => true, - 'rgba' => true, - 'priority' => 5, - 'context' => Astra_Builder_Helper::$design_tab, - 'title' => __( 'Normal', 'astra' ), - ), - - /** - * Option: Social Text Hover Color - */ - array( - 'name' => 'transparent-header-social-icons-h-color', - 'default' => astra_get_option( 'transparent-header-social-icons-h-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-text-colors-content]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Hover', 'astra' ), - 'control' => 'ast-responsive-color', - 'responsive' => true, - 'rgba' => true, - 'priority' => 7, - 'context' => Astra_Builder_Helper::$design_tab, - 'title' => __( 'Hover', 'astra' ), - ), - - /** - * Option: Social Background Color - */ - array( - 'name' => 'transparent-header-social-icons-bg-color', - 'default' => astra_get_option( 'transparent-header-social-icons-bg-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-background-colors-content]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Normal', 'astra' ), - 'control' => 'ast-responsive-color', - 'responsive' => true, - 'rgba' => true, - 'priority' => 9, - 'context' => Astra_Builder_Helper::$design_tab, - 'title' => __( 'Normal', 'astra' ), - ), - - /** - * Option: Social Background Hover Color - */ - array( - 'name' => 'transparent-header-social-icons-bg-h-color', - 'default' => astra_get_option( 'transparent-header-social-icons-bg-h-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-background-colors-content]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Hover', 'astra' ), - 'control' => 'ast-responsive-color', - 'responsive' => true, - 'rgba' => true, - 'priority' => 11, - 'context' => Astra_Builder_Helper::$design_tab, - 'title' => __( 'Hover', 'astra' ), - ), - - /** - * Option: Transparent Header Builder - HTML Elements configs. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-html-colors-group]', - 'default' => astra_get_option( 'transparent-header-html-colors-group' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Link', 'astra' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 75, - 'context' => Astra_Builder_Helper::$design_tab, - ), - - // Option: HTML Text Color. - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-html-text-color]', - 'default' => astra_get_option( 'transparent-header-html-text-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 74, - 'title' => __( 'Text', 'astra' ), - 'context' => Astra_Builder_Helper::$design_tab, - 'divider' => array( - 'ast_class' => 'ast-top-divider', - 'ast_title' => __( 'HTML Color', 'astra' ), - ), - ), - - // Option: HTML Link Color. - array( - 'name' => 'transparent-header-html-link-color', - 'default' => astra_get_option( 'transparent-header-html-link-color' ), - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-html-colors-group]', - 'type' => 'sub-control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 5, - 'title' => __( 'Normal', 'astra' ), - 'context' => Astra_Builder_Helper::$general_tab, - ), - - // Option: HTML Link Hover Color. - array( - 'name' => 'transparent-header-html-link-h-color', - 'default' => astra_get_option( 'transparent-header-html-link-h-color' ), - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-html-colors-group]', - 'type' => 'sub-control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 5, - 'title' => __( 'Hover', 'astra' ), - 'context' => Astra_Builder_Helper::$general_tab, - ), - - /** - * Option: Transparent Header Builder - Search Elements configs. - */ - - // Option: Search Color. - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-search-icon-color]', - 'default' => astra_get_option( 'transparent-header-search-icon-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 45, - 'title' => __( 'Icon', 'astra' ), - 'context' => Astra_Builder_Helper::$design_tab, - - 'divider' => array( - 'ast_class' => 'ast-top-divider', - 'ast_title' => __( 'Search Color', 'astra' ), - ), - ), - - /** - * Search Box Background Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-search-box-background-color]', - 'default' => astra_get_option( 'transparent-header-search-box-background-color' ), - 'type' => 'control', - 'section' => 'section-transparent-header', - 'priority' => 45, - 'transport' => 'postMessage', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'title' => __( 'Box Background', 'astra' ), - 'context' => array( - Astra_Builder_Helper::$design_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-search-box-type]', - 'operator' => 'in', - 'value' => array( 'slide-search', 'search-box' ), - ), - ), - ), - - /** - * Option: Transparent Header Builder - Widget Elements configs. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-link-colors-group]', - 'default' => astra_get_option( 'transparent-header-widget-colors-group' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Link', 'astra' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 50, - 'context' => Astra_Builder_Helper::$design_tab, - ), - - // Option: Widget Title Color. - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-title-color]', - 'default' => astra_get_option( 'transparent-header-widget-title-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 49, - 'title' => __( 'Title', 'astra' ), - 'context' => Astra_Builder_Helper::$design_tab, - 'divider' => array( - 'ast_class' => 'ast-top-divider', - 'ast_title' => __( 'Widget Color', 'astra' ), - ), - ), - - // Option: Widget Content Color. - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-content-color]', - 'default' => astra_get_option( 'transparent-header-widget-content-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 49, - 'title' => __( 'Content', 'astra' ), - 'context' => Astra_Builder_Helper::$design_tab, - ), - - // Option: Widget Link Color. - array( - 'name' => 'transparent-header-widget-link-color', - 'default' => astra_get_option( 'transparent-header-widget-link-color' ), - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-link-colors-group]', - 'type' => 'sub-control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 15, - 'tab' => __( 'Normal', 'astra' ), - 'title' => __( 'Normal', 'astra' ), - 'context' => Astra_Builder_Helper::$general_tab, - ), - - // Option: Widget Link Hover Color. - array( - 'name' => 'transparent-header-widget-link-h-color', - 'default' => astra_get_option( 'transparent-header-widget-link-h-color' ), - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-link-colors-group]', - 'type' => 'sub-control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'tab' => __( 'Hover', 'astra' ), - 'priority' => 20, - 'title' => __( 'Hover', 'astra' ), - 'context' => Astra_Builder_Helper::$general_tab, - ), - - /** - * Group: Transparent Header Button Colors Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-text-group]', - 'default' => astra_get_option( 'transparent-header-buttons-group' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Text', 'astra' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 60, - 'context' => Astra_Builder_Helper::$design_tab, - 'divider' => array( - 'ast_class' => 'ast-top-divider', - 'ast_title' => __( 'HTML Color', 'astra' ), - ), - ), - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-background-group]', - 'default' => astra_get_option( 'transparent-header-buttons-group' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Background', 'astra' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 60, - 'context' => Astra_Builder_Helper::$design_tab, - ), - - /** - * Option: Button Text Color - */ - array( - 'name' => 'transparent-header-button-text-color', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'transparent-header-button-text-color' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-text-group]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Normal', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 5, - 'title' => __( 'Normal', 'astra' ), - ), - - /** - * Option: Button Text Hover Color - */ - array( - 'name' => 'transparent-header-button-text-h-color', - 'default' => astra_get_option( 'transparent-header-button-text-h-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-text-group]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Hover', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 7, - 'title' => __( 'Hover', 'astra' ), - ), - - /** - * Option: Button Background Color - */ - array( - 'name' => 'transparent-header-button-bg-color', - 'default' => astra_get_option( 'transparent-header-button-bg-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-background-group]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Normal', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 9, - 'title' => __( 'Normal', 'astra' ), - ), - - /** - * Option: Button Button Hover Color - */ - array( - 'name' => 'transparent-header-button-bg-h-color', - 'default' => astra_get_option( 'transparent-header-button-bg-h-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-background-group]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Hover', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 11, - 'title' => __( 'Hover', 'astra' ), - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-account-icon-color]', - 'default' => astra_get_option( 'transparent-account-icon-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 65, - 'title' => __( 'Icon', 'astra' ), - 'divider' => array( - 'ast_class' => 'ast-top-divider', - 'ast_title' => __( 'Account', 'astra' ), - ), - 'context' => array( - Astra_Builder_Helper::$design_tab_config, - array( - 'relation' => 'OR', - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]', - 'operator' => '==', - 'value' => 'icon', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]', - 'operator' => '==', - 'value' => 'text', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]', - 'operator' => '!=', - 'value' => 'none', - ), - ), - ), - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-account-type-text-color]', - 'default' => astra_get_option( 'transparent-account-type-text-color' ), - 'type' => 'control', - 'section' => $_section, - 'priority' => 65, - 'transport' => 'postMessage', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'title' => __( 'Text', 'astra' ), - 'context' => array( - Astra_Builder_Helper::$design_tab_config, - array( - 'relation' => 'OR', - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]', - 'operator' => '==', - 'value' => 'icon', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]', - 'operator' => '==', - 'value' => 'text', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]', - 'operator' => '!=', - 'value' => 'none', - ), - ), - ), - ), - - /** - * Option: Toggle Button Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-toggle-btn-color]', - 'default' => astra_get_option( 'transparent-header-toggle-btn-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'title' => __( 'Icon', 'astra' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 70, - 'context' => Astra_Builder_Helper::$design_tab, - 'divider' => array( - 'ast_class' => 'ast-top-divider', - 'ast_title' => __( 'Toggle Color', 'astra' ), - ), - ), - - /** - * Option: Toggle Button Bg Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-toggle-btn-bg-color]', - 'default' => astra_get_option( 'transparent-header-toggle-btn-bg-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'title' => __( 'Background', 'astra' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 70, - 'context' => Astra_Builder_Helper::$design_tab, - ), - - /** - * Option: Toggle Button Border Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-toggle-border-color]', - 'default' => astra_get_option( 'transparent-header-toggle-border-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'title' => __( 'Border', 'astra' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 70, - 'context' => Astra_Builder_Helper::$design_tab, - ), - ); - - $_configs = array_merge( $_configs, $_hfb_configs ); - - } else { - $_old_content_configs = array( - - /** - * Option: Content Section Text color. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-content-section-text-color-responsive]', - 'default' => astra_get_option( 'transparent-content-section-text-color-responsive' ), - 'type' => 'control', - 'priority' => 39, - 'section' => $_section, - 'transport' => 'postMessage', - 'control' => 'ast-responsive-color', - 'title' => __( 'Text', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'divider' => array( - 'ast_class' => 'ast-top-divider', - 'ast_title' => __( 'Content', 'astra' ), - ), - ), - /** - * Option: Header Builder Tabs - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-content]', - 'default' => astra_get_option( 'transparent-header-colors-content' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Link', 'astra' ), - 'section' => $_section, - 'transport' => 'postMessage', - 'priority' => 39, - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - 'responsive' => true, - ), - ); - - $_configs = array_merge( $_configs, $_old_content_configs ); - } - - if ( defined( 'ASTRA_EXT_VER' ) && ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ) { - - $pro_elements_transparent_config = array( - - /** - * Search Box Background Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-search-box-placeholder-color]', - 'default' => astra_get_option( 'transparent-header-search-box-placeholder-color' ), - 'type' => 'control', - 'section' => 'section-transparent-header', - 'priority' => 45, - 'transport' => 'postMessage', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'title' => __( 'Text / Placeholder', 'astra' ), - 'context' => array( - Astra_Builder_Helper::$design_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-search-box-type]', - 'operator' => 'in', - 'value' => array( 'slide-search', 'search-box' ), - ), - ), - ), - - /** - * Option: Transparent Header Builder - Divider Elements configs. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-divider-color]', - 'default' => astra_get_option( 'transparent-header-divider-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'transport' => 'postMessage', - 'priority' => 64, - 'title' => __( 'Divider', 'astra' ), - 'section' => 'section-transparent-header', - 'context' => Astra_Builder_Helper::$design_tab, - 'divider' => array( 'ast_class' => 'ast-top-divider' ), - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', - 'default' => astra_get_option( 'transparent-account-menu-colors' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Account Menu Color', 'astra' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 66, - 'context' => array( - Astra_Builder_Helper::$design_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-account-action-type]', - 'operator' => '==', - 'value' => 'menu', - ), - ), - ), - - // Option: Menu Color. - array( - 'name' => 'transparent-account-menu-color-responsive', - 'default' => astra_get_option( 'transparent-account-menu-color-responsive' ), - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', - 'type' => 'sub-control', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'tab' => __( 'Normal', 'astra' ), - 'section' => 'section-transparent-header', - 'title' => __( 'Link / Text Color', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'priority' => 7, - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-account-action-type]', - 'operator' => '==', - 'value' => 'menu', - ), - Astra_Builder_Helper::$design_tab, - ), - ), - - // Option: Background Color. - array( - 'name' => 'transparent-account-menu-bg-obj-responsive', - 'default' => astra_get_option( 'transparent-account-menu-bg-obj-responsive' ), - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', - 'type' => 'sub-control', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'section' => 'section-transparent-header', - 'title' => __( 'Background Color', 'astra' ), - 'tab' => __( 'Normal', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'priority' => 8, - 'context' => Astra_Builder_Helper::$design_tab, - ), - - // Option: Menu Hover Color. - array( - 'name' => 'transparent-account-menu-h-color-responsive', - 'default' => astra_get_option( 'transparent-account-menu-h-color-responsive' ), - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', - 'tab' => __( 'Hover', 'astra' ), - 'type' => 'sub-control', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'title' => __( 'Link Color', 'astra' ), - 'section' => 'section-transparent-header', - 'responsive' => true, - 'rgba' => true, - 'priority' => 19, - 'context' => Astra_Builder_Helper::$design_tab, - ), - - // Option: Menu Hover Background Color. - array( - 'name' => 'transparent-account-menu-h-bg-color-responsive', - 'default' => astra_get_option( 'transparent-account-menu-h-bg-color-responsive' ), - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', - 'type' => 'sub-control', - 'title' => __( 'Background Color', 'astra' ), - 'section' => 'section-transparent-header', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'tab' => __( 'Hover', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'priority' => 21, - 'context' => Astra_Builder_Helper::$design_tab, - ), - - // Option: Active Menu Color. - array( - 'name' => 'transparent-account-menu-a-color-responsive', - 'default' => astra_get_option( 'transparent-account-menu-a-color-responsive' ), - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', - 'type' => 'sub-control', - 'section' => 'section-transparent-header', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'tab' => __( 'Active', 'astra' ), - 'title' => __( 'Link Color', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'priority' => 31, - 'context' => Astra_Builder_Helper::$design_tab, - ), - - // Option: Active Menu Background Color. - array( - 'name' => 'transparent-account-menu-a-bg-color-responsive', - 'default' => astra_get_option( 'transparent-account-menu-a-bg-color-responsive' ), - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', - 'type' => 'sub-control', - 'control' => 'ast-responsive-color', - 'transport' => 'postMessage', - 'section' => 'section-transparent-header', - 'title' => __( 'Background Color', 'astra' ), - 'tab' => __( 'Active', 'astra' ), - 'responsive' => true, - 'rgba' => true, - 'priority' => 33, - 'context' => Astra_Builder_Helper::$design_tab, - ), - ); - - $_configs = array_merge( $_configs, $pro_elements_transparent_config ); - } - - return array_merge( $configurations, $_configs ); - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -new Astra_Customizer_Transparent_Header_Configs(); + ASTRA_THEME_SETTINGS . '[transparent-header-enable]', + 'default' => astra_get_option( 'transparent-header-enable' ), + 'type' => 'control', + 'section' => $_section, + 'title' => __( 'Enable on Complete Website', 'astra' ), + 'priority' => 20, + 'control' => 'ast-toggle-control', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Disable Transparent Header on Archive Pages + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-archive]', + 'default' => astra_get_option( 'transparent-header-disable-archive' ), + 'type' => 'control', + 'section' => $_section, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', + 'operator' => '==', + 'value' => '1', + ), + ), + 'title' => __( 'Disable on 404, Search & Archives?', 'astra' ), + 'description' => __( 'This setting is generally not recommended on special pages such as archive, search, 404, etc. If you would like to enable it, uncheck this option', 'astra' ), + 'priority' => 25, + 'control' => 'ast-toggle-control', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Disable Transparent Header on Archive Pages + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-index]', + 'default' => astra_get_option( 'transparent-header-disable-index' ), + 'type' => 'control', + 'section' => $_section, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', + 'operator' => '==', + 'value' => '1', + ), + ), + 'title' => __( 'Disable on Blog page?', 'astra' ), + 'description' => __( 'Blog Page is when Latest Posts are selected to be displayed on a particular page.', 'astra' ), + 'priority' => 25, + 'control' => 'ast-toggle-control', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + + /** + * Option: Disable Transparent Header on Your latest posts index Page + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-latest-posts-index]', + 'default' => astra_get_option( 'transparent-header-disable-latest-posts-index' ), + 'type' => 'control', + 'section' => $_section, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', + 'operator' => '==', + 'value' => '1', + ), + ), + 'title' => __( 'Disable on Latest Posts Page?', 'astra' ), + 'description' => __( "Latest Posts page is your site's front page when the latest posts are displayed on the home page.", 'astra' ), + 'priority' => 25, + 'control' => 'ast-toggle-control', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + + /** + * Option: Disable Transparent Header on Pages + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-page]', + 'default' => astra_get_option( 'transparent-header-disable-page' ), + 'type' => 'control', + 'section' => $_section, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', + 'operator' => '==', + 'value' => '1', + ), + ), + 'title' => __( 'Disable on Pages?', 'astra' ), + 'priority' => 25, + 'control' => 'ast-toggle-control', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + + /** + * Option: Disable Transparent Header on Posts + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-posts]', + 'default' => astra_get_option( 'transparent-header-disable-posts' ), + 'type' => 'control', + 'section' => $_section, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', + 'operator' => '==', + 'value' => '1', + ), + ), + 'title' => __( 'Disable on Posts?', 'astra' ), + 'priority' => 25, + 'control' => 'ast-toggle-control', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Sticky Header Display On + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-on-devices]', + 'default' => astra_get_option( 'transparent-header-on-devices' ), + 'type' => 'control', + 'section' => $_section, + 'priority' => 27, + 'title' => __( 'Enable On', 'astra' ), + 'control' => 'ast-selector', + 'choices' => array( + 'desktop' => __( 'Desktop', 'astra' ), + 'mobile' => __( 'Mobile', 'astra' ), + 'both' => __( 'Desktop + Mobile', 'astra' ), + ), + 'responsive' => false, + 'renderAs' => 'text', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + + array( + 'name' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', + 'default' => astra_get_option( 'different-transparent-logo', false ), + 'type' => 'control', + 'section' => $_section, + 'title' => __( 'Different Logo for Transparent Header?', 'astra' ), + 'priority' => 30, + 'control' => 'ast-toggle-control', + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[different-transparent-logo-separator]', + 'type' => 'control', + 'section' => $_section, + 'settings' => array(), + 'priority' => 30, + 'control' => 'ast-divider', + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', + 'operator' => '==', + 'value' => true, + ), + ), + ), + + /** + * Option: Transparent header logo selector + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-logo]', + 'default' => astra_get_option( 'transparent-header-logo' ), + 'type' => 'control', + 'control' => 'image', + 'sanitize_callback' => 'esc_url_raw', + 'section' => $_section, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', + 'operator' => '==', + 'value' => true, + ), + ), + 'priority' => 30.1, + 'title' => __( 'Logo', 'astra' ), + 'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ), + 'partial' => array( + 'selector' => '.ast-replace-site-logo-transparent .site-branding .site-logo-img', + 'container_inclusive' => false, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Different retina logo + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[different-transparent-retina-logo]', + 'default' => astra_get_option( 'different-transparent-retina-logo' ), + 'type' => 'control', + 'section' => $_section, + 'title' => __( 'Different Logo For Retina Devices?', 'astra' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', + 'operator' => '==', + 'value' => true, + ), + ), + 'priority' => 30.2, + 'control' => 'ast-toggle-control', + 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), + ), + + /** + * Option: Transparent header logo selector + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-retina-logo]', + 'default' => astra_get_option( 'transparent-header-retina-logo' ), + 'type' => 'control', + 'control' => 'image', + 'sanitize_callback' => 'esc_url_raw', + 'section' => $_section, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-retina-logo]', + 'operator' => '==', + 'value' => true, + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', + 'operator' => '==', + 'value' => true, + ), + ), + 'priority' => 30.3, + 'title' => __( 'Retina Logo', 'astra' ), + 'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Transparent header logo width + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-logo-width]', + 'default' => astra_get_option( 'transparent-header-logo-width' ), + 'type' => 'control', + 'transport' => 'postMessage', + 'control' => 'ast-responsive-slider', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), + 'section' => $_section, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', + 'operator' => '==', + 'value' => true, + ), + ), + 'suffix' => 'px', + 'priority' => 30.4, + 'title' => __( 'Logo Width', 'astra' ), + 'input_attrs' => array( + 'min' => 50, + 'step' => 1, + 'max' => 600, + ), + ), + + /** + * Option: Bottom Border Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-main-sep]', + 'default' => astra_get_option( 'transparent-header-main-sep' ), + 'type' => 'control', + 'transport' => 'postMessage', + 'control' => 'ast-slider', + 'section' => $_section, + 'priority' => 32, + 'title' => __( 'Bottom Border Size', 'astra' ), + 'suffix' => 'px', + 'input_attrs' => array( + 'min' => 0, + 'step' => 1, + 'max' => 600, + ), + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + ), + + /** + * Option: Bottom Border Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-main-sep-color]', + 'default' => astra_get_option( 'transparent-header-main-sep-color' ), + 'type' => 'control', + 'transport' => 'postMessage', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'section' => $_section, + 'priority' => 32, + 'title' => __( 'Bottom Border Color', 'astra' ), + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-main-sep]', + 'operator' => '>=', + 'value' => 1, + ), + ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, + ), + ), + + /** + * Option: Transparent Header Styling + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[divider-sec-transparent-styling]', + 'type' => 'control', + 'control' => 'ast-heading', + 'section' => $_section, + 'title' => __( 'Colors & Background', 'astra' ), + 'priority' => 32, + 'settings' => array(), + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors]', + 'default' => astra_get_option( 'transparent-header-colors' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Site Title', 'astra' ), + 'section' => $_section, + 'transport' => 'postMessage', + 'priority' => 34, + 'context' => ( Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + 'responsive' => true, + 'divider' => array( 'ast_class' => 'ast-top-divider' ), + ), + + + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-menu]', + 'default' => astra_get_option( 'transparent-header-colors-menu' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Text / Link', 'astra' ), + 'section' => $_section, + 'transport' => 'postMessage', + 'priority' => 35, + 'context' => ( Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + 'responsive' => true, + 'divider' => array( + 'ast_class' => 'ast-top-divider', + 'ast_title' => __( 'Menu Color', 'astra' ), + ), + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-submenu]', + 'default' => astra_get_option( 'transparent-header-colors-submenu' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Text / Link', 'astra' ), + 'section' => $_section, + 'transport' => 'postMessage', + 'priority' => 37, + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + 'responsive' => true, + 'divider' => array( + 'ast_class' => 'ast-top-divider', + 'ast_title' => __( 'Submenu Color', 'astra' ), + ), + ), + ); + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + $_hfb_configs = array( + /** + * Option: Header Builder Tabs + */ + array( + 'name' => $_section . '-ast-context-tabs', + 'section' => $_section, + 'type' => 'control', + 'control' => 'ast-builder-header-control', + 'priority' => 0, + 'description' => '', + ), + + /** + * Option: Transparent Header Builder - Social Element configs. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-social-text-colors-content]', + 'default' => astra_get_option( 'transparent-header-social-colors-content' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Text', 'astra' ), + 'section' => $_section, + 'transport' => 'postMessage', + 'priority' => 40, + 'context' => Astra_Builder_Helper::$design_tab, + 'responsive' => true, + 'divider' => array( + 'ast_class' => 'ast-top-divider', + 'ast_title' => __( 'Social Color', 'astra' ), + ), + ), + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-social-background-colors-content]', + 'default' => astra_get_option( 'transparent-header-social-colors-content' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Background', 'astra' ), + 'section' => $_section, + 'transport' => 'postMessage', + 'priority' => 40, + 'context' => Astra_Builder_Helper::$design_tab, + 'responsive' => true, + ), + + + /** + * Option: Social Text Color + */ + array( + 'name' => 'transparent-header-social-icons-color', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'transparent-header-social-icons-color' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-text-colors-content]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Normal', 'astra' ), + 'control' => 'ast-responsive-color', + 'responsive' => true, + 'rgba' => true, + 'priority' => 5, + 'context' => Astra_Builder_Helper::$design_tab, + 'title' => __( 'Normal', 'astra' ), + ), + + /** + * Option: Social Text Hover Color + */ + array( + 'name' => 'transparent-header-social-icons-h-color', + 'default' => astra_get_option( 'transparent-header-social-icons-h-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-text-colors-content]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Hover', 'astra' ), + 'control' => 'ast-responsive-color', + 'responsive' => true, + 'rgba' => true, + 'priority' => 7, + 'context' => Astra_Builder_Helper::$design_tab, + 'title' => __( 'Hover', 'astra' ), + ), + + /** + * Option: Social Background Color + */ + array( + 'name' => 'transparent-header-social-icons-bg-color', + 'default' => astra_get_option( 'transparent-header-social-icons-bg-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-background-colors-content]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Normal', 'astra' ), + 'control' => 'ast-responsive-color', + 'responsive' => true, + 'rgba' => true, + 'priority' => 9, + 'context' => Astra_Builder_Helper::$design_tab, + 'title' => __( 'Normal', 'astra' ), + ), + + /** + * Option: Social Background Hover Color + */ + array( + 'name' => 'transparent-header-social-icons-bg-h-color', + 'default' => astra_get_option( 'transparent-header-social-icons-bg-h-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-background-colors-content]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Hover', 'astra' ), + 'control' => 'ast-responsive-color', + 'responsive' => true, + 'rgba' => true, + 'priority' => 11, + 'context' => Astra_Builder_Helper::$design_tab, + 'title' => __( 'Hover', 'astra' ), + ), + + /** + * Option: Transparent Header Builder - HTML Elements configs. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-html-colors-group]', + 'default' => astra_get_option( 'transparent-header-html-colors-group' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Link', 'astra' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 75, + 'context' => Astra_Builder_Helper::$design_tab, + ), + + // Option: HTML Text Color. + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-html-text-color]', + 'default' => astra_get_option( 'transparent-header-html-text-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 74, + 'title' => __( 'Text', 'astra' ), + 'context' => Astra_Builder_Helper::$design_tab, + 'divider' => array( + 'ast_class' => 'ast-top-divider', + 'ast_title' => __( 'HTML Color', 'astra' ), + ), + ), + + // Option: HTML Link Color. + array( + 'name' => 'transparent-header-html-link-color', + 'default' => astra_get_option( 'transparent-header-html-link-color' ), + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-html-colors-group]', + 'type' => 'sub-control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 5, + 'title' => __( 'Normal', 'astra' ), + 'context' => Astra_Builder_Helper::$general_tab, + ), + + // Option: HTML Link Hover Color. + array( + 'name' => 'transparent-header-html-link-h-color', + 'default' => astra_get_option( 'transparent-header-html-link-h-color' ), + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-html-colors-group]', + 'type' => 'sub-control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 5, + 'title' => __( 'Hover', 'astra' ), + 'context' => Astra_Builder_Helper::$general_tab, + ), + + /** + * Option: Transparent Header Builder - Search Elements configs. + */ + + // Option: Search Color. + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-search-icon-color]', + 'default' => astra_get_option( 'transparent-header-search-icon-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 45, + 'title' => __( 'Icon', 'astra' ), + 'context' => Astra_Builder_Helper::$design_tab, + + 'divider' => array( + 'ast_class' => 'ast-top-divider', + 'ast_title' => __( 'Search Color', 'astra' ), + ), + ), + + /** + * Search Box Background Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-search-box-background-color]', + 'default' => astra_get_option( 'transparent-header-search-box-background-color' ), + 'type' => 'control', + 'section' => 'section-transparent-header', + 'priority' => 45, + 'transport' => 'postMessage', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'title' => __( 'Box Background', 'astra' ), + 'context' => array( + Astra_Builder_Helper::$design_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-search-box-type]', + 'operator' => 'in', + 'value' => array( 'slide-search', 'search-box' ), + ), + ), + ), + + /** + * Option: Transparent Header Builder - Widget Elements configs. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-link-colors-group]', + 'default' => astra_get_option( 'transparent-header-widget-colors-group' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Link', 'astra' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 50, + 'context' => Astra_Builder_Helper::$design_tab, + ), + + // Option: Widget Title Color. + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-title-color]', + 'default' => astra_get_option( 'transparent-header-widget-title-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 49, + 'title' => __( 'Title', 'astra' ), + 'context' => Astra_Builder_Helper::$design_tab, + 'divider' => array( + 'ast_class' => 'ast-top-divider', + 'ast_title' => __( 'Widget Color', 'astra' ), + ), + ), + + // Option: Widget Content Color. + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-content-color]', + 'default' => astra_get_option( 'transparent-header-widget-content-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 49, + 'title' => __( 'Content', 'astra' ), + 'context' => Astra_Builder_Helper::$design_tab, + ), + + // Option: Widget Link Color. + array( + 'name' => 'transparent-header-widget-link-color', + 'default' => astra_get_option( 'transparent-header-widget-link-color' ), + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-link-colors-group]', + 'type' => 'sub-control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 15, + 'tab' => __( 'Normal', 'astra' ), + 'title' => __( 'Normal', 'astra' ), + 'context' => Astra_Builder_Helper::$general_tab, + ), + + // Option: Widget Link Hover Color. + array( + 'name' => 'transparent-header-widget-link-h-color', + 'default' => astra_get_option( 'transparent-header-widget-link-h-color' ), + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-link-colors-group]', + 'type' => 'sub-control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'tab' => __( 'Hover', 'astra' ), + 'priority' => 20, + 'title' => __( 'Hover', 'astra' ), + 'context' => Astra_Builder_Helper::$general_tab, + ), + + /** + * Group: Transparent Header Button Colors Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-text-group]', + 'default' => astra_get_option( 'transparent-header-buttons-group' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Text', 'astra' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 60, + 'context' => Astra_Builder_Helper::$design_tab, + 'divider' => array( + 'ast_class' => 'ast-top-divider', + 'ast_title' => __( 'HTML Color', 'astra' ), + ), + ), + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-background-group]', + 'default' => astra_get_option( 'transparent-header-buttons-group' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Background', 'astra' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 60, + 'context' => Astra_Builder_Helper::$design_tab, + ), + + /** + * Option: Button Text Color + */ + array( + 'name' => 'transparent-header-button-text-color', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'transparent-header-button-text-color' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-text-group]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Normal', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 5, + 'title' => __( 'Normal', 'astra' ), + ), + + /** + * Option: Button Text Hover Color + */ + array( + 'name' => 'transparent-header-button-text-h-color', + 'default' => astra_get_option( 'transparent-header-button-text-h-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-text-group]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Hover', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 7, + 'title' => __( 'Hover', 'astra' ), + ), + + /** + * Option: Button Background Color + */ + array( + 'name' => 'transparent-header-button-bg-color', + 'default' => astra_get_option( 'transparent-header-button-bg-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-background-group]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Normal', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 9, + 'title' => __( 'Normal', 'astra' ), + ), + + /** + * Option: Button Button Hover Color + */ + array( + 'name' => 'transparent-header-button-bg-h-color', + 'default' => astra_get_option( 'transparent-header-button-bg-h-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-background-group]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Hover', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 11, + 'title' => __( 'Hover', 'astra' ), + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-account-icon-color]', + 'default' => astra_get_option( 'transparent-account-icon-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 65, + 'title' => __( 'Icon', 'astra' ), + 'divider' => array( + 'ast_class' => 'ast-top-divider', + 'ast_title' => __( 'Account', 'astra' ), + ), + 'context' => array( + Astra_Builder_Helper::$design_tab_config, + array( + 'relation' => 'OR', + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]', + 'operator' => '==', + 'value' => 'icon', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]', + 'operator' => '==', + 'value' => 'text', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]', + 'operator' => '!=', + 'value' => 'none', + ), + ), + ), + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-account-type-text-color]', + 'default' => astra_get_option( 'transparent-account-type-text-color' ), + 'type' => 'control', + 'section' => $_section, + 'priority' => 65, + 'transport' => 'postMessage', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'title' => __( 'Text', 'astra' ), + 'context' => array( + Astra_Builder_Helper::$design_tab_config, + array( + 'relation' => 'OR', + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]', + 'operator' => '==', + 'value' => 'icon', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]', + 'operator' => '==', + 'value' => 'text', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]', + 'operator' => '!=', + 'value' => 'none', + ), + ), + ), + ), + + /** + * Option: Toggle Button Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-toggle-btn-color]', + 'default' => astra_get_option( 'transparent-header-toggle-btn-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'title' => __( 'Icon', 'astra' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 70, + 'context' => Astra_Builder_Helper::$design_tab, + 'divider' => array( + 'ast_class' => 'ast-top-divider', + 'ast_title' => __( 'Toggle Color', 'astra' ), + ), + ), + + /** + * Option: Toggle Button Bg Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-toggle-btn-bg-color]', + 'default' => astra_get_option( 'transparent-header-toggle-btn-bg-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'title' => __( 'Background', 'astra' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 70, + 'context' => Astra_Builder_Helper::$design_tab, + ), + + /** + * Option: Toggle Button Border Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-toggle-border-color]', + 'default' => astra_get_option( 'transparent-header-toggle-border-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'title' => __( 'Border', 'astra' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 70, + 'context' => Astra_Builder_Helper::$design_tab, + ), + ); + + $_configs = array_merge( $_configs, $_hfb_configs ); + + } else { + $_old_content_configs = array( + + /** + * Option: Content Section Text color. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-content-section-text-color-responsive]', + 'default' => astra_get_option( 'transparent-content-section-text-color-responsive' ), + 'type' => 'control', + 'priority' => 39, + 'section' => $_section, + 'transport' => 'postMessage', + 'control' => 'ast-responsive-color', + 'title' => __( 'Text', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'divider' => array( + 'ast_class' => 'ast-top-divider', + 'ast_title' => __( 'Content', 'astra' ), + ), + ), + /** + * Option: Header Builder Tabs + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-content]', + 'default' => astra_get_option( 'transparent-header-colors-content' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Link', 'astra' ), + 'section' => $_section, + 'transport' => 'postMessage', + 'priority' => 39, + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + 'responsive' => true, + ), + ); + + $_configs = array_merge( $_configs, $_old_content_configs ); + } + + if ( defined( 'ASTRA_EXT_VER' ) && ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ) { + + $pro_elements_transparent_config = array( + + /** + * Search Box Background Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-search-box-placeholder-color]', + 'default' => astra_get_option( 'transparent-header-search-box-placeholder-color' ), + 'type' => 'control', + 'section' => 'section-transparent-header', + 'priority' => 45, + 'transport' => 'postMessage', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'title' => __( 'Text / Placeholder', 'astra' ), + 'context' => array( + Astra_Builder_Helper::$design_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-search-box-type]', + 'operator' => 'in', + 'value' => array( 'slide-search', 'search-box' ), + ), + ), + ), + + /** + * Option: Transparent Header Builder - Divider Elements configs. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-divider-color]', + 'default' => astra_get_option( 'transparent-header-divider-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'transport' => 'postMessage', + 'priority' => 64, + 'title' => __( 'Divider', 'astra' ), + 'section' => 'section-transparent-header', + 'context' => Astra_Builder_Helper::$design_tab, + 'divider' => array( 'ast_class' => 'ast-top-divider' ), + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', + 'default' => astra_get_option( 'transparent-account-menu-colors' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Account Menu Color', 'astra' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 66, + 'context' => array( + Astra_Builder_Helper::$design_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-account-action-type]', + 'operator' => '==', + 'value' => 'menu', + ), + ), + ), + + // Option: Menu Color. + array( + 'name' => 'transparent-account-menu-color-responsive', + 'default' => astra_get_option( 'transparent-account-menu-color-responsive' ), + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', + 'type' => 'sub-control', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'tab' => __( 'Normal', 'astra' ), + 'section' => 'section-transparent-header', + 'title' => __( 'Link / Text Color', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'priority' => 7, + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-account-action-type]', + 'operator' => '==', + 'value' => 'menu', + ), + Astra_Builder_Helper::$design_tab, + ), + ), + + // Option: Background Color. + array( + 'name' => 'transparent-account-menu-bg-obj-responsive', + 'default' => astra_get_option( 'transparent-account-menu-bg-obj-responsive' ), + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', + 'type' => 'sub-control', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'section' => 'section-transparent-header', + 'title' => __( 'Background Color', 'astra' ), + 'tab' => __( 'Normal', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'priority' => 8, + 'context' => Astra_Builder_Helper::$design_tab, + ), + + // Option: Menu Hover Color. + array( + 'name' => 'transparent-account-menu-h-color-responsive', + 'default' => astra_get_option( 'transparent-account-menu-h-color-responsive' ), + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', + 'tab' => __( 'Hover', 'astra' ), + 'type' => 'sub-control', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'title' => __( 'Link Color', 'astra' ), + 'section' => 'section-transparent-header', + 'responsive' => true, + 'rgba' => true, + 'priority' => 19, + 'context' => Astra_Builder_Helper::$design_tab, + ), + + // Option: Menu Hover Background Color. + array( + 'name' => 'transparent-account-menu-h-bg-color-responsive', + 'default' => astra_get_option( 'transparent-account-menu-h-bg-color-responsive' ), + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', + 'type' => 'sub-control', + 'title' => __( 'Background Color', 'astra' ), + 'section' => 'section-transparent-header', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'tab' => __( 'Hover', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'priority' => 21, + 'context' => Astra_Builder_Helper::$design_tab, + ), + + // Option: Active Menu Color. + array( + 'name' => 'transparent-account-menu-a-color-responsive', + 'default' => astra_get_option( 'transparent-account-menu-a-color-responsive' ), + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', + 'type' => 'sub-control', + 'section' => 'section-transparent-header', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'tab' => __( 'Active', 'astra' ), + 'title' => __( 'Link Color', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'priority' => 31, + 'context' => Astra_Builder_Helper::$design_tab, + ), + + // Option: Active Menu Background Color. + array( + 'name' => 'transparent-account-menu-a-bg-color-responsive', + 'default' => astra_get_option( 'transparent-account-menu-a-bg-color-responsive' ), + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]', + 'type' => 'sub-control', + 'control' => 'ast-responsive-color', + 'transport' => 'postMessage', + 'section' => 'section-transparent-header', + 'title' => __( 'Background Color', 'astra' ), + 'tab' => __( 'Active', 'astra' ), + 'responsive' => true, + 'rgba' => true, + 'priority' => 33, + 'context' => Astra_Builder_Helper::$design_tab, + ), + ); + + $_configs = array_merge( $_configs, $pro_elements_transparent_config ); + } + + return array_merge( $configurations, $_configs ); + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +new Astra_Customizer_Transparent_Header_Configs(); diff --git a/inc/addons/transparent-header/classes/sections/index.php b/inc/addons/transparent-header/classes/sections/index.php index 02f2fd6..7860b5b 100644 --- a/inc/addons/transparent-header/classes/sections/index.php +++ b/inc/addons/transparent-header/classes/sections/index.php @@ -1,9 +1,9 @@ - __( 'Primary Menu', 'astra' ), - ) - ); - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - /** - * Register the Secondary & Mobile menus. - */ - register_nav_menus( - array( - 'secondary_menu' => __( 'Secondary Menu', 'astra' ), - 'mobile_menu' => __( 'Off-Canvas Menu', 'astra' ), - ) - ); - - - $component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_menu; - - for ( $index = 3; $index <= $component_limit; $index++ ) { - - if ( ! is_customize_preview() && ! Astra_Builder_Helper::is_component_loaded( 'menu-' . $index ) ) { - continue; - } - - register_nav_menus( - array( - 'menu_' . $index => __( 'Menu ', 'astra' ) . $index, - ) - ); - } - - /** - * Register the Account menus. - */ - register_nav_menus( - array( - 'loggedin_account_menu' => __( 'Logged In Account Menu', 'astra' ), - ) - ); - - } - - /** - * Footer Menus - */ - register_nav_menus( - array( - 'footer_menu' => __( 'Footer Menu', 'astra' ), - ) - ); - - } -} - -add_action( 'init', 'astra_register_menu_locations' ); + __( 'Primary Menu', 'astra' ), + ) + ); + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + /** + * Register the Secondary & Mobile menus. + */ + register_nav_menus( + array( + 'secondary_menu' => __( 'Secondary Menu', 'astra' ), + 'mobile_menu' => __( 'Off-Canvas Menu', 'astra' ), + ) + ); + + + $component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_menu; + + for ( $index = 3; $index <= $component_limit; $index++ ) { + + if ( ! is_customize_preview() && ! Astra_Builder_Helper::is_component_loaded( 'menu-' . $index ) ) { + continue; + } + + register_nav_menus( + array( + 'menu_' . $index => __( 'Menu ', 'astra' ) . $index, + ) + ); + } + + /** + * Register the Account menus. + */ + register_nav_menus( + array( + 'loggedin_account_menu' => __( 'Logged In Account Menu', 'astra' ), + ) + ); + + } + + /** + * Footer Menus + */ + register_nav_menus( + array( + 'footer_menu' => __( 'Footer Menu', 'astra' ), + ) + ); + + } +} + +add_action( 'init', 'astra_register_menu_locations' ); diff --git a/inc/assets/images/astra-logo.svg b/inc/assets/images/astra-logo.svg deleted file mode 100644 index 52b599b..0000000 --- a/inc/assets/images/astra-logo.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - diff --git a/inc/assets/images/astra.svg b/inc/assets/images/astra.svg deleted file mode 100644 index d8648ae..0000000 --- a/inc/assets/images/astra.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/inc/assets/images/gen_polylogo_black_color_x200.png b/inc/assets/images/gen_polylogo_black_color_x200.png new file mode 100644 index 0000000..03fa9ae Binary files /dev/null and b/inc/assets/images/gen_polylogo_black_color_x200.png differ diff --git a/inc/assets/images/lightning-speed.svg b/inc/assets/images/lightning-speed.svg deleted file mode 100644 index 61c0024..0000000 --- a/inc/assets/images/lightning-speed.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/inc/assets/images/polyguin.svg b/inc/assets/images/polyguin.svg new file mode 100644 index 0000000..aee9a93 --- /dev/null +++ b/inc/assets/images/polyguin.svg @@ -0,0 +1,171 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inc/blog/blog-config.php b/inc/blog/blog-config.php index 40a5fc3..7a66766 100644 --- a/inc/blog/blog-config.php +++ b/inc/blog/blog-config.php @@ -1,470 +1,470 @@ -'; - $output .= ''; - $output .= ' ' . $modified_on . ''; - $output .= ''; - return apply_filters( 'astra_post_date', $output ); - } -} - -/** - * Function to get Author of Post - * - * @since 1.0.0 - * @return html - */ -if ( ! function_exists( 'astra_post_author' ) ) { - - /** - * Function to get Author of Post - * - * @param string $output_filter Filter string. - * @return html Markup. - */ - function astra_post_author( $output_filter = '' ) { - - ob_start(); - - echo ' 'posted-by vcard author', - ) - ); - echo '>'; - // Translators: Author Name. ?> - - - - ' . the_title( '', '', false ) . ' ' . $read_more_text . '' - ); - - $output = ' …

' . $post_link . '

'; - - return apply_filters( 'astra_post_link', $output, $output_filter ); - } -} -add_filter( 'excerpt_more', 'astra_post_link', 1 ); - -/** - * Function to get Number of Comments of Post - * - * @since 1.0.0 - * @return html - */ -if ( ! function_exists( 'astra_post_comments' ) ) { - - /** - * Function to get Number of Comments of Post - * - * @param string $output_filter Output filter. - * @return html Markup. - */ - function astra_post_comments( $output_filter = '' ) { - - $output = ''; - - ob_start(); - if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { - ?> - - - - - ' . $tags_list . ''; - } - - return apply_filters( 'astra_post_tags', $output, $output_filter ); - } -} - -/** - * Function to get Categories of Post - * - * @since 1.0.0 - * @return html - */ -if ( ! function_exists( 'astra_post_categories' ) ) { - - /** - * Function to get Categories applied of Post - * - * @param string $output_filter Output filter. - * @return html Markup. - */ - function astra_post_categories( $output_filter = '' ) { - - $output = ''; - - /* translators: used between list items, there is a space after the comma */ - $categories_list = get_the_category_list( __( ', ', 'astra' ) ); - - if ( $categories_list ) { - $output .= '' . $categories_list . ''; - } - - return apply_filters( 'astra_post_categories', $output, $output_filter ); - } -} - -/** - * Display classes for primary div - * - * @since 1.0.0 - */ -if ( ! function_exists( 'astra_blog_layout_class' ) ) { - - /** - * Layout class - * - * @param string $class Class. - */ - function astra_blog_layout_class( $class = '' ) { - - // Separates classes with a single space, collates classes for body element. - echo 'class="' . esc_attr( join( ' ', astra_get_blog_layout_class( $class ) ) ) . '"'; - } -} - -/** - * Retrieve the classes for the body element as an array. - * - * @since 1.0.0 - * @param string|array $class One or more classes to add to the class list. - * @return array Array of classes. - */ -if ( ! function_exists( 'astra_get_blog_layout_class' ) ) { - - /** - * Retrieve the classes for the body element as an array. - * - * @param string $class Class. - */ - function astra_get_blog_layout_class( $class = '' ) { - - // array of class names. - $classes = array(); - - $post_format = get_post_format(); - if ( $post_format ) { - $post_format = 'standard'; - } - - $classes[] = 'ast-post-format-' . $post_format; - - if ( ! has_post_thumbnail() || ! wp_get_attachment_image_src( get_post_thumbnail_id() ) ) { - switch ( $post_format ) { - - case 'aside': - $classes[] = 'ast-no-thumb'; - break; - - case 'image': - $has_image = astra_get_first_image_from_post(); - if ( empty( $has_image ) || is_single() ) { - $classes[] = 'ast-no-thumb'; - } - break; - - case 'video': - $post_featured_data = astra_get_video_from_post( get_the_ID() ); - if ( empty( $post_featured_data ) ) { - $classes[] = 'ast-no-thumb'; - } - break; - - case 'quote': - $classes[] = 'ast-no-thumb'; - break; - - case 'link': - $classes[] = 'ast-no-thumb'; - break; - - case 'gallery': - $post_featured_data = get_post_gallery(); - if ( empty( $post_featured_data ) || is_single() ) { - $classes[] = 'ast-no-thumb'; - } - break; - - case 'audio': - $has_audio = astra_get_audios_from_post( get_the_ID() ); - if ( empty( $has_audio ) || is_single() ) { - $classes[] = 'ast-no-thumb'; - } else { - $classes[] = 'ast-embeded-audio'; - } - break; - - case 'standard': - default: - if ( ! has_post_thumbnail() || ! wp_get_attachment_image_src( get_post_thumbnail_id() ) ) { - $classes[] = 'ast-no-thumb'; - } - break; - } - } - - if ( ! empty( $class ) ) { - if ( ! is_array( $class ) ) { - $class = preg_split( '#\s+#', $class ); - } - $classes = array_merge( $classes, $class ); - } else { - // Ensure that we always coerce class to being an array. - $class = array(); - } - - /** - * Filter primary div class names - */ - $classes = apply_filters( 'astra_blog_layout_class', $classes, $class ); - - $classes = array_map( 'sanitize_html_class', $classes ); - - return array_unique( $classes ); - } -} - -/** - * Function to get Content Read More Link of Post - * - * @since 1.2.7 - * @return html - */ -if ( ! function_exists( 'astra_the_content_more_link' ) ) { - - /** - * Filters the Read More link text. - * - * @param string $more_link_element Read More link element. - * @param string $more_link_text Read More text. - * @return html Markup. - */ - function astra_the_content_more_link( $more_link_element = '', $more_link_text = '' ) { - - $enabled = apply_filters( 'astra_the_content_more_link_enabled', '__return_true' ); - if ( ( is_admin() && ! wp_doing_ajax() ) || ! $enabled ) { - return $more_link_element; - } - - $more_link_text = apply_filters( 'astra_the_content_more_string', __( 'Read More »', 'astra' ) ); - $read_more_classes = apply_filters( 'astra_the_content_more_link_class', array() ); - - $post_link = sprintf( - esc_html( '%s' ), - ' ' . the_title( '', '', false ) . $more_link_text . '' - ); - - $more_link_element = ' …'; - - return apply_filters( 'astra_the_content_more_link', $more_link_element, $more_link_text ); - } -} -add_filter( 'the_content_more_link', 'astra_the_content_more_link', 10, 2 ); +'; + $output .= ''; + $output .= ' ' . $modified_on . ''; + $output .= ''; + return apply_filters( 'astra_post_date', $output ); + } +} + +/** + * Function to get Author of Post + * + * @since 1.0.0 + * @return html + */ +if ( ! function_exists( 'astra_post_author' ) ) { + + /** + * Function to get Author of Post + * + * @param string $output_filter Filter string. + * @return html Markup. + */ + function astra_post_author( $output_filter = '' ) { + + ob_start(); + + echo ' 'posted-by vcard author', + ) + ); + echo '>'; + // Translators: Author Name. ?> + + + + ' . the_title( '', '', false ) . ' ' . $read_more_text . '' + ); + + $output = ' …

' . $post_link . '

'; + + return apply_filters( 'astra_post_link', $output, $output_filter ); + } +} +add_filter( 'excerpt_more', 'astra_post_link', 1 ); + +/** + * Function to get Number of Comments of Post + * + * @since 1.0.0 + * @return html + */ +if ( ! function_exists( 'astra_post_comments' ) ) { + + /** + * Function to get Number of Comments of Post + * + * @param string $output_filter Output filter. + * @return html Markup. + */ + function astra_post_comments( $output_filter = '' ) { + + $output = ''; + + ob_start(); + if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + ?> + + + + + ' . $tags_list . ''; + } + + return apply_filters( 'astra_post_tags', $output, $output_filter ); + } +} + +/** + * Function to get Categories of Post + * + * @since 1.0.0 + * @return html + */ +if ( ! function_exists( 'astra_post_categories' ) ) { + + /** + * Function to get Categories applied of Post + * + * @param string $output_filter Output filter. + * @return html Markup. + */ + function astra_post_categories( $output_filter = '' ) { + + $output = ''; + + /* translators: used between list items, there is a space after the comma */ + $categories_list = get_the_category_list( __( ', ', 'astra' ) ); + + if ( $categories_list ) { + $output .= '' . $categories_list . ''; + } + + return apply_filters( 'astra_post_categories', $output, $output_filter ); + } +} + +/** + * Display classes for primary div + * + * @since 1.0.0 + */ +if ( ! function_exists( 'astra_blog_layout_class' ) ) { + + /** + * Layout class + * + * @param string $class Class. + */ + function astra_blog_layout_class( $class = '' ) { + + // Separates classes with a single space, collates classes for body element. + echo 'class="' . esc_attr( join( ' ', astra_get_blog_layout_class( $class ) ) ) . '"'; + } +} + +/** + * Retrieve the classes for the body element as an array. + * + * @since 1.0.0 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ +if ( ! function_exists( 'astra_get_blog_layout_class' ) ) { + + /** + * Retrieve the classes for the body element as an array. + * + * @param string $class Class. + */ + function astra_get_blog_layout_class( $class = '' ) { + + // array of class names. + $classes = array(); + + $post_format = get_post_format(); + if ( $post_format ) { + $post_format = 'standard'; + } + + $classes[] = 'ast-post-format-' . $post_format; + + if ( ! has_post_thumbnail() || ! wp_get_attachment_image_src( get_post_thumbnail_id() ) ) { + switch ( $post_format ) { + + case 'aside': + $classes[] = 'ast-no-thumb'; + break; + + case 'image': + $has_image = astra_get_first_image_from_post(); + if ( empty( $has_image ) || is_single() ) { + $classes[] = 'ast-no-thumb'; + } + break; + + case 'video': + $post_featured_data = astra_get_video_from_post( get_the_ID() ); + if ( empty( $post_featured_data ) ) { + $classes[] = 'ast-no-thumb'; + } + break; + + case 'quote': + $classes[] = 'ast-no-thumb'; + break; + + case 'link': + $classes[] = 'ast-no-thumb'; + break; + + case 'gallery': + $post_featured_data = get_post_gallery(); + if ( empty( $post_featured_data ) || is_single() ) { + $classes[] = 'ast-no-thumb'; + } + break; + + case 'audio': + $has_audio = astra_get_audios_from_post( get_the_ID() ); + if ( empty( $has_audio ) || is_single() ) { + $classes[] = 'ast-no-thumb'; + } else { + $classes[] = 'ast-embeded-audio'; + } + break; + + case 'standard': + default: + if ( ! has_post_thumbnail() || ! wp_get_attachment_image_src( get_post_thumbnail_id() ) ) { + $classes[] = 'ast-no-thumb'; + } + break; + } + } + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + $classes = array_merge( $classes, $class ); + } else { + // Ensure that we always coerce class to being an array. + $class = array(); + } + + /** + * Filter primary div class names + */ + $classes = apply_filters( 'astra_blog_layout_class', $classes, $class ); + + $classes = array_map( 'sanitize_html_class', $classes ); + + return array_unique( $classes ); + } +} + +/** + * Function to get Content Read More Link of Post + * + * @since 1.2.7 + * @return html + */ +if ( ! function_exists( 'astra_the_content_more_link' ) ) { + + /** + * Filters the Read More link text. + * + * @param string $more_link_element Read More link element. + * @param string $more_link_text Read More text. + * @return html Markup. + */ + function astra_the_content_more_link( $more_link_element = '', $more_link_text = '' ) { + + $enabled = apply_filters( 'astra_the_content_more_link_enabled', '__return_true' ); + if ( ( is_admin() && ! wp_doing_ajax() ) || ! $enabled ) { + return $more_link_element; + } + + $more_link_text = apply_filters( 'astra_the_content_more_string', __( 'Read More »', 'astra' ) ); + $read_more_classes = apply_filters( 'astra_the_content_more_link_class', array() ); + + $post_link = sprintf( + esc_html( '%s' ), + ' ' . the_title( '', '', false ) . $more_link_text . '' + ); + + $more_link_element = ' …'; + + return apply_filters( 'astra_the_content_more_link', $more_link_element, $more_link_text ); + } +} +add_filter( 'the_content_more_link', 'astra_the_content_more_link', 10, 2 ); diff --git a/inc/blog/blog.php b/inc/blog/blog.php index ac79ec4..0738670 100644 --- a/inc/blog/blog.php +++ b/inc/blog/blog.php @@ -1,392 +1,392 @@ -' . $output_str . '

', $output_str ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - } - } -} - -/** - * Featured post meta. - */ -if ( ! function_exists( 'astra_blog_post_get_featured_item' ) ) { - - /** - * To featured image / gallery / audio / video etc. As per the post format. - * - * @since 1.0 - * @return mixed - */ - function astra_blog_post_get_featured_item() { - - $post_featured_data = ''; - $post_format = get_post_format(); - - if ( has_post_thumbnail() ) { - - $post_featured_data = ''; - $post_featured_data .= get_the_post_thumbnail(); - $post_featured_data .= ''; - - } else { - - switch ( $post_format ) { - case 'image': - break; - - case 'video': - $post_featured_data = astra_get_video_from_post( get_the_ID() ); - break; - - case 'gallery': - $post_featured_data = get_post_gallery( get_the_ID(), false ); - if ( isset( $post_featured_data['ids'] ) ) { - $img_ids = explode( ',', $post_featured_data['ids'] ); - - $image_alt = get_post_meta( $img_ids[0], '_wp_attachment_image_alt', true ); - $image_url = wp_get_attachment_url( $img_ids[0] ); - - if ( isset( $img_ids[0] ) ) { - $post_featured_data = ''; - $post_featured_data .= '' . esc_attr( $image_alt ) . ''; - $post_featured_data .= ''; - } - } - break; - - case 'audio': - $post_featured_data = do_shortcode( astra_get_audios_from_post( get_the_ID() ) ); - break; - } - } - - echo $post_featured_data; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } -} - -add_action( 'astra_blog_post_featured_format', 'astra_blog_post_get_featured_item' ); - - -/** - * Blog Post Thumbnail / Title & Meta Order - */ -if ( ! function_exists( 'astra_blog_post_thumbnail_and_title_order' ) ) { - - /** - * Blog post Thubmnail, Title & Blog Meta order - * - * @since 1.0.8 - */ - function astra_blog_post_thumbnail_and_title_order() { - - $blog_post_thumb_title_order = astra_get_option( 'blog-post-structure' ); - if ( is_single() ) { - $blog_post_thumb_title_order = astra_get_option( 'blog-single-post-structure' ); - } - if ( is_array( $blog_post_thumb_title_order ) ) { - // Append the custom class for second element for single post. - foreach ( $blog_post_thumb_title_order as $post_thumb_title_order ) { - - switch ( $post_thumb_title_order ) { - - // Blog Post Featured Image. - case 'image': - do_action( 'astra_blog_archive_featured_image_before' ); - astra_get_blog_post_thumbnail( 'archive' ); - do_action( 'astra_blog_archive_featured_image_after' ); - break; - - // Blog Post Title and Blog Post Meta. - case 'title-meta': - do_action( 'astra_blog_archive_title_meta_before' ); - astra_get_blog_post_title_meta(); - do_action( 'astra_blog_archive_title_meta_after' ); - break; - - // Single Post Featured Image. - case 'single-image': - do_action( 'astra_blog_single_featured_image_before' ); - astra_get_blog_post_thumbnail( 'single' ); - do_action( 'astra_blog_single_featured_image_after' ); - break; - - // Single Post Title and Single Post Meta. - case 'single-title-meta': - do_action( 'astra_blog_single_title_meta_before' ); - astra_get_single_post_title_meta(); - do_action( 'astra_blog_single_title_meta_after' ); - break; - } - } - } - } -} - -/** - * Blog / Single Post Thumbnail - */ -if ( ! function_exists( 'astra_get_blog_post_thumbnail' ) ) { - - /** - * Blog post Thumbnail - * - * @param string $type Type of post. - * @since 1.0.8 - */ - function astra_get_blog_post_thumbnail( $type = 'archive' ) { - - if ( 'archive' === $type ) { - // Blog Post Featured Image. - astra_get_post_thumbnail( '
', '
' ); - } elseif ( 'single' === $type ) { - // Single Post Featured Image. - astra_get_post_thumbnail(); - } - } -} - -/** - * Blog Post Title & Meta Order - */ -if ( ! function_exists( 'astra_get_blog_post_title_meta' ) ) { - - /** - * Blog post Thumbnail - * - * @since 1.0.8 - */ - function astra_get_blog_post_title_meta() { - - // Blog Post Title and Blog Post Meta. - do_action( 'astra_archive_entry_header_before' ); - ?> -
- ', - esc_url( get_permalink() ), - astra_attr( - 'article-title-blog', - array( - 'class' => '', - ) - ) - ), - '', - get_the_id() - ); - - do_action( 'astra_archive_post_title_after' ); - - ?> - -
- -
- '', - ) - ) . '>', - '' - ); - - do_action( 'astra_single_post_title_after' ); - - do_action( 'astra_single_post_meta_before' ); - - astra_single_get_post_meta(); - - do_action( 'astra_single_post_meta_after' ); - - ?> -
- post_content ) ); - $embeds = apply_filters( 'astra_get_post_audio', get_media_embedded_in_content( $content ) ); - - if ( empty( $embeds ) ) { - return ''; - } - - // check what is the first embed containg video tag, youtube or vimeo. - foreach ( $embeds as $embed ) { - if ( strpos( $embed, 'audio' ) ) { - return '' . $embed . ''; - } - } - } -} - -/** - * Get first image from post content - */ -if ( ! function_exists( 'astra_get_video_from_post' ) ) { - - /** - * Get first image from post content - * - * @since 1.0 - * @param number $post_id Post id. - * @return mixed - */ - function astra_get_video_from_post( $post_id ) { - - $post = get_post( $post_id ); - $content = do_shortcode( apply_filters( 'the_content', $post->post_content ) ); - $embeds = apply_filters( 'astra_get_post_audio', get_media_embedded_in_content( $content ) ); - - if ( empty( $embeds ) ) { - return ''; - } - - // check what is the first embed containg video tag, youtube or vimeo. - foreach ( $embeds as $embed ) { - if ( strpos( $embed, 'video' ) || strpos( $embed, 'youtube' ) || strpos( $embed, 'vimeo' ) ) { - return $embed; - } - } - } -} +' . $output_str . '
', $output_str ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } + } + } +} + +/** + * Featured post meta. + */ +if ( ! function_exists( 'astra_blog_post_get_featured_item' ) ) { + + /** + * To featured image / gallery / audio / video etc. As per the post format. + * + * @since 1.0 + * @return mixed + */ + function astra_blog_post_get_featured_item() { + + $post_featured_data = ''; + $post_format = get_post_format(); + + if ( has_post_thumbnail() ) { + + $post_featured_data = ''; + $post_featured_data .= get_the_post_thumbnail(); + $post_featured_data .= ''; + + } else { + + switch ( $post_format ) { + case 'image': + break; + + case 'video': + $post_featured_data = astra_get_video_from_post( get_the_ID() ); + break; + + case 'gallery': + $post_featured_data = get_post_gallery( get_the_ID(), false ); + if ( isset( $post_featured_data['ids'] ) ) { + $img_ids = explode( ',', $post_featured_data['ids'] ); + + $image_alt = get_post_meta( $img_ids[0], '_wp_attachment_image_alt', true ); + $image_url = wp_get_attachment_url( $img_ids[0] ); + + if ( isset( $img_ids[0] ) ) { + $post_featured_data = ''; + $post_featured_data .= '' . esc_attr( $image_alt ) . ''; + $post_featured_data .= ''; + } + } + break; + + case 'audio': + $post_featured_data = do_shortcode( astra_get_audios_from_post( get_the_ID() ) ); + break; + } + } + + echo $post_featured_data; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } +} + +add_action( 'astra_blog_post_featured_format', 'astra_blog_post_get_featured_item' ); + + +/** + * Blog Post Thumbnail / Title & Meta Order + */ +if ( ! function_exists( 'astra_blog_post_thumbnail_and_title_order' ) ) { + + /** + * Blog post Thubmnail, Title & Blog Meta order + * + * @since 1.0.8 + */ + function astra_blog_post_thumbnail_and_title_order() { + + $blog_post_thumb_title_order = astra_get_option( 'blog-post-structure' ); + if ( is_single() ) { + $blog_post_thumb_title_order = astra_get_option( 'blog-single-post-structure' ); + } + if ( is_array( $blog_post_thumb_title_order ) ) { + // Append the custom class for second element for single post. + foreach ( $blog_post_thumb_title_order as $post_thumb_title_order ) { + + switch ( $post_thumb_title_order ) { + + // Blog Post Featured Image. + case 'image': + do_action( 'astra_blog_archive_featured_image_before' ); + astra_get_blog_post_thumbnail( 'archive' ); + do_action( 'astra_blog_archive_featured_image_after' ); + break; + + // Blog Post Title and Blog Post Meta. + case 'title-meta': + do_action( 'astra_blog_archive_title_meta_before' ); + astra_get_blog_post_title_meta(); + do_action( 'astra_blog_archive_title_meta_after' ); + break; + + // Single Post Featured Image. + case 'single-image': + do_action( 'astra_blog_single_featured_image_before' ); + astra_get_blog_post_thumbnail( 'single' ); + do_action( 'astra_blog_single_featured_image_after' ); + break; + + // Single Post Title and Single Post Meta. + case 'single-title-meta': + do_action( 'astra_blog_single_title_meta_before' ); + astra_get_single_post_title_meta(); + do_action( 'astra_blog_single_title_meta_after' ); + break; + } + } + } + } +} + +/** + * Blog / Single Post Thumbnail + */ +if ( ! function_exists( 'astra_get_blog_post_thumbnail' ) ) { + + /** + * Blog post Thumbnail + * + * @param string $type Type of post. + * @since 1.0.8 + */ + function astra_get_blog_post_thumbnail( $type = 'archive' ) { + + if ( 'archive' === $type ) { + // Blog Post Featured Image. + astra_get_post_thumbnail( '
', '
' ); + } elseif ( 'single' === $type ) { + // Single Post Featured Image. + astra_get_post_thumbnail(); + } + } +} + +/** + * Blog Post Title & Meta Order + */ +if ( ! function_exists( 'astra_get_blog_post_title_meta' ) ) { + + /** + * Blog post Thumbnail + * + * @since 1.0.8 + */ + function astra_get_blog_post_title_meta() { + + // Blog Post Title and Blog Post Meta. + do_action( 'astra_archive_entry_header_before' ); + ?> +
+ ', + esc_url( get_permalink() ), + astra_attr( + 'article-title-blog', + array( + 'class' => '', + ) + ) + ), + '', + get_the_id() + ); + + do_action( 'astra_archive_post_title_after' ); + + ?> + +
+ +
+ '', + ) + ) . '>', + '' + ); + + do_action( 'astra_single_post_title_after' ); + + do_action( 'astra_single_post_meta_before' ); + + astra_single_get_post_meta(); + + do_action( 'astra_single_post_meta_after' ); + + ?> +
+ post_content ) ); + $embeds = apply_filters( 'astra_get_post_audio', get_media_embedded_in_content( $content ) ); + + if ( empty( $embeds ) ) { + return ''; + } + + // check what is the first embed containg video tag, youtube or vimeo. + foreach ( $embeds as $embed ) { + if ( strpos( $embed, 'audio' ) ) { + return '' . $embed . ''; + } + } + } +} + +/** + * Get first image from post content + */ +if ( ! function_exists( 'astra_get_video_from_post' ) ) { + + /** + * Get first image from post content + * + * @since 1.0 + * @param number $post_id Post id. + * @return mixed + */ + function astra_get_video_from_post( $post_id ) { + + $post = get_post( $post_id ); + $content = do_shortcode( apply_filters( 'the_content', $post->post_content ) ); + $embeds = apply_filters( 'astra_get_post_audio', get_media_embedded_in_content( $content ) ); + + if ( empty( $embeds ) ) { + return ''; + } + + // check what is the first embed containg video tag, youtube or vimeo. + foreach ( $embeds as $embed ) { + if ( strpos( $embed, 'video' ) || strpos( $embed, 'youtube' ) || strpos( $embed, 'vimeo' ) ) { + return $embed; + } + } + } +} diff --git a/inc/blog/index.php b/inc/blog/index.php index 8b96815..820bcb9 100644 --- a/inc/blog/index.php +++ b/inc/blog/index.php @@ -1,9 +1,9 @@ -' . $output_str . '
', $output_str ); // WPCS: XSS OK. - } - } - if ( $echo ) { - echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } else { - return $output; - } - } -} - -/** - * Template for comments and pingbacks. - */ -if ( ! function_exists( 'astra_theme_comment' ) ) { - - /** - * Template for comments and pingbacks. - * - * To override this walker in a child theme without modifying the comments template - * simply create your own astra_theme_comment(), and that function will be used instead. - * - * Used as a callback by wp_list_comments() for displaying the comments. - * - * @param string $comment Comment. - * @param array $args Comment arguments. - * @param number $depth Depth. - * @return mixed Comment markup. - */ - function astra_theme_comment( $comment, $args, $depth ) { - - switch ( $comment->comment_type ) { - - case 'pingback': - case 'trackback': - // Display trackbacks differently than normal comments. - ?> -
  • id="comment-"> -

    ', '' ); ?>

    -
  • - -
  • id="li-comment-"> - -
    -
    -
    - 'ast-comment-meta ast-row ast-comment-author vcard capitalize', - ) - ); - echo '>'; - - printf( - astra_markup_open( - 'ast-comment-cite-wrap', - array( - 'open' => '
    ', - 'class' => 'ast-comment-cite-wrap', - ) - ) . '%1$s %2$s
    ', - get_comment_author_link(), - // If current post author is also comment author, make it known visually. - ( $comment->user_id === $post->post_author ) ? '' : '' - ); - - if ( apply_filters( 'astra_single_post_comment_time_enabled', true ) ) { - printf( - esc_attr( - astra_markup_open( - 'ast-comment-time', - array( - 'open' => '
    ', - 'class' => 'ast-comment-time', - ) - ) - ) . '
    ', - esc_url( get_comment_link( $comment->comment_ID ) ), - esc_attr( get_comment_time( 'c' ) ), - /* translators: 1: date, 2: time */ - esc_html( sprintf( __( '%1$s at %2$s', 'astra' ), get_comment_date(), get_comment_time() ) ) - ); - } - - ?> - - -
    -
    - -
    - ', '' ); ?> - astra_default_strings( 'string-comment-reply-link', false ), - 'add_below' => 'comment', - 'depth' => $depth, - 'max_depth' => $args['max_depth'], - 'before' => '', - 'after' => '', - ) - ) - ); - ?> -
    - comment_approved ) : ?> -

    - -
    - -
    - - labels->singular_name - ); - - $prev_text = sprintf( - astra_default_strings( 'string-single-navigation-previous', false ), - $post_obj->labels->singular_name - ); - /** - * Filter the post pagination markup - */ - the_post_navigation( - apply_filters( - 'astra_single_post_navigation', - array( - 'next_text' => $next_text, - 'prev_text' => $prev_text, - ) - ) - ); - - } - } -} - -add_action( 'astra_entry_after', 'astra_single_post_navigation_markup' ); +' . $output_str . '
  • ', $output_str ); // WPCS: XSS OK. + } + } + if ( $echo ) { + echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } else { + return $output; + } + } +} + +/** + * Template for comments and pingbacks. + */ +if ( ! function_exists( 'astra_theme_comment' ) ) { + + /** + * Template for comments and pingbacks. + * + * To override this walker in a child theme without modifying the comments template + * simply create your own astra_theme_comment(), and that function will be used instead. + * + * Used as a callback by wp_list_comments() for displaying the comments. + * + * @param string $comment Comment. + * @param array $args Comment arguments. + * @param number $depth Depth. + * @return mixed Comment markup. + */ + function astra_theme_comment( $comment, $args, $depth ) { + + switch ( $comment->comment_type ) { + + case 'pingback': + case 'trackback': + // Display trackbacks differently than normal comments. + ?> +
  • id="comment-"> +

    ', '' ); ?>

    +
  • + +
  • id="li-comment-"> + +
    +
    +
    + 'ast-comment-meta ast-row ast-comment-author vcard capitalize', + ) + ); + echo '>'; + + printf( + astra_markup_open( + 'ast-comment-cite-wrap', + array( + 'open' => '
    ', + 'class' => 'ast-comment-cite-wrap', + ) + ) . '%1$s %2$s
    ', + get_comment_author_link(), + // If current post author is also comment author, make it known visually. + ( $comment->user_id === $post->post_author ) ? '' : '' + ); + + if ( apply_filters( 'astra_single_post_comment_time_enabled', true ) ) { + printf( + esc_attr( + astra_markup_open( + 'ast-comment-time', + array( + 'open' => '
    ', + 'class' => 'ast-comment-time', + ) + ) + ) . '
    ', + esc_url( get_comment_link( $comment->comment_ID ) ), + esc_attr( get_comment_time( 'c' ) ), + /* translators: 1: date, 2: time */ + esc_html( sprintf( __( '%1$s at %2$s', 'astra' ), get_comment_date(), get_comment_time() ) ) + ); + } + + ?> + + +
    +
    + +
    + ', '' ); ?> + astra_default_strings( 'string-comment-reply-link', false ), + 'add_below' => 'comment', + 'depth' => $depth, + 'max_depth' => $args['max_depth'], + 'before' => '', + 'after' => '', + ) + ) + ); + ?> +
    + comment_approved ) : ?> +

    + +
    + +
    + + labels->singular_name + ); + + $prev_text = sprintf( + astra_default_strings( 'string-single-navigation-previous', false ), + $post_obj->labels->singular_name + ); + /** + * Filter the post pagination markup + */ + the_post_navigation( + apply_filters( + 'astra_single_post_navigation', + array( + 'next_text' => $next_text, + 'prev_text' => $prev_text, + ) + ) + ); + + } + } +} + +add_action( 'astra_entry_after', 'astra_single_post_navigation_markup' ); diff --git a/inc/class-astra-after-setup-theme.php b/inc/class-astra-after-setup-theme.php index 7d9fc94..8af30d8 100644 --- a/inc/class-astra-after-setup-theme.php +++ b/inc/class-astra-after-setup-theme.php @@ -1,264 +1,264 @@ - 180, - 'height' => 60, - 'flex-width' => true, - 'flex-height' => true, - ) - ); - - // Customize Selective Refresh Widgets. - add_theme_support( 'customize-selective-refresh-widgets' ); - - /** - * This theme styles the visual editor to resemble the theme style, - * specifically font, colors, icons, and column width. - */ - /* Directory and Extension */ - $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; - $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; - if ( apply_filters( 'astra_theme_editor_style', true ) ) { - add_editor_style( 'assets/css/' . $dir_name . '/editor-style' . $file_prefix . '.css' ); - } - - if ( apply_filters( 'astra_fullwidth_oembed', true ) ) { - // Filters the oEmbed process to run the responsive_oembed_wrapper() function. - add_filter( 'embed_oembed_html', array( $this, 'responsive_oembed_wrapper' ), 10, 3 ); - } - - // WooCommerce. - add_theme_support( 'woocommerce' ); - - // Rank Math Breadcrumb. - add_theme_support( 'rank-math-breadcrumbs' ); - - // Native AMP Support. - if ( true === apply_filters( 'astra_amp_support', true ) ) { - add_theme_support( - 'amp', - apply_filters( - 'astra_amp_theme_features', - array( - 'paired' => true, - ) - ) - ); - } - - } - - /** - * Set the $content_width global variable used by WordPress to set image dimennsions. - * - * @since 1.5.5 - * @return void - */ - public function setup_content_width() { - global $content_width; - - /** - * Content Width - */ - if ( ! isset( $content_width ) ) { - - if ( is_home() || is_post_type_archive( 'post' ) ) { - $blog_width = astra_get_option( 'blog-width' ); - - if ( 'custom' === $blog_width ) { - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'blog-max-width', 1200 ) ); - } else { - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); - } - } elseif ( is_single() ) { - - if ( 'post' === get_post_type() ) { - $single_post_max = astra_get_option( 'blog-single-width' ); - - if ( 'custom' === $single_post_max ) { - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'blog-single-max-width', 1200 ) ); - } else { - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); - } - } - - // For custom post types set the global content width. - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); - } else { - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); - } - } - - } - - /** - * Adds a responsive embed wrapper around oEmbed content - * - * @param string $html The oEmbed markup. - * @param string $url The URL being embedded. - * @param array $attr An array of attributes. - * - * @return string Updated embed markup. - */ - public function responsive_oembed_wrapper( $html, $url, $attr ) { - - $add_astra_oembed_wrapper = apply_filters( 'astra_responsive_oembed_wrapper_enable', true ); - - $allowed_providers = apply_filters( - 'astra_allowed_fullwidth_oembed_providers', - array( - 'vimeo.com', - 'youtube.com', - 'youtu.be', - 'wistia.com', - 'wistia.net', - ) - ); - - if ( astra_strposa( $url, $allowed_providers ) ) { - if ( $add_astra_oembed_wrapper ) { - $html = ( '' !== $html ) ? '
    ' . $html . '
    ' : ''; - } - } - - return $html; - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_After_Setup_Theme::get_instance(); + 180, + 'height' => 60, + 'flex-width' => true, + 'flex-height' => true, + ) + ); + + // Customize Selective Refresh Widgets. + add_theme_support( 'customize-selective-refresh-widgets' ); + + /** + * This theme styles the visual editor to resemble the theme style, + * specifically font, colors, icons, and column width. + */ + /* Directory and Extension */ + $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; + $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; + if ( apply_filters( 'astra_theme_editor_style', true ) ) { + add_editor_style( 'assets/css/' . $dir_name . '/editor-style' . $file_prefix . '.css' ); + } + + if ( apply_filters( 'astra_fullwidth_oembed', true ) ) { + // Filters the oEmbed process to run the responsive_oembed_wrapper() function. + add_filter( 'embed_oembed_html', array( $this, 'responsive_oembed_wrapper' ), 10, 3 ); + } + + // WooCommerce. + add_theme_support( 'woocommerce' ); + + // Rank Math Breadcrumb. + add_theme_support( 'rank-math-breadcrumbs' ); + + // Native AMP Support. + if ( true === apply_filters( 'astra_amp_support', true ) ) { + add_theme_support( + 'amp', + apply_filters( + 'astra_amp_theme_features', + array( + 'paired' => true, + ) + ) + ); + } + + } + + /** + * Set the $content_width global variable used by WordPress to set image dimennsions. + * + * @since 1.5.5 + * @return void + */ + public function setup_content_width() { + global $content_width; + + /** + * Content Width + */ + if ( ! isset( $content_width ) ) { + + if ( is_home() || is_post_type_archive( 'post' ) ) { + $blog_width = astra_get_option( 'blog-width' ); + + if ( 'custom' === $blog_width ) { + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'blog-max-width', 1200 ) ); + } else { + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); + } + } elseif ( is_single() ) { + + if ( 'post' === get_post_type() ) { + $single_post_max = astra_get_option( 'blog-single-width' ); + + if ( 'custom' === $single_post_max ) { + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'blog-single-max-width', 1200 ) ); + } else { + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); + } + } + + // For custom post types set the global content width. + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); + } else { + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); + } + } + + } + + /** + * Adds a responsive embed wrapper around oEmbed content + * + * @param string $html The oEmbed markup. + * @param string $url The URL being embedded. + * @param array $attr An array of attributes. + * + * @return string Updated embed markup. + */ + public function responsive_oembed_wrapper( $html, $url, $attr ) { + + $add_astra_oembed_wrapper = apply_filters( 'astra_responsive_oembed_wrapper_enable', true ); + + $allowed_providers = apply_filters( + 'astra_allowed_fullwidth_oembed_providers', + array( + 'vimeo.com', + 'youtube.com', + 'youtu.be', + 'wistia.com', + 'wistia.net', + ) + ); + + if ( astra_strposa( $url, $allowed_providers ) ) { + if ( $add_astra_oembed_wrapper ) { + $html = ( '' !== $html ) ? '
    ' . $html . '
    ' : ''; + } + } + + return $html; + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_After_Setup_Theme::get_instance(); diff --git a/inc/class-astra-dynamic-css.php b/inc/class-astra-dynamic-css.php index d1cd5ad..3ebecc9 100644 --- a/inc/class-astra-dynamic-css.php +++ b/inc/class-astra-dynamic-css.php @@ -1,3664 +1,3664 @@ - array( - 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 6.25, '%' ), - ), - 'a, .page-title' => array( - 'color' => esc_attr( $link_color ), - ), - 'a:hover, a:focus' => array( - 'color' => esc_attr( $link_hover_color ), - ), - 'body, button, input, select, textarea, .ast-button, .ast-custom-button' => array( - 'font-family' => astra_get_font_family( $body_font_family ), - 'font-weight' => esc_attr( $body_font_weight ), - 'font-size' => astra_responsive_font( $body_font_size, 'desktop' ), - 'line-height' => esc_attr( $body_line_height ), - 'text-transform' => esc_attr( $body_text_transform ), - ), - 'blockquote' => array( - 'border-color' => astra_hex_to_rgba( $link_color, 0.15 ), - ), - 'p, .entry-content p' => array( - 'margin-bottom' => astra_get_css_value( $para_margin_bottom, 'em' ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a', - 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a' - ) => array( - 'font-family' => astra_get_css_value( $headings_font_family, 'font' ), - 'font-weight' => astra_get_css_value( $headings_font_weight, 'font' ), - 'text-transform' => esc_attr( $headings_text_transform ), - ), - - '.ast-site-identity .site-title a' => array( - 'color' => esc_attr( $title_color ), - ), - '.ast-site-identity .site-title a:hover' => array( - 'color' => esc_attr( $title_hover_color ), - ), - '.ast-site-identity .site-description' => array( - 'color' => esc_attr( $tagline_color ), - ), - '.site-title' => array( - 'font-size' => astra_responsive_font( $site_title_font_size, 'desktop' ), - 'display' => esc_attr( $desktop_title_visibility ), - ), - 'header .custom-logo-link img' => array( - 'max-width' => astra_get_css_value( $header_logo_width['desktop'], 'px' ), - ), - '.astra-logo-svg' => array( - 'width' => astra_get_css_value( $header_logo_width['desktop'], 'px' ), - ), - '.astra-logo-svg:not(.sticky-custom-logo .astra-logo-svg, .transparent-custom-logo .astra-logo-svg, .advanced-header-logo .astra-logo-svg)' => array( - 'height' => astra_get_css_value( ( ! empty( $header_logo_width['desktop-svg-height'] ) && ! is_customize_preview() ) ? $header_logo_width['desktop-svg-height'] : '', 'px' ), - ), - '.ast-archive-description .ast-archive-title' => array( - 'font-size' => astra_responsive_font( $archive_summary_title_font_size, 'desktop' ), - ), - '.site-header .site-description' => array( - 'font-size' => astra_responsive_font( $site_tagline_font_size, 'desktop' ), - 'display' => esc_attr( $desktop_tagline_visibility ), - ), - '.entry-title' => array( - 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'desktop' ), - ), - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h1, .entry-content h1, .entry-content h1 a', - 'h1, .entry-content h1' - ) => array( - 'font-size' => astra_responsive_font( $heading_h1_font_size, 'desktop' ), - 'font-weight' => astra_get_css_value( $h1_font_weight, 'font' ), - 'font-family' => astra_get_css_value( $h1_font_family, 'font' ), - 'line-height' => esc_attr( $h1_line_height ), - 'text-transform' => esc_attr( $h1_text_transform ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h2, .entry-content h2, .entry-content h2 a', - 'h2, .entry-content h2' - ) => array( - 'font-size' => astra_responsive_font( $heading_h2_font_size, 'desktop' ), - 'font-weight' => astra_get_css_value( $h2_font_weight, 'font' ), - 'font-family' => astra_get_css_value( $h2_font_family, 'font' ), - 'line-height' => esc_attr( $h2_line_height ), - 'text-transform' => esc_attr( $h2_text_transform ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h3, .entry-content h3, .entry-content h3 a', - 'h3, .entry-content h3' - ) => array( - 'font-size' => astra_responsive_font( $heading_h3_font_size, 'desktop' ), - 'font-weight' => astra_get_css_value( $h3_font_weight, 'font' ), - 'font-family' => astra_get_css_value( $h3_font_family, 'font' ), - 'line-height' => esc_attr( $h3_line_height ), - 'text-transform' => esc_attr( $h3_text_transform ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h4, .entry-content h4, .entry-content h4 a', - 'h4, .entry-content h4' - ) => array( - 'font-size' => astra_responsive_font( $heading_h4_font_size, 'desktop' ), - 'line-height' => esc_attr( $h4_line_height ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h5, .entry-content h5, .entry-content h5 a', - 'h5, .entry-content h5' - ) => array( - 'font-size' => astra_responsive_font( $heading_h5_font_size, 'desktop' ), - 'line-height' => esc_attr( $h5_line_height ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h6, .entry-content h6, .entry-content h6 a', - 'h6, .entry-content h6' - ) => array( - 'font-size' => astra_responsive_font( $heading_h6_font_size, 'desktop' ), - 'line-height' => esc_attr( $h6_line_height ), - ), - - '.ast-single-post .entry-title, .page-title' => array( - 'font-size' => astra_responsive_font( $single_post_title_font_size, 'desktop' ), - ), - // Global CSS. - '::selection' => array( - 'background-color' => esc_attr( $theme_color ), - 'color' => esc_attr( $selection_text_color ), - ), - - // Conditionally select selectors with annchors or withour anchors for text color. - self::conditional_headings_css_selectors( - 'body, h1, .entry-title a, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a', - 'body, h1, .entry-title a, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6' - ) => array( - 'color' => esc_attr( $text_color ), - ), - - // Typography. - '.tagcloud a:hover, .tagcloud a:focus, .tagcloud a.current-item' => array( - 'color' => astra_get_foreground_color( $link_color ), - 'border-color' => esc_attr( $link_color ), - 'background-color' => esc_attr( $link_color ), - ), - - // Input tags. - 'input:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="password"]:focus, input[type="reset"]:focus, input[type="search"]:focus, textarea:focus' => array( - 'border-color' => esc_attr( $link_color ), - ), - 'input[type="radio"]:checked, input[type=reset], input[type="checkbox"]:checked, input[type="checkbox"]:hover:checked, input[type="checkbox"]:focus:checked, input[type=range]::-webkit-slider-thumb' => array( - 'border-color' => esc_attr( $link_color ), - 'background-color' => esc_attr( $link_color ), - 'box-shadow' => 'none', - ), - - // Small Footer. - '.site-footer a:hover + .post-count, .site-footer a:focus + .post-count' => array( - 'background' => esc_attr( $link_color ), - 'border-color' => esc_attr( $link_color ), - ), - - '.single .nav-links .nav-previous, .single .nav-links .nav-next' => array( - 'color' => esc_attr( $link_color ), - ), - - // Blog Post Meta Typography. - '.entry-meta, .entry-meta *' => array( - 'line-height' => '1.45', - 'color' => esc_attr( $link_color ), - ), - '.entry-meta a:hover, .entry-meta a:hover *, .entry-meta a:focus, .entry-meta a:focus *, .page-links > .page-link, .page-links .page-link:hover, .post-navigation a:hover' => array( - 'color' => esc_attr( $link_hover_color ), - ), - - // Blockquote Text Color. - 'blockquote' => array( - 'color' => astra_adjust_brightness( $text_color, 75, 'darken' ), - ), - - // Widget Title. - '.widget-title' => array( - 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 1.428571429 ), - 'color' => esc_attr( $text_color ), - ), - '#cat option, .secondary .calendar_wrap thead a, .secondary .calendar_wrap thead a:visited' => array( - 'color' => esc_attr( $link_color ), - ), - '.secondary .calendar_wrap #today, .ast-progress-val span' => array( - 'background' => esc_attr( $link_color ), - ), - '.secondary a:hover + .post-count, .secondary a:focus + .post-count' => array( - 'background' => esc_attr( $link_color ), - 'border-color' => esc_attr( $link_color ), - ), - '.calendar_wrap #today > a' => array( - 'color' => astra_get_foreground_color( $link_color ), - ), - - // Pagination. - '.page-links .page-link, .single .post-navigation a' => array( - 'color' => esc_attr( $link_color ), - ), - - // Menu Toggle Border Radius. - '.ast-header-break-point .main-header-bar .ast-button-wrap .menu-toggle' => array( - 'border-radius' => ( '' !== $mobile_header_toggle_btn_border_radius ) ? esc_attr( $mobile_header_toggle_btn_border_radius ) . 'px' : '', - ), - - ); - - // Remove this condition after 2-3 updates of add-on. - if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '3.0.1', '>=' ) ) { - $css_output['.single .ast-author-details .author-title'] = array( - 'color' => esc_attr( $link_hover_color ), - ); - } - - if ( 'no-sidebar' !== astra_page_layout() ) { - $css_output['#secondary, #secondary button, #secondary input, #secondary select, #secondary textarea'] = array( - 'font-size' => astra_responsive_font( $body_font_size, 'desktop' ), - ); - } - - // Add underline to every link in content area. - $content_links_underline = astra_get_option( 'underline-content-links' ); - - if ( $content_links_underline ) { - $css_output['.ast-single-post .entry-content a, .ast-comment-content a:not(.ast-comment-edit-reply-wrap a)'] = array( - 'text-decoration' => 'underline', - ); - $css_output['.ast-single-post .wp-block-button .wp-block-button__link, .ast-single-post .elementor-button-wrapper .elementor-button'] = array( - 'text-decoration' => 'none', - ); - } - - /** - * Loaded the following CSS conditionally because of following scenarios - - * - * 1. $text_color is applying to menu-link anchors as well though $link_color should apply over there. - * 2. $link_color applying in old header as hover color for menu-anchors. - * - * @since 3.0.0 - */ - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { - // Header - Main Header CSS. - $css_output['.main-header-menu .menu-link, .ast-header-custom-item a'] = array( - 'color' => esc_attr( $text_color ), - ); - // Main - Menu Items. - $css_output['.main-header-menu .menu-item:hover > .menu-link, .main-header-menu .menu-item:hover > .ast-menu-toggle, .main-header-menu .ast-masthead-custom-menu-items a:hover, .main-header-menu .menu-item.focus > .menu-link, .main-header-menu .menu-item.focus > .ast-menu-toggle, .main-header-menu .current-menu-item > .menu-link, .main-header-menu .current-menu-ancestor > .menu-link, .main-header-menu .current-menu-item > .ast-menu-toggle, .main-header-menu .current-menu-ancestor > .ast-menu-toggle'] = array( - 'color' => esc_attr( $link_color ), - ); - $css_output['.header-main-layout-3 .ast-main-header-bar-alignment'] = array( - 'margin-right' => 'auto', - ); - if ( $is_site_rtl ) { - $css_output['.header-main-layout-2 .site-header-section-left .ast-site-identity'] = array( - 'text-align' => 'right', - ); - } else { - $css_output['.header-main-layout-2 .site-header-section-left .ast-site-identity'] = array( - 'text-align' => 'left', - ); - } - } - - $page_header_logo = ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'advanced-headers' ) && Astra_Ext_Advanced_Headers_Loader::astra_advanced_headers_design_option( 'logo-url' ) ) ? true : false; - - if ( astra_get_option( 'logo-title-inline' ) ) { - $css_output['.ast-logo-title-inline .site-logo-img'] = array( - 'padding-right' => '1em', - ); - } - - if ( get_theme_mod( 'custom_logo' ) - || astra_get_option( 'transparent-header-logo' ) - || astra_get_option( 'sticky-header-logo' ) - || $page_header_logo - || is_customize_preview() ) { - - $css_output['.site-logo-img img'] = array( - ' transition' => 'all 0.2s linear', - ); - } - - /* Parse CSS from array() */ - $parse_css = astra_parse_css( $css_output ); - - if ( ! Astra_Builder_Helper::$is_header_footer_builder_active ) { - - $old_header_mobile_toggle = array( - // toggle style - // Menu Toggle Minimal. - '.ast-header-break-point .ast-mobile-menu-buttons-minimal.menu-toggle' => array( - 'background' => 'transparent', - 'color' => esc_attr( $mobile_header_toggle_btn_style_color ), - ), - - // Menu Toggle Outline. - '.ast-header-break-point .ast-mobile-menu-buttons-outline.menu-toggle' => array( - 'background' => 'transparent', - 'border' => '1px solid ' . $mobile_header_toggle_btn_style_color, - 'color' => esc_attr( $mobile_header_toggle_btn_style_color ), - ), - - // Menu Toggle Fill. - '.ast-header-break-point .ast-mobile-menu-buttons-fill.menu-toggle' => array( - 'background' => esc_attr( $mobile_header_toggle_btn_style_color ), - 'color' => $menu_btn_color, - ), - ); - - $parse_css .= astra_parse_css( $old_header_mobile_toggle ); - } - - $parse_css .= astra_container_layout_css(); - - if ( 'no-sidebar' !== astra_page_layout() ) { - $parse_css .= Astra_Enqueue_Scripts::trim_css( self::load_sidebar_static_css() ); - } - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - $parse_css .= astra_parse_css( - array( - '#ast-desktop-header' => array( - 'display' => 'none', - ), - ), - '', - astra_get_tablet_breakpoint() - ); - - $parse_css .= astra_parse_css( - array( - '#ast-mobile-header' => array( - 'display' => 'none', - ), - ), - astra_get_tablet_breakpoint() - ); - } - - // Comments CSS. - if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { - require_once ASTRA_THEME_DIR . 'inc/dynamic-css/comments.php'; // PHPCS:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - } else { - require_once ASTRA_THEME_DIR . 'inc/dynamic-css/comments-flex.php'; // PHPCS:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - } - - if ( Astra_Builder_Helper::is_component_loaded( 'woo-cart', 'header' ) || Astra_Builder_Helper::is_component_loaded( 'edd-cart', 'header' ) ) { - $parse_css .= Astra_Enqueue_Scripts::trim_css( self::load_cart_static_css() ); - } - - if ( ! Astra_Builder_Helper::$is_header_footer_builder_active ) { - $footer_css_output = array( - '.ast-small-footer' => array( - 'color' => esc_attr( $footer_color ), - ), - '.ast-small-footer > .ast-footer-overlay' => astra_get_background_obj( $footer_bg_obj ), - - '.ast-small-footer a' => array( - 'color' => esc_attr( $footer_link_color ), - ), - '.ast-small-footer a:hover' => array( - 'color' => esc_attr( $footer_link_h_color ), - ), - - // Advanced Footer colors/fonts. - '.footer-adv .footer-adv-overlay' => array( - 'border-top-style' => 'solid', - 'border-top-width' => astra_get_css_value( $footer_adv_border_width, 'px' ), - 'border-top-color' => esc_attr( $footer_adv_border_color ), - ), - '.footer-adv .widget-title,.footer-adv .widget-title a' => array( - 'color' => esc_attr( $footer_adv_widget_title_color ), - ), - - '.footer-adv' => array( - 'color' => esc_attr( $footer_adv_text_color ), - ), - - '.footer-adv a' => array( - 'color' => esc_attr( $footer_adv_link_color ), - ), - - '.footer-adv .tagcloud a:hover, .footer-adv .tagcloud a.current-item' => array( - 'border-color' => esc_attr( $footer_adv_link_color ), - 'background-color' => esc_attr( $footer_adv_link_color ), - ), - - '.footer-adv a:hover, .footer-adv .no-widget-text a:hover, .footer-adv a:focus, .footer-adv .no-widget-text a:focus' => array( - 'color' => esc_attr( $footer_adv_link_h_color ), - ), - - '.footer-adv .calendar_wrap #today, .footer-adv a:hover + .post-count' => array( - 'background-color' => esc_attr( $footer_adv_link_color ), - ), - - '.footer-adv-overlay' => astra_get_background_obj( $footer_adv_bg_obj ), - - ); - - $parse_css .= astra_parse_css( $footer_css_output ); - } - - // Paginaiton CSS. - require_once ASTRA_THEME_DIR . 'inc/dynamic-css/pagination.php'; // PHPCS:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - // Related Posts Dynamic CSS. - - /** - * - * Fix button aligment issue comming from the gutenberg plugin (v9.3.0). - */ - $gtn_plugin_button_center_alignment = array( - '.wp-block-buttons.aligncenter' => array( - 'justify-content' => 'center', - ), - ); - $parse_css .= astra_parse_css( $gtn_plugin_button_center_alignment ); - - $ast_container_layout = astra_get_content_layout(); - - /* - * Fix the wide width issue in gutenberg - * check if the current user is existing user or new user. - * if new user load the CSS bty default if existing provide a filter - */ - if ( self::gtn_image_group_css_comp() ) { - - if ( 'content-boxed-container' == $ast_container_layout || 'boxed-container' == $ast_container_layout ) { - $parse_css .= astra_parse_css( - array( - '.ast-separate-container.ast-right-sidebar .entry-content .wp-block-image.alignfull,.ast-separate-container.ast-left-sidebar .entry-content .wp-block-image.alignfull,.ast-separate-container.ast-right-sidebar .entry-content .wp-block-cover.alignfull,.ast-separate-container.ast-left-sidebar .entry-content .wp-block-cover.alignfull' => array( - 'margin-left' => '-6.67em', - 'margin-right' => '-6.67em', - 'max-width' => 'unset', - 'width' => 'unset', - ), - '.ast-separate-container.ast-right-sidebar .entry-content .wp-block-image.alignwide,.ast-separate-container.ast-left-sidebar .entry-content .wp-block-image.alignwide,.ast-separate-container.ast-right-sidebar .entry-content .wp-block-cover.alignwide,.ast-separate-container.ast-left-sidebar .entry-content .wp-block-cover.alignwide' => array( - 'margin-left' => '-20px', - 'margin-right' => '-20px', - 'max-width' => 'unset', - 'width' => 'unset', - ), - ), - '1200' - ); - } - - $gtn_full_wide_image_css = array( - '.wp-block-group .has-background' => array( - 'padding' => '20px', - ), - ); - $parse_css .= astra_parse_css( $gtn_full_wide_image_css, '1200' ); - - } else { - - $gtn_tablet_column_css = array( - '.entry-content .wp-block-columns .wp-block-column' => array( - 'margin-left' => '0px', - ), - ); - - $parse_css .= astra_parse_css( $gtn_tablet_column_css, '', '782' ); - } - - if ( self::gtn_group_cover_css_comp() ) { - - if ( 'no-sidebar' !== astra_page_layout() ) { - - switch ( $ast_container_layout ) { - case 'content-boxed-container': - case 'boxed-container': - $parse_css .= astra_parse_css( - array( - // With container - Sidebar. - '.ast-separate-container.ast-right-sidebar .entry-content .wp-block-group.alignwide, .ast-separate-container.ast-left-sidebar .entry-content .wp-block-group.alignwide, .ast-separate-container.ast-right-sidebar .entry-content .wp-block-cover.alignwide, .ast-separate-container.ast-left-sidebar .entry-content .wp-block-cover.alignwide' => array( - 'margin-left' => '-20px', - 'margin-right' => '-20px', - 'padding-left' => '20px', - 'padding-right' => '20px', - ), - '.ast-separate-container.ast-right-sidebar .entry-content .wp-block-group.alignfull, .ast-separate-container.ast-left-sidebar .entry-content .wp-block-group.alignfull, .ast-separate-container.ast-right-sidebar .entry-content .wp-block-cover.alignfull, .ast-separate-container.ast-left-sidebar .entry-content .wp-block-cover.alignfull' => array( - 'margin-left' => '-6.67em', - 'margin-right' => '-6.67em', - 'padding-left' => '6.67em', - 'padding-right' => '6.67em', - ), - ), - '1200' - ); - break; - - case 'plain-container': - $parse_css .= astra_parse_css( - array( - // Without container - Sidebar. - '.ast-plain-container.ast-right-sidebar .entry-content .wp-block-group.alignwide, .ast-plain-container.ast-left-sidebar .entry-content .wp-block-group.alignwide, .ast-plain-container.ast-right-sidebar .entry-content .wp-block-group.alignfull, .ast-plain-container.ast-left-sidebar .entry-content .wp-block-group.alignfull' => array( - 'padding-left' => '20px', - 'padding-right' => '20px', - ), - ), - '1200' - ); - break; - - case 'page-builder': - $parse_css .= astra_parse_css( - array( - '.ast-page-builder-template.ast-left-sidebar .entry-content .wp-block-cover.alignwide, .ast-page-builder-template.ast-right-sidebar .entry-content .wp-block-cover.alignwide, .ast-page-builder-template.ast-left-sidebar .entry-content .wp-block-cover.alignfull, .ast-page-builder-template.ast-right-sidebar .entry-content .wp-block-cover.alignful' => array( - 'padding-right' => '0', - 'padding-left' => '0', - ), - ), - '1200' - ); - break; - } - } else { - - switch ( $container_layout ) { - case 'content-boxed-container': - case 'boxed-container': - $parse_css .= astra_parse_css( - array( - // With container - No Sidebar. - '.ast-no-sidebar.ast-separate-container .entry-content .wp-block-group.alignwide, .ast-no-sidebar.ast-separate-container .entry-content .wp-block-cover.alignwide' => array( - 'margin-left' => '-20px', - 'margin-right' => '-20px', - 'padding-left' => '20px', - 'padding-right' => '20px', - ), - '.ast-no-sidebar.ast-separate-container .entry-content .wp-block-cover.alignfull, .ast-no-sidebar.ast-separate-container .entry-content .wp-block-group.alignfull' => array( - 'margin-left' => '-6.67em', - 'margin-right' => '-6.67em', - 'padding-left' => '6.67em', - 'padding-right' => '6.67em', - ), - ), - '1200' - ); - break; - - case 'plain-container': - $parse_css .= astra_parse_css( - array( - // Without container - No Sidebar. - '.ast-plain-container.ast-no-sidebar .entry-content .alignwide .wp-block-cover__inner-container, .ast-plain-container.ast-no-sidebar .entry-content .alignfull .wp-block-cover__inner-container' => array( - 'width' => astra_get_css_value( $site_content_width + 40, 'px' ), - ), - ), - '1200' - ); - break; - - case 'page-builder': - $parse_css .= astra_parse_css( - array( - '.ast-page-builder-template.ast-no-sidebar .entry-content .wp-block-cover.alignwide, .ast-page-builder-template.ast-no-sidebar .entry-content .wp-block-cover.alignfull' => array( - 'padding-right' => '0', - 'padding-left' => '0', - ), - ), - '1200' - ); - break; - } - } - - $parse_css .= astra_parse_css( - array( - '.wp-block-cover-image.alignwide .wp-block-cover__inner-container, .wp-block-cover.alignwide .wp-block-cover__inner-container, .wp-block-cover-image.alignfull .wp-block-cover__inner-container, .wp-block-cover.alignfull .wp-block-cover__inner-container' => array( - 'width' => '100%', - ), - ), - '1200' - ); - - // Remove margin top when Primary Header is not set and No Sidebar is added in Full-Width / Contained Layout. - if ( is_singular() ) { - $display_header = get_post_meta( get_the_ID(), 'ast-main-header-display', true ); - if ( 'disabled' === $display_header && apply_filters( 'astra_content_margin_full_width_contained', true ) || ( Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) || ( self::gutenberg_core_blocks_css_comp() ) ) { - $gtn_margin_top = array( - '.ast-plain-container.ast-no-sidebar #primary' => array( - 'margin-top' => '0', - 'margin-bottom' => '0', - ), - ); - $parse_css .= astra_parse_css( $gtn_margin_top ); - } - } - } - - if ( self::gutenberg_core_blocks_css_comp() ) { - - /** - * If transparent header is activated then it adds top 1.5em padding space, so this CSS will fix this issue. - * This issue is only visible on responsive devices. - * - * @since 2.6.0 - */ - if ( is_singular() ) { - - $trans_header_responsive_top_space_css_fix = array( - '.ast-theme-transparent-header #primary, .ast-theme-transparent-header #secondary' => array( - 'padding' => 0, - ), - ); - - /* Parse CSS from array() -> max-width: (tablet-breakpoint)px CSS */ - $parse_css .= astra_parse_css( $trans_header_responsive_top_space_css_fix, '', astra_get_tablet_breakpoint() ); - } - - $desktop_screen_gb_css = array( - // Group block, Columns block, Gallery block, Table block & has-text-align-center selector compatibility Desktop CSS. - '.wp-block-columns' => array( - 'margin-bottom' => 'unset', - ), - '.wp-block-image.size-full' => array( - 'margin' => '2rem 0', - ), - '.wp-block-separator.has-background' => array( - 'padding' => '0', - ), - '.wp-block-gallery' => array( - 'margin-bottom' => '1.6em', - ), - '.wp-block-group' => array( - 'padding-top' => '4em', - 'padding-bottom' => '4em', - ), - '.wp-block-group__inner-container .wp-block-columns:last-child, .wp-block-group__inner-container :last-child, .wp-block-table table' => array( - 'margin-bottom' => '0', - ), - '.blocks-gallery-grid' => array( - 'width' => '100%', - ), - '.wp-block-navigation-link__content' => array( - 'padding' => '5px 0', - ), - '.wp-block-group .wp-block-group .has-text-align-center, .wp-block-group .wp-block-column .has-text-align-center' => array( - 'max-width' => '100%', - ), - '.has-text-align-center' => array( - 'margin' => '0 auto', - ), - ); - - /* Parse CSS from array() -> Desktop CSS */ - $parse_css .= astra_parse_css( $desktop_screen_gb_css ); - - $middle_screen_min_gb_css = array( - // Group & Column block > align compatibility (min-width:1200px) CSS. - '.wp-block-cover__inner-container, .alignwide .wp-block-group__inner-container, .alignfull .wp-block-group__inner-container' => array( - 'max-width' => '1200px', - 'margin' => '0 auto', - ), - '.wp-block-group.alignnone, .wp-block-group.aligncenter, .wp-block-group.alignleft, .wp-block-group.alignright, .wp-block-group.alignwide, .wp-block-columns.alignwide' => array( - 'margin' => '2rem 0 1rem 0', - ), - ); - - /* Parse CSS from array() -> min-width: (1200)px CSS */ - $parse_css .= astra_parse_css( $middle_screen_min_gb_css, '1200' ); - - $middle_screen_max_gb_css = array( - // Group & Column block (max-width:1200px) CSS. - '.wp-block-group' => array( - 'padding' => '3em', - ), - '.wp-block-group .wp-block-group' => array( - 'padding' => '1.5em', - ), - '.wp-block-columns, .wp-block-column' => array( - 'margin' => '1rem 0', - ), - ); - - /* Parse CSS from array() -> max-width: (1200)px CSS */ - $parse_css .= astra_parse_css( $middle_screen_max_gb_css, '', '1200' ); - - $tablet_screen_min_gb_css = array( - // Columns inside Group block compatibility (min-width: tablet-breakpoint) CSS. - '.wp-block-columns .wp-block-group' => array( - 'padding' => '2em', - ), - ); - - /* Parse CSS from array() -> min-width: (tablet-breakpoint)px CSS */ - $parse_css .= astra_parse_css( $tablet_screen_min_gb_css, astra_get_tablet_breakpoint() ); - - $mobile_screen_max_gb_css = array( - // Content | image | video inside Media & Text block, Cover block, Image inside cover block compatibility (max-width: mobile-breakpoint) CSS. - '.wp-block-cover-image .wp-block-cover__inner-container, .wp-block-cover .wp-block-cover__inner-container' => array( - 'width' => 'unset', - ), - '.wp-block-cover, .wp-block-cover-image' => array( - 'padding' => '2em 0', - ), - '.wp-block-group, .wp-block-cover' => array( - 'padding' => '2em', - ), - '.wp-block-media-text__media img, .wp-block-media-text__media video' => array( - 'width' => 'unset', - 'max-width' => '100%', - ), - '.wp-block-media-text.has-background .wp-block-media-text__content' => array( - 'padding' => '1em', - ), - ); - - if ( ! self::gutenberg_media_text_block_css_compat() ) { - // Added this [! self::gutenberg_media_text_block_css_compat()] condition as we update the same selector CSS in gutenberg_media_text_block_css_compat() function with new padding: 8% 0; CSS for max-width: (mobile-breakpoint). - $mobile_screen_max_gb_css['.wp-block-media-text .wp-block-media-text__content'] = array( - 'padding' => '3em 2em', - ); - } - - /* Parse CSS from array() -> max-width: (mobile-breakpoint)px CSS */ - $parse_css .= astra_parse_css( $mobile_screen_max_gb_css, '', astra_get_mobile_breakpoint() ); - } - - if ( self::gutenberg_media_text_block_css_compat() ) { - - /** - * Remove #primary padding on mobile devices which compromises deigned layout. - * - * @since 2.6.1 - */ - if ( is_singular() ) { - - $remove_primary_padding_on_mobile_css = array( - '.ast-plain-container.ast-no-sidebar #primary' => array( - 'padding' => 0, - ), - ); - - /* Parse CSS from array() -> max-width: (tablet-breakpoint)px CSS */ - $parse_css .= astra_parse_css( $remove_primary_padding_on_mobile_css, '', astra_get_tablet_breakpoint() ); - } - - $media_text_block_padding_css = array( - // Media & Text block CSS compatibility (min-width: mobile-breakpoint) CSS. - '.entry-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content' => array( - 'padding' => '0 8% 0 0', - ), - '.entry-content .wp-block-media-text .wp-block-media-text__content' => array( - 'padding' => '0 0 0 8%', - ), - '.ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-bottom-left > *, .ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-bottom-right > *, .ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-top-left > *, .ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-top-right > *, .ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-center-right > *, .ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-center-left > *' => array( - 'margin' => 0, - ), - ); - - /* Parse CSS from array() -> min-width: (mobile-breakpoint)px CSS */ - $parse_css .= astra_parse_css( $media_text_block_padding_css, astra_get_mobile_breakpoint() ); - - $mobile_screen_media_text_block_css = array( - // Media & Text block padding CSS for (max-width: mobile-breakpoint) CSS. - '.entry-content .wp-block-media-text .wp-block-media-text__content' => array( - 'padding' => '8% 0', - ), - '.wp-block-media-text .wp-block-media-text__media img' => array( - 'width' => 'auto', - 'max-width' => '100%', - ), - ); - - /* Parse CSS from array() -> max-width: (mobile-breakpoint)px CSS */ - $parse_css .= astra_parse_css( $mobile_screen_media_text_block_css, '', astra_get_mobile_breakpoint() ); - } - - /** - * When supporting GB button outline patterns in v3.3.0 we have given 2px as default border for GB outline button, where we restrict button border for flat type buttons. - * But now while reverting this change there is no need of default border because whatever customizer border will set it should behave accordingly. Although it is empty ('') WP applying 2px as default border for outline buttons. - * - * @since 3.6.3 - */ - $default_border_size = '2px'; - if ( astra_button_default_padding_updated() ) { - $default_border_size = ''; - } - - // Outline Gutenberg button compatibility CSS. - $theme_btn_top_border = ( isset( $global_custom_button_border_size['top'] ) && ( '' !== $global_custom_button_border_size['top'] && '0' !== $global_custom_button_border_size['top'] ) ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : $default_border_size; - $theme_btn_right_border = ( isset( $global_custom_button_border_size['right'] ) && ( '' !== $global_custom_button_border_size['right'] && '0' !== $global_custom_button_border_size['right'] ) ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : $default_border_size; - $theme_btn_left_border = ( isset( $global_custom_button_border_size['left'] ) && ( '' !== $global_custom_button_border_size['left'] && '0' !== $global_custom_button_border_size['left'] ) ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : $default_border_size; - $theme_btn_bottom_border = ( isset( $global_custom_button_border_size['bottom'] ) && ( '' !== $global_custom_button_border_size['bottom'] && '0' !== $global_custom_button_border_size['bottom'] ) ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : $default_border_size; - - if ( self::gutenberg_core_patterns_compat() ) { - - $outline_button_css = array( - '.wp-block-button.is-style-outline .wp-block-button__link' => array( - 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), - 'border-top-width' => esc_attr( $theme_btn_top_border ), - 'border-right-width' => esc_attr( $theme_btn_right_border ), - 'border-bottom-width' => esc_attr( $theme_btn_bottom_border ), - 'border-left-width' => esc_attr( $theme_btn_left_border ), - ), - '.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color), .wp-block-button.wp-block-button__link.is-style-outline:not(.has-text-color)' => array( - 'color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), - ), - '.wp-block-button.is-style-outline .wp-block-button__link:hover, .wp-block-button.is-style-outline .wp-block-button__link:focus' => array( - 'color' => esc_attr( $btn_text_hover_color ) . ' !important', - 'background-color' => esc_attr( $btn_bg_hover_color ), - 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ), - ), - // Adding CSS to highlight current paginated number. - '.post-page-numbers.current .page-link, .ast-pagination .page-numbers.current' => array( - 'color' => astra_get_foreground_color( $theme_color ), - 'border-color' => esc_attr( $theme_color ), - 'background-color' => esc_attr( $theme_color ), - 'border-radius' => '2px', - ), - ); - - /* Parse CSS from array() -> All media CSS */ - $parse_css .= astra_parse_css( $outline_button_css ); - - if ( ! astra_button_default_padding_updated() ) { - // Tablet CSS. - $outline_button_tablet_css = array( - '.wp-block-button.is-style-outline .wp-block-button__link' => array( - 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', - 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', - 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', - 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', - ), - ); - - $parse_css .= astra_parse_css( $outline_button_tablet_css, '', astra_get_tablet_breakpoint() ); - - // Mobile CSS. - $outline_button_mobile_css = array( - '.wp-block-button.is-style-outline .wp-block-button__link' => array( - 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', - 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', - 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', - 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', - ), - ); - - $parse_css .= astra_parse_css( $outline_button_mobile_css, '', astra_get_mobile_breakpoint() ); - } - - if ( $is_site_rtl ) { - $gb_patterns_min_mobile_css = array( - '.entry-content > .alignleft' => array( - 'margin-left' => '20px', - ), - '.entry-content > .alignright' => array( - 'margin-right' => '20px', - ), - ); - } else { - $gb_patterns_min_mobile_css = array( - '.entry-content > .alignleft' => array( - 'margin-right' => '20px', - ), - '.entry-content > .alignright' => array( - 'margin-left' => '20px', - ), - ); - } - - if ( ! astra_button_default_padding_updated() ) { - $gb_patterns_min_mobile_css['.wp-block-group.has-background'] = array( - 'padding' => '20px', - ); - } - - /* Parse CSS from array() -> min-width: (mobile-breakpoint) px CSS */ - $parse_css .= astra_parse_css( $gb_patterns_min_mobile_css, astra_get_mobile_breakpoint() ); - } - - if ( astra_button_default_padding_updated() ) { - $outline_button_css = array( - '.wp-block-button.is-style-outline .wp-block-button__link' => array( - 'border-top-width' => esc_attr( $theme_btn_top_border ), - 'border-right-width' => esc_attr( $theme_btn_right_border ), - 'border-bottom-width' => esc_attr( $theme_btn_bottom_border ), - 'border-left-width' => esc_attr( $theme_btn_left_border ), - ), - ); - - /* Parse CSS from array() -> All media CSS */ - $parse_css .= astra_parse_css( $outline_button_css ); - } - - if ( $is_widget_title_support_font_weight ) { - $widget_title_font_weight_support = array( - 'h1.widget-title' => array( - 'font-weight' => esc_attr( $h1_font_weight ), - ), - 'h2.widget-title' => array( - 'font-weight' => esc_attr( $h2_font_weight ), - ), - 'h3.widget-title' => array( - 'font-weight' => esc_attr( $h3_font_weight ), - ), - ); - - /* Parse CSS from array() -> All media CSS */ - $parse_css .= astra_parse_css( $widget_title_font_weight_support ); - } - - $static_layout_css = array( - '.ast-separate-container .ast-article-post, .ast-separate-container .ast-article-single' => array( - 'padding' => '1.5em 2.14em', - ), - '.ast-separate-container #primary, .ast-separate-container #secondary' => array( - 'padding' => '1.5em 0', - ), - '#primary, #secondary' => array( - 'padding' => '1.5em 0', - 'margin' => 0, - ), - '.ast-left-sidebar #content > .ast-container' => array( - 'display' => 'flex', - 'flex-direction' => 'column-reverse', - 'width' => '100%', - ), - '.ast-author-box img.avatar' => array( - 'margin' => '20px 0 0 0', - ), - ); - - /* Parse CSS from array() -> max-width: (tablet-breakpoint)px CSS */ - $parse_css .= astra_parse_css( $static_layout_css, '', astra_get_tablet_breakpoint() ); - - if ( is_author() ) { - $parse_css .= astra_parse_css( - array( - '.ast-author-box img.avatar' => array( - 'margin' => '20px 0 0 0', - ), - ), - astra_get_tablet_breakpoint() - ); - } - - if ( 'no-sidebar' !== astra_page_layout() ) { - $static_secondary_layout_css = array( - '#secondary.secondary' => array( - 'padding-top' => 0, - ), - '.ast-separate-container.ast-right-sidebar #secondary' => array( - 'padding-left' => '1em', - 'padding-right' => '1em', - ), - '.ast-separate-container.ast-two-container #secondary' => array( - 'padding-left' => 0, - 'padding-right' => 0, - ), - '.ast-page-builder-template .entry-header #secondary, .ast-page-builder-template #secondary' => array( - 'margin-top' => '1.5em', - ), - ); - $parse_css .= astra_parse_css( $static_secondary_layout_css, '', astra_get_tablet_breakpoint() ); - } - - if ( 'no-sidebar' !== astra_page_layout() ) { - if ( $is_site_rtl ) { - $static_layout_lang_direction_css = array( - '.ast-right-sidebar #primary' => array( - 'padding-left' => 0, - ), - '.ast-page-builder-template.ast-left-sidebar #secondary, ast-page-builder-template.ast-right-sidebar #secondary' => array( - 'padding-left' => '20px', - 'padding-right' => '20px', - ), - '.ast-right-sidebar #secondary, .ast-left-sidebar #primary' => array( - 'padding-right' => 0, - ), - '.ast-left-sidebar #secondary' => array( - 'padding-left' => 0, - ), - ); - } else { - $static_layout_lang_direction_css = array( - '.ast-right-sidebar #primary' => array( - 'padding-right' => 0, - ), - '.ast-page-builder-template.ast-left-sidebar #secondary, .ast-page-builder-template.ast-right-sidebar #secondary' => array( - 'padding-right' => '20px', - 'padding-left' => '20px', - ), - '.ast-right-sidebar #secondary, .ast-left-sidebar #primary' => array( - 'padding-left' => 0, - ), - '.ast-left-sidebar #secondary' => array( - 'padding-right' => 0, - ), - ); - } - /* Parse CSS from array() -> max-width: (tablet-breakpoint)px CSS */ - $parse_css .= astra_parse_css( $static_layout_lang_direction_css, '', astra_get_tablet_breakpoint() ); - } - - $static_layout_css_min = array( - '.ast-separate-container.ast-right-sidebar #primary, .ast-separate-container.ast-left-sidebar #primary' => array( - 'border' => 0, - ), - '.search-no-results.ast-separate-container #primary' => array( - 'margin-bottom' => '4em', - ), - ); - - if ( is_author() ) { - $author_table_css = array( - '.ast-author-box' => array( - '-js-display' => 'flex', - 'display' => 'flex', - ), - '.ast-author-bio' => array( - 'flex' => '1', - ), - ); - $static_layout_css_min = array_merge( $static_layout_css_min, $author_table_css ); - } - - /* Parse CSS from array() -> min-width: (tablet-breakpoint + 1)px CSS */ - $parse_css .= astra_parse_css( $static_layout_css_min, astra_get_tablet_breakpoint( '', '1' ) ); - - // 404 Page. - if ( is_404() ) { - - $page_404 = array( - '.ast-404-layout-1 .ast-404-text' => array( - 'font-size' => astra_get_font_css_value( '200' ), - ), - ); - $parse_css .= astra_parse_css( $page_404 ); - - $parse_css .= astra_parse_css( - array( - '.error404.ast-separate-container #primary' => array( - 'margin-bottom' => '4em', - ), - ), - astra_get_tablet_breakpoint( '', '1' ) - ); - - $parse_css .= astra_parse_css( - array( - '.ast-404-layout-1 .ast-404-text' => array( - 'font-size' => astra_get_font_css_value( 100 ), - ), - ), - '', - '920' - ); - } - - if ( 'no-sidebar' !== astra_page_layout() ) { - - if ( $is_site_rtl ) { - $static_layout_min_lang_direction_css = array( - '.ast-right-sidebar #primary' => array( - 'border-left' => '1px solid #eee', - ), - '.ast-right-sidebar #secondary' => array( - 'border-right' => '1px solid #eee', - 'margin-right' => '-1px', - ), - '.ast-left-sidebar #primary' => array( - 'border-right' => '1px solid #eee', - ), - '.ast-left-sidebar #secondary' => array( - 'border-left' => '1px solid #eee', - 'margin-left' => '-1px', - ), - '.ast-separate-container.ast-two-container.ast-right-sidebar #secondary' => array( - 'padding-right' => '30px', - 'padding-left' => 0, - ), - '.ast-separate-container.ast-two-container.ast-left-sidebar #secondary' => array( - 'padding-left' => '30px', - 'padding-right' => 0, - ), - '.ast-separate-container.ast-right-sidebar #secondary, .ast-separate-container.ast-left-sidebar #secondary' => array( - 'border' => 0, - 'margin-left' => 'auto', - 'margin-right' => 'auto', - ), - '.ast-separate-container.ast-two-container #secondary .widget:last-child' => array( - 'margin-bottom' => 0, - ), - ); - } else { - $static_layout_min_lang_direction_css = array( - '.ast-right-sidebar #primary' => array( - 'border-right' => '1px solid #eee', - ), - '.ast-left-sidebar #primary' => array( - 'border-left' => '1px solid #eee', - ), - '.ast-right-sidebar #secondary' => array( - 'border-left' => '1px solid #eee', - 'margin-left' => '-1px', - ), - '.ast-left-sidebar #secondary' => array( - 'border-right' => '1px solid #eee', - 'margin-right' => '-1px', - ), - '.ast-separate-container.ast-two-container.ast-right-sidebar #secondary' => array( - 'padding-left' => '30px', - 'padding-right' => 0, - ), - '.ast-separate-container.ast-two-container.ast-left-sidebar #secondary' => array( - 'padding-right' => '30px', - 'padding-left' => 0, - ), - '.ast-separate-container.ast-right-sidebar #secondary, .ast-separate-container.ast-left-sidebar #secondary' => array( - 'border' => 0, - 'margin-left' => 'auto', - 'margin-right' => 'auto', - ), - '.ast-separate-container.ast-two-container #secondary .widget:last-child' => array( - 'margin-bottom' => 0, - ), - ); - } - - /* Parse CSS from array() -> min-width: (tablet-breakpoint + 1)px CSS */ - $parse_css .= astra_parse_css( $static_layout_min_lang_direction_css, astra_get_tablet_breakpoint( '', '1' ) ); - } - - /** - * Elementor & Gutenberg button backward compatibility for default styling. - */ - if ( self::page_builder_button_style_css() ) { - - $search_button_selector = $is_wp_5_8_support_enabled ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' : ''; - $search_button_hover_selector = $is_wp_5_8_support_enabled ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:focus' : ''; - - /** - * Global button CSS - Desktop. - */ - $global_button_desktop = array( - '.menu-toggle, button, .ast-button, .ast-custom-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' . $search_button_selector => array( - 'border-style' => 'solid', - 'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '0', - 'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '0', - 'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '0', - 'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '0', - 'color' => esc_attr( $btn_text_color ), - 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), - 'background-color' => esc_attr( $btn_bg_color ), - 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), - 'font-family' => astra_get_font_family( $theme_btn_font_family ), - 'font-weight' => esc_attr( $theme_btn_font_weight ), - 'font-size' => astra_get_font_css_value( $theme_btn_font_size['desktop'], $theme_btn_font_size['desktop-unit'] ), - 'line-height' => esc_attr( $theme_btn_line_height ), - 'text-transform' => esc_attr( $theme_btn_text_transform ), - 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), - ), - 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .ast-custom-button:hover .button:hover, .ast-custom-button:hover , input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus' . $search_button_hover_selector => array( - 'color' => esc_attr( $btn_text_hover_color ), - 'background-color' => esc_attr( $btn_bg_hover_color ), - 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ), - - ), - ); - - $btn_text_color_selectors = '.wp-block-button .wp-block-button__link, '; - - if ( 'color-typo' === self::elementor_default_color_font_setting() || 'color' === self::elementor_default_color_font_setting() || 'typo' === self::elementor_default_color_font_setting() ) { - $ele_btn_default_desktop = array( - '.elementor-button-wrapper .elementor-button' => array( - 'border-style' => 'solid', - 'text-decoration' => 'none', - 'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '0', - 'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '0', - 'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '0', - 'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '0', - ), - 'body .elementor-button.elementor-size-sm, body .elementor-button.elementor-size-xs, body .elementor-button.elementor-size-md, body .elementor-button.elementor-size-lg, body .elementor-button.elementor-size-xl, body .elementor-button' => array( - 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), - ), - ); - - /* Parse CSS from array() */ - $parse_css .= astra_parse_css( $ele_btn_default_desktop ); - - $ele_btn_default_tablet = array( - '.elementor-button-wrapper .elementor-button.elementor-size-sm, .elementor-button-wrapper .elementor-button.elementor-size-xs, .elementor-button-wrapper .elementor-button.elementor-size-md, .elementor-button-wrapper .elementor-button.elementor-size-lg, .elementor-button-wrapper .elementor-button.elementor-size-xl, .elementor-button-wrapper .elementor-button' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), - ), - ); - - /* Parse CSS from array() */ - $parse_css .= astra_parse_css( $ele_btn_default_tablet, '', astra_get_tablet_breakpoint() ); - - $ele_btn_default_mobile = array( - '.elementor-button-wrapper .elementor-button.elementor-size-sm, .elementor-button-wrapper .elementor-button.elementor-size-xs, .elementor-button-wrapper .elementor-button.elementor-size-md, .elementor-button-wrapper .elementor-button.elementor-size-lg, .elementor-button-wrapper .elementor-button.elementor-size-xl, .elementor-button-wrapper .elementor-button' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), - ), - ); - - /* Parse CSS from array() */ - $parse_css .= astra_parse_css( $ele_btn_default_mobile, '', astra_get_mobile_breakpoint() ); - } - - if ( 'color-typo' === self::elementor_default_color_font_setting() || 'color' === self::elementor_default_color_font_setting() ) { - // Check if Global Elementor - Theme Style - button color is set. If yes then remove ( :visited ) CSS for the compatibility. - if ( false === self::is_elementor_kit_button_color_set() ) { - $btn_text_color_selectors .= '.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited'; - } else { - $btn_text_color_selectors .= '.elementor-button-wrapper .elementor-button'; - } - - $ele_btn_color_builder_desktop = array( - '.elementor-button-wrapper .elementor-button' => array( - 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), - 'background-color' => esc_attr( $btn_bg_color ), - ), - '.elementor-button-wrapper .elementor-button:hover, .elementor-button-wrapper .elementor-button:focus' => array( - 'color' => esc_attr( $btn_text_hover_color ), - 'background-color' => esc_attr( $btn_bg_hover_color ), - 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ), - - ), - ); - - /* Parse CSS from array() */ - $parse_css .= astra_parse_css( $ele_btn_color_builder_desktop ); - } - - $global_button_page_builder_text_color_desktop = array( - $btn_text_color_selectors => array( - 'color' => esc_attr( $btn_text_color ), - ), - ); - - /* Parse CSS from array() */ - $parse_css .= astra_parse_css( $global_button_page_builder_text_color_desktop ); - - if ( 'color-typo' === self::elementor_default_color_font_setting() || 'typo' === self::elementor_default_color_font_setting() ) { - $ele_btn_typo_builder_desktop = array( - '.elementor-button-wrapper .elementor-button' => array( - 'font-family' => astra_get_font_family( $theme_btn_font_family ), - 'font-weight' => esc_attr( $theme_btn_font_weight ), - 'line-height' => esc_attr( $theme_btn_line_height ), - 'text-transform' => esc_attr( $theme_btn_text_transform ), - 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), - ), - 'body .elementor-button.elementor-size-sm, body .elementor-button.elementor-size-xs, body .elementor-button.elementor-size-md, body .elementor-button.elementor-size-lg, body .elementor-button.elementor-size-xl, body .elementor-button' => array( - 'font-size' => astra_responsive_font( $theme_btn_font_size, 'desktop' ), - ), - ); - - /* Parse CSS from array() */ - $parse_css .= astra_parse_css( $ele_btn_typo_builder_desktop ); - } - - $global_button_page_builder_desktop = array( - '.wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' => array( - 'color' => esc_attr( $btn_text_hover_color ), - 'background-color' => esc_attr( $btn_bg_hover_color ), - 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ), - ), - '.elementor-widget-heading h1.elementor-heading-title' => array( - 'line-height' => esc_attr( $h1_line_height ), - ), - '.elementor-widget-heading h2.elementor-heading-title' => array( - 'line-height' => esc_attr( $h2_line_height ), - ), - '.elementor-widget-heading h3.elementor-heading-title' => array( - 'line-height' => esc_attr( $h3_line_height ), - ), - '.elementor-widget-heading h4.elementor-heading-title' => array( - 'line-height' => esc_attr( $h4_line_height ), - ), - '.elementor-widget-heading h5.elementor-heading-title' => array( - 'line-height' => esc_attr( $h5_line_height ), - ), - '.elementor-widget-heading h6.elementor-heading-title' => array( - 'line-height' => esc_attr( $h6_line_height ), - ), - ); - - if ( self::gutenberg_core_patterns_compat() && ! astra_button_default_padding_updated() ) { - $theme_outline_gb_btn_top_border = ( isset( $global_custom_button_border_size['top'] ) && ( '' !== $global_custom_button_border_size['top'] && '0' !== $global_custom_button_border_size['top'] ) ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '2px'; - $theme_outline_gb_btn_right_border = ( isset( $global_custom_button_border_size['right'] ) && ( '' !== $global_custom_button_border_size['right'] && '0' !== $global_custom_button_border_size['right'] ) ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '2px'; - $theme_outline_gb_btn_bottom_border = ( isset( $global_custom_button_border_size['bottom'] ) && ( '' !== $global_custom_button_border_size['bottom'] && '0' !== $global_custom_button_border_size['bottom'] ) ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '2px'; - $theme_outline_gb_btn_left_border = ( isset( $global_custom_button_border_size['left'] ) && ( '' !== $global_custom_button_border_size['left'] && '0' !== $global_custom_button_border_size['left'] ) ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '2px'; - - $global_button_page_builder_desktop['.wp-block-button .wp-block-button__link'] = array( - 'border' => 'none', - 'background-color' => esc_attr( $btn_bg_color ), - 'color' => esc_attr( $btn_text_color ), - 'font-family' => astra_get_font_family( $theme_btn_font_family ), - 'font-weight' => esc_attr( $theme_btn_font_weight ), - 'line-height' => esc_attr( $theme_btn_line_height ), - 'text-transform' => esc_attr( $theme_btn_text_transform ), - 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), - 'font-size' => astra_responsive_font( $theme_btn_font_size, 'desktop' ), - 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), - 'padding' => '15px 30px', - ); - $global_button_page_builder_desktop['.wp-block-button.is-style-outline .wp-block-button__link'] = array( - 'border-style' => 'solid', - 'border-top-width' => esc_attr( $theme_outline_gb_btn_top_border ), - 'border-right-width' => esc_attr( $theme_outline_gb_btn_right_border ), - 'border-left-width' => esc_attr( $theme_outline_gb_btn_left_border ), - 'border-bottom-width' => esc_attr( $theme_outline_gb_btn_bottom_border ), - 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), - 'padding-top' => 'calc(15px - ' . (int) $theme_outline_gb_btn_top_border . 'px)', - 'padding-right' => 'calc(30px - ' . (int) $theme_outline_gb_btn_right_border . 'px)', - 'padding-bottom' => 'calc(15px - ' . (int) $theme_outline_gb_btn_bottom_border . 'px)', - 'padding-left' => 'calc(30px - ' . (int) $theme_outline_gb_btn_left_border . 'px)', - ); - - $global_button_page_builder_tablet = array( - '.wp-block-button .wp-block-button__link' => array( - 'font-size' => astra_responsive_font( $theme_btn_font_size, 'tablet' ), - 'border' => 'none', - 'padding' => '15px 30px', - ), - '.wp-block-button.is-style-outline .wp-block-button__link' => array( - 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', - 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', - 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', - 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', - ), - ); - - $global_button_page_builder_mobile = array( - '.wp-block-button .wp-block-button__link' => array( - 'font-size' => astra_responsive_font( $theme_btn_font_size, 'mobile' ), - 'border' => 'none', - 'padding' => '15px 30px', - ), - '.wp-block-button.is-style-outline .wp-block-button__link' => array( - 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', - 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', - 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', - 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', - ), - ); - } else { - - $default_border_size = '0'; - if ( astra_button_default_padding_updated() ) { - $default_border_size = ''; - } - - $global_button_page_builder_desktop['.wp-block-button .wp-block-button__link'] = array( - 'border-style' => 'solid', - 'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : $default_border_size, - 'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : $default_border_size, - 'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : $default_border_size, - 'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : $default_border_size, - 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), - 'background-color' => esc_attr( $btn_bg_color ), - 'color' => esc_attr( $btn_text_color ), - 'font-family' => astra_get_font_family( $theme_btn_font_family ), - 'font-weight' => esc_attr( $theme_btn_font_weight ), - 'line-height' => esc_attr( $theme_btn_line_height ), - 'text-transform' => esc_attr( $theme_btn_text_transform ), - 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), - 'font-size' => astra_responsive_font( $theme_btn_font_size, 'desktop' ), - 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), - ); - - $global_button_page_builder_tablet = array( - '.wp-block-button .wp-block-button__link' => array( - 'font-size' => astra_responsive_font( $theme_btn_font_size, 'tablet' ), - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), - ), - ); - - $global_button_page_builder_mobile = array( - '.wp-block-button .wp-block-button__link' => array( - 'font-size' => astra_responsive_font( $theme_btn_font_size, 'mobile' ), - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), - ), - ); - } - - /* Parse CSS from array() */ - $parse_css .= astra_parse_css( $global_button_page_builder_desktop ); - - /* Parse CSS from array() */ - $parse_css .= astra_parse_css( $global_button_page_builder_tablet, '', astra_get_tablet_breakpoint() ); - - /* Parse CSS from array() */ - $parse_css .= astra_parse_css( $global_button_page_builder_mobile, '', astra_get_mobile_breakpoint() ); - } else { - - $search_button_selector = $is_wp_5_8_support_enabled ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' : ''; - $search_button_hover_selector = $is_wp_5_8_support_enabled ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:focus' : ''; - - /** - * Global button CSS - Desktop. - */ - $global_button_desktop = array( - '.menu-toggle, button, .ast-button, .ast-custom-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' . $search_button_selector => array( - 'color' => esc_attr( $btn_text_color ), - 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), - 'background-color' => esc_attr( $btn_bg_color ), - 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), - 'font-family' => astra_get_font_family( $theme_btn_font_family ), - 'font-weight' => esc_attr( $theme_btn_font_weight ), - 'font-size' => astra_get_font_css_value( $theme_btn_font_size['desktop'], $theme_btn_font_size['desktop-unit'] ), - 'text-transform' => esc_attr( $theme_btn_text_transform ), - 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), - ), - 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .ast-custom-button:hover .button:hover, .ast-custom-button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus' . $search_button_hover_selector => array( - 'color' => esc_attr( $btn_text_hover_color ), - 'background-color' => esc_attr( $btn_bg_hover_color ), - 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ), - - ), - ); - } - - /* Parse CSS from array() */ - $parse_css .= astra_parse_css( $global_button_desktop ); - - /* Parse CSS from array() -> min-width: (tablet-breakpoint) px CSS */ - if ( empty( $site_content_width ) ) { - $container_min_tablet_css = array( - '.ast-container' => array( - 'max-width' => '100%', - ), - ); - $parse_css .= astra_parse_css( $container_min_tablet_css, astra_get_tablet_breakpoint() ); - } - - $container_min_mobile_css = array( - '.ast-container' => array( - 'max-width' => '100%', - ), - ); - - /* Parse CSS from array() -> min-width: (mobile-breakpoint) px CSS */ - $parse_css .= astra_parse_css( $container_min_mobile_css, astra_get_mobile_breakpoint() ); - - $global_button_mobile = array( - '.ast-separate-container .ast-article-post, .ast-separate-container .ast-article-single, .ast-separate-container .comments-title, .ast-separate-container .ast-archive-description' => array( - 'padding' => '1.5em 1em', - ), - '.ast-separate-container #content .ast-container' => array( - 'padding-left' => '0.54em', - 'padding-right' => '0.54em', - ), - '.ast-separate-container .ast-comment-list li.depth-1' => array( - 'padding' => '1.5em 1em', - 'margin-bottom' => '1.5em', - ), - '.ast-separate-container .ast-comment-list .bypostauthor' => array( - 'padding' => '.5em', - ), - '.ast-search-menu-icon.ast-dropdown-active .search-field' => array( - 'width' => '170px', - ), - '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' => array( - 'font-size' => astra_get_font_css_value( $theme_btn_font_size['mobile'], $theme_btn_font_size['mobile-unit'] ), - ), - '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), - 'font-size' => astra_responsive_font( $theme_btn_font_size, 'mobile' ), - ), - ); - - if ( 'no-sidebar' !== astra_page_layout() ) { - $global_button_mobile['.ast-separate-container #secondary'] = array( - 'padding-top' => 0, - ); - $global_button_mobile['.ast-separate-container.ast-two-container #secondary .widget'] = array( - 'margin-bottom' => '1.5em', - 'padding-left' => '1em', - 'padding-right' => '1em', - ); - } - - // Add/Remove logo max-width: 100%; CSS for logo in old header layout. - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && false === self::remove_logo_max_width_mobile_static_css() ) { - $global_button_mobile['.site-branding img, .site-header .site-logo-img .custom-logo-link img'] = array( - 'max-width' => '100%', - ); - } - - /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */ - $parse_css .= astra_parse_css( $global_button_mobile, '', astra_get_mobile_breakpoint() ); - - /** - * Global button CSS - -> max-width: (tablet-breakpoint) px. - */ - $global_button_tablet = array( - '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' => array( - 'font-size' => astra_get_font_css_value( $theme_btn_font_size['tablet'], $theme_btn_font_size['tablet-unit'] ), - ), - '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), - 'font-size' => astra_responsive_font( $theme_btn_font_size, 'tablet' ), - ), - '.ast-mobile-header-stack .main-header-bar .ast-search-menu-icon' => array( - 'display' => 'inline-block', - ), - '.ast-header-break-point.ast-header-custom-item-outside .ast-mobile-header-stack .main-header-bar .ast-search-icon' => array( - 'margin' => '0', - ), - '.ast-comment-avatar-wrap img' => array( - 'max-width' => '2.5em', - ), - '.ast-separate-container .ast-comment-list li.depth-1' => array( - 'padding' => '1.5em 2.14em', - ), - '.ast-separate-container .comment-respond' => array( - 'padding' => '2em 2.14em', - ), - '.ast-comment-meta' => array( - 'padding' => '0 1.8888em 1.3333em', - ), - ); - - /* Parse CSS from array() -> max-width: (tablet-breakpoint) px CSS */ - $parse_css .= astra_parse_css( $global_button_tablet, '', astra_get_tablet_breakpoint() ); - - if ( Astra_Builder_Helper::is_component_loaded( 'search', 'header', 'mobile' ) ) { - - if ( $is_site_rtl ) { - $global_button_tablet_lang_direction_css = array( - '.ast-header-break-point .ast-search-menu-icon.slide-search .search-form' => array( - 'left' => '0', - ), - '.ast-header-break-point .ast-mobile-header-stack .ast-search-menu-icon.slide-search .search-form' => array( - 'left' => '-1em', - ), - ); - } else { - $global_button_tablet_lang_direction_css = array( - '.ast-header-break-point .ast-search-menu-icon.slide-search .search-form' => array( - 'right' => '0', - ), - '.ast-header-break-point .ast-mobile-header-stack .ast-search-menu-icon.slide-search .search-form' => array( - 'right' => '-1em', - ), - ); - } - - $parse_css .= astra_parse_css( $global_button_tablet_lang_direction_css, '', astra_get_tablet_breakpoint() ); - } - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && 'custom-button' === $header_custom_button_style ) { - $css_output = array( - - // Header button typography stylings. - '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button, .ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( - 'font-family' => astra_get_font_family( $header_custom_btn_font_family ), - 'font-weight' => esc_attr( $header_custom_btn_font_weight ), - 'font-size' => astra_responsive_font( $header_custom_btn_font_size, 'desktop' ), - 'line-height' => esc_attr( $header_custom_btn_line_height ), - 'text-transform' => esc_attr( $header_custom_btn_text_transform ), - 'letter-spacing' => astra_get_css_value( $header_custom_btn_letter_spacing, 'px' ), - ), - - // Custom menu item button - Default. - '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( - 'color' => esc_attr( $header_custom_button_text_color ), - 'background-color' => esc_attr( $header_custom_button_back_color ), - 'padding-top' => astra_responsive_spacing( $header_custom_button_spacing, 'top', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $header_custom_button_spacing, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $header_custom_button_spacing, 'left', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $header_custom_button_spacing, 'right', 'desktop' ), - 'border-radius' => astra_get_css_value( $header_custom_button_radius, 'px' ), - 'border-style' => 'solid', - 'border-color' => esc_attr( $header_custom_button_border_color ), - 'border-top-width' => ( isset( $header_custom_button_border_size['top'] ) && '' !== $header_custom_button_border_size['top'] ) ? astra_get_css_value( $header_custom_button_border_size['top'], 'px' ) : '0px', - 'border-right-width' => ( isset( $header_custom_button_border_size['right'] ) && '' !== $header_custom_button_border_size['right'] ) ? astra_get_css_value( $header_custom_button_border_size['right'], 'px' ) : '0px', - 'border-left-width' => ( isset( $header_custom_button_border_size['left'] ) && '' !== $header_custom_button_border_size['left'] ) ? astra_get_css_value( $header_custom_button_border_size['left'], 'px' ) : '0px', - 'border-bottom-width' => ( isset( $header_custom_button_border_size['bottom'] ) && '' !== $header_custom_button_border_size['bottom'] ) ? astra_get_css_value( $header_custom_button_border_size['bottom'], 'px' ) : '0px', - ), - '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' => array( - 'color' => esc_attr( $header_custom_button_text_h_color ), - 'background-color' => esc_attr( $header_custom_button_back_h_color ), - 'border-color' => esc_attr( $header_custom_button_border_h_color ), - ), - - // Custom menu item button - Transparent. - '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( - 'color' => esc_attr( $header_custom_trans_button_text_color ), - 'background-color' => esc_attr( $header_custom_trans_button_back_color ), - 'padding-top' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'top', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'left', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'right', 'desktop' ), - 'border-radius' => astra_get_css_value( $header_custom_trans_button_radius, 'px' ), - 'border-style' => 'solid', - 'border-color' => esc_attr( $header_custom_trans_button_border_color ), - 'border-top-width' => ( isset( $header_custom_trans_button_border_size['top'] ) && '' !== $header_custom_trans_button_border_size['top'] ) ? astra_get_css_value( $header_custom_trans_button_border_size['top'], 'px' ) : '', - 'border-right-width' => ( isset( $header_custom_trans_button_border_size['right'] ) && '' !== $header_custom_trans_button_border_size['right'] ) ? astra_get_css_value( $header_custom_trans_button_border_size['right'], 'px' ) : '', - 'border-left-width' => ( isset( $header_custom_trans_button_border_size['left'] ) && '' !== $header_custom_trans_button_border_size['left'] ) ? astra_get_css_value( $header_custom_trans_button_border_size['left'], 'px' ) : '', - 'border-bottom-width' => ( isset( $header_custom_trans_button_border_size['bottom'] ) && '' !== $header_custom_trans_button_border_size['bottom'] ) ? astra_get_css_value( $header_custom_trans_button_border_size['bottom'], 'px' ) : '', - ), - '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' => array( - 'color' => esc_attr( $header_custom_trans_button_text_h_color ), - 'background-color' => esc_attr( $header_custom_trans_button_back_h_color ), - 'border-color' => esc_attr( $header_custom_trans_button_border_h_color ), - ), - ); - - /* Parse CSS from array() */ - $parse_css .= astra_parse_css( $css_output ); - - /* Parse CSS from array()*/ - - /* Custom Menu Item Button */ - $custom_button_css = array( - '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( - 'font-size' => astra_responsive_font( $header_custom_btn_font_size, 'tablet' ), - 'padding-top' => astra_responsive_spacing( $header_custom_button_spacing, 'top', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $header_custom_button_spacing, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $header_custom_button_spacing, 'left', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $header_custom_button_spacing, 'right', 'tablet' ), - ), - ); - - $custom_trans_button_css = array( - '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( - 'font-size' => astra_responsive_font( $header_custom_btn_font_size, 'tablet' ), - 'padding-top' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'top', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'left', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'right', 'tablet' ), - ), - ); - - /* Parse CSS from array()*/ - $parse_css .= astra_parse_css( array_merge( $custom_button_css, $custom_trans_button_css ), '', astra_get_tablet_breakpoint() ); - - /* Custom Menu Item Button */ - $custom_button = array( - '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( - 'font-size' => astra_responsive_font( $header_custom_btn_font_size, 'mobile' ), - 'padding-top' => astra_responsive_spacing( $header_custom_button_spacing, 'top', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $header_custom_button_spacing, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $header_custom_button_spacing, 'left', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $header_custom_button_spacing, 'right', 'mobile' ), - ), - ); - - $custom_trans_button = array( - '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( - 'font-size' => astra_responsive_font( $header_custom_btn_font_size, 'mobile' ), - 'padding-top' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'top', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'left', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'right', 'mobile' ), - ), - ); - - /* Parse CSS from array()*/ - $parse_css .= astra_parse_css( array_merge( $custom_button, $custom_trans_button ), '', astra_get_mobile_breakpoint() ); - } - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { - // Foreground color. - if ( ! empty( $footer_adv_link_color ) ) { - $footer_adv_tagcloud = array( - '.footer-adv .tagcloud a:hover, .footer-adv .tagcloud a.current-item' => array( - 'color' => astra_get_foreground_color( $footer_adv_link_color ), - ), - '.footer-adv .calendar_wrap #today' => array( - 'color' => astra_get_foreground_color( $footer_adv_link_color ), - ), - ); - $parse_css .= astra_parse_css( $footer_adv_tagcloud ); - } - } - - /* Width for Footer */ - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && 'content' != $astra_footer_width ) { - $genral_global_responsive = array( - '.ast-small-footer .ast-container' => array( - 'max-width' => '100%', - 'padding-left' => '35px', - 'padding-right' => '35px', - ), - ); - - /* Parse CSS from array()*/ - $parse_css .= astra_parse_css( $genral_global_responsive, astra_get_tablet_breakpoint( '', 1 ) ); - } - - /* Width for Comments for Full Width / Stretched Template */ - if ( 'page-builder' == $container_layout ) { - $page_builder_comment = array( - '.ast-page-builder-template .comments-area, .single.ast-page-builder-template .entry-header, .single.ast-page-builder-template .post-navigation, .single.ast-page-builder-template .ast-single-related-posts-container' => array( - 'max-width' => astra_get_css_value( $site_content_width + 40, 'px' ), - 'margin-left' => 'auto', - 'margin-right' => 'auto', - ), - ); - /* Parse CSS from array()*/ - $parse_css .= astra_parse_css( $page_builder_comment, astra_get_mobile_breakpoint( '', 1 ) ); - - } - - $separate_container_css = array( - 'body, .ast-separate-container' => astra_get_responsive_background_obj( $box_bg_obj, 'desktop' ), - ); - $parse_css .= astra_parse_css( $separate_container_css ); - - $tablet_typo = array(); - - if ( isset( $body_font_size['tablet'] ) && '' != $body_font_size['tablet'] ) { - - $tablet_typo = array( - // Widget Title. - '.widget-title' => array( - 'font-size' => astra_get_font_css_value( (int) $body_font_size['tablet'] * 1.428571429, 'px', 'tablet' ), - ), - ); - } - - /* Tablet Typography */ - $tablet_typography = array( - 'body, button, input, select, textarea, .ast-button, .ast-custom-button' => array( - 'font-size' => astra_responsive_font( $body_font_size, 'tablet' ), - ), - '#secondary, #secondary button, #secondary input, #secondary select, #secondary textarea' => array( - 'font-size' => astra_responsive_font( $body_font_size, 'tablet' ), - ), - '.site-title' => array( - 'font-size' => astra_responsive_font( $site_title_font_size, 'tablet' ), - 'display' => esc_attr( $tablet_title_visibility ), - ), - '.ast-archive-description .ast-archive-title' => array( - 'font-size' => astra_responsive_font( $archive_summary_title_font_size, 'tablet', 40 ), - ), - '.site-header .site-description' => array( - 'font-size' => astra_responsive_font( $site_tagline_font_size, 'tablet' ), - 'display' => esc_attr( $tablet_tagline_visibility ), - ), - '.entry-title' => array( - 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'tablet', 30 ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h1, .entry-content h1, .entry-content h1 a', - 'h1, .entry-content h1' - ) => array( - 'font-size' => astra_responsive_font( $heading_h1_font_size, 'tablet', 30 ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h2, .entry-content h2, .entry-content h2 a', - 'h2, .entry-content h2' - ) => array( - 'font-size' => astra_responsive_font( $heading_h2_font_size, 'tablet', 25 ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h3, .entry-content h3, .entry-content h3 a', - 'h3, .entry-content h3' - ) => array( - 'font-size' => astra_responsive_font( $heading_h3_font_size, 'tablet', 20 ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h4, .entry-content h4, .entry-content h4 a', - 'h4, .entry-content h4' - ) => array( - 'font-size' => astra_responsive_font( $heading_h4_font_size, 'tablet' ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h5, .entry-content h5, .entry-content h5 a', - 'h5, .entry-content h5' - ) => array( - 'font-size' => astra_responsive_font( $heading_h5_font_size, 'tablet' ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h6, .entry-content h6, .entry-content h6 a', - 'h6, .entry-content h6' - ) => array( - 'font-size' => astra_responsive_font( $heading_h6_font_size, 'tablet' ), - ), - '.ast-single-post .entry-title, .page-title' => array( - 'font-size' => astra_responsive_font( $single_post_title_font_size, 'tablet', 30 ), - ), - '.astra-logo-svg' => array( - 'width' => astra_get_css_value( $header_logo_width['tablet'], 'px' ), - ), - '.astra-logo-svg:not(.sticky-custom-logo .astra-logo-svg, .transparent-custom-logo .astra-logo-svg, .advanced-header-logo .astra-logo-svg)' => array( - 'height' => astra_get_css_value( ( ! empty( $header_logo_width['tablet-svg-height'] ) && ! is_customize_preview() ) ? $header_logo_width['tablet-svg-height'] : '', 'px' ), - ), - 'header .custom-logo-link img, .ast-header-break-point .site-logo-img .custom-mobile-logo-link img' => array( - 'max-width' => astra_get_css_value( $header_logo_width['tablet'], 'px' ), - ), - 'body, .ast-separate-container' => astra_get_responsive_background_obj( $box_bg_obj, 'tablet' ), - ); - - /* Parse CSS from array()*/ - $parse_css .= astra_parse_css( array_merge( $tablet_typo, $tablet_typography ), '', astra_get_tablet_breakpoint() ); - - $mobile_typo = array(); - if ( isset( $body_font_size['mobile'] ) && '' != $body_font_size['mobile'] ) { - $mobile_typo = array( - // Widget Title. - '.widget-title' => array( - 'font-size' => astra_get_font_css_value( (int) $body_font_size['mobile'] * 1.428571429, 'px', 'mobile' ), - ), - ); - } - - /* Mobile Typography */ - $mobile_typography = array( - 'body, button, input, select, textarea, .ast-button, .ast-custom-button' => array( - 'font-size' => astra_responsive_font( $body_font_size, 'mobile' ), - ), - '#secondary, #secondary button, #secondary input, #secondary select, #secondary textarea' => array( - 'font-size' => astra_responsive_font( $body_font_size, 'mobile' ), - ), - '.site-title' => array( - 'font-size' => astra_responsive_font( $site_title_font_size, 'mobile' ), - 'display' => esc_attr( $mobile_title_visibility ), - ), - '.ast-archive-description .ast-archive-title' => array( - 'font-size' => astra_responsive_font( $archive_summary_title_font_size, 'mobile', 40 ), - ), - '.site-header .site-description' => array( - 'font-size' => astra_responsive_font( $site_tagline_font_size, 'mobile' ), - 'display' => esc_attr( $mobile_tagline_visibility ), - ), - '.entry-title' => array( - 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'mobile', 30 ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h1, .entry-content h1, .entry-content h1 a', - 'h1, .entry-content h1' - ) => array( - 'font-size' => astra_responsive_font( $heading_h1_font_size, 'mobile', 30 ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h2, .entry-content h2, .entry-content h2 a', - 'h2, .entry-content h2' - ) => array( - 'font-size' => astra_responsive_font( $heading_h2_font_size, 'mobile', 25 ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h3, .entry-content h3, .entry-content h3 a', - 'h3, .entry-content h3' - ) => array( - 'font-size' => astra_responsive_font( $heading_h3_font_size, 'mobile', 20 ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h4, .entry-content h4, .entry-content h4 a', - 'h4, .entry-content h4' - ) => array( - 'font-size' => astra_responsive_font( $heading_h4_font_size, 'mobile' ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h5, .entry-content h5, .entry-content h5 a', - 'h5, .entry-content h5' - ) => array( - 'font-size' => astra_responsive_font( $heading_h5_font_size, 'mobile' ), - ), - - // Conditionally select the css selectors with or without achors. - self::conditional_headings_css_selectors( - 'h6, .entry-content h6, .entry-content h6 a', - 'h6, .entry-content h6' - ) => array( - 'font-size' => astra_responsive_font( $heading_h6_font_size, 'mobile' ), - ), - - '.ast-single-post .entry-title, .page-title' => array( - 'font-size' => astra_responsive_font( $single_post_title_font_size, 'mobile', 30 ), - ), - '.ast-header-break-point .site-branding img, .ast-header-break-point .custom-logo-link img' => array( - 'max-width' => astra_get_css_value( $header_logo_width['mobile'], 'px' ), - ), - '.astra-logo-svg' => array( - 'width' => astra_get_css_value( $header_logo_width['mobile'], 'px' ), - ), - '.astra-logo-svg:not(.sticky-custom-logo .astra-logo-svg, .transparent-custom-logo .astra-logo-svg, .advanced-header-logo .astra-logo-svg)' => array( - 'height' => astra_get_css_value( ( ! empty( $header_logo_width['mobile-svg-height'] ) && ! is_customize_preview() ) ? $header_logo_width['mobile-svg-height'] : '', 'px' ), - ), - '.ast-header-break-point .site-logo-img .custom-mobile-logo-link img' => array( - 'max-width' => astra_get_css_value( $header_logo_width['mobile'], 'px' ), - ), - 'body, .ast-separate-container' => astra_get_responsive_background_obj( $box_bg_obj, 'mobile' ), - ); - - /* Parse CSS from array()*/ - $parse_css .= astra_parse_css( array_merge( $mobile_typo, $mobile_typography ), '', astra_get_mobile_breakpoint() ); - - /* - * Responsive Font Size for Tablet & Mobile to the root HTML element - */ - - // Tablet Font Size for HTML tag. - if ( '' == $body_font_size['tablet'] ) { - $html_tablet_typography = array( - 'html' => array( - 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 5.7, '%' ), - ), - ); - $parse_css .= astra_parse_css( $html_tablet_typography, '', astra_get_tablet_breakpoint() ); - } - // Mobile Font Size for HTML tag. - if ( '' == $body_font_size['mobile'] ) { - $html_mobile_typography = array( - 'html' => array( - 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 5.7, '%' ), - ), - ); - } else { - $html_mobile_typography = array( - 'html' => array( - 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 6.25, '%' ), - ), - ); - } - /* Parse CSS from array()*/ - $parse_css .= astra_parse_css( $html_mobile_typography, '', astra_get_mobile_breakpoint() ); - - /* Site width Responsive */ - $site_width = array( - '.ast-container' => array( - 'max-width' => astra_get_css_value( $site_content_width + 40, 'px' ), - ), - ); - - /* Parse CSS from array()*/ - $parse_css .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) ); - - if ( is_astra_addon_3_5_0_version() ) { - $mega_menu_css = array( - '.ast-desktop .main-header-menu:not(#ast-hf-mobile-menu) .astra-full-megamenu-wrapper .sub-menu, .ast-desktop .main-header-menu:not(#ast-hf-mobile-menu) .astra-megamenu .sub-menu' => array( - 'box-shadow' => 'none', - ), - '.ast-desktop .main-header-menu:not(#ast-hf-mobile-menu) .astra-full-megamenu-wrapper' => array( - 'box-shadow' => '0 4px 10px -2px rgba(0, 0, 0, 0.1)', - ), - '.ast-desktop .main-header-menu > .menu-item .astra-full-megamenu-wrapper:before' => array( - 'position' => 'absolute', - 'content' => '', - 'top' => '0', - 'right' => '0', - 'width' => '100%', - 'transform' => 'translateY(-100%)', - ), - ); - $parse_css .= astra_parse_css( $mega_menu_css ); - } - /** - * Astra Fonts - */ - if ( apply_filters( 'astra_enable_default_fonts', true ) ) { - $astra_fonts = '@font-face {'; - $astra_fonts .= 'font-family: "Astra";'; - $astra_fonts .= 'src: url(' . ASTRA_THEME_URI . 'assets/fonts/astra.woff) format("woff"),'; - $astra_fonts .= 'url(' . ASTRA_THEME_URI . 'assets/fonts/astra.ttf) format("truetype"),'; - $astra_fonts .= 'url(' . ASTRA_THEME_URI . 'assets/fonts/astra.svg#astra) format("svg");'; - $astra_fonts .= 'font-weight: normal;'; - $astra_fonts .= 'font-style: normal;'; - $astra_fonts .= 'font-display: ' . astra_get_fonts_display_property() . ';'; - $astra_fonts .= '}'; - $parse_css .= $astra_fonts; - } - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { - /** - * Hide the default naviagtion markup for responsive devices. - * Once class .ast-header-break-point is added to the body below CSS will be override by the - * .ast-header-break-point class - */ - $astra_navigation = '@media (max-width:' . $header_break_point . 'px) {'; - $astra_navigation .= '.main-header-bar .main-header-bar-navigation{'; - $astra_navigation .= 'display:none;'; - $astra_navigation .= '}'; - $astra_navigation .= '}'; - $parse_css .= $astra_navigation; - } - - /* Blog */ - if ( 'custom' === $blog_width ) : - - /* Site width Responsive */ - $blog_css = array( - '.blog .site-content > .ast-container, .archive .site-content > .ast-container, .search .site-content > .ast-container' => array( - 'max-width' => astra_get_css_value( $blog_max_width, 'px' ), - ), - ); - $parse_css .= astra_parse_css( $blog_css, astra_get_tablet_breakpoint( '', 1 ) ); - endif; - - /* Single Blog */ - if ( 'custom' === $single_post_max ) : - - /* Site width Responsive */ - $single_blog_css = array( - '.single-post .site-content > .ast-container' => array( - 'max-width' => astra_get_css_value( $single_post_max_width, 'px' ), - ), - ); - $parse_css .= astra_parse_css( $single_blog_css, astra_get_tablet_breakpoint( '', 1 ) ); - endif; - - // Primary Submenu Border Width & Color. - $submenu_border_style = array( - '.ast-desktop .main-header-menu.submenu-with-border .sub-menu, .ast-desktop .main-header-menu.submenu-with-border .astra-full-megamenu-wrapper' => array( - 'border-color' => esc_attr( $primary_submenu_b_color ), - ), - - '.ast-desktop .main-header-menu.submenu-with-border .sub-menu' => array( - 'border-top-width' => astra_get_css_value( $submenu_border['top'], 'px' ), - 'border-right-width' => astra_get_css_value( $submenu_border['right'], 'px' ), - 'border-left-width' => astra_get_css_value( $submenu_border['left'], 'px' ), - 'border-bottom-width' => astra_get_css_value( $submenu_border['bottom'], 'px' ), - 'border-style' => 'solid', - ), - '.ast-desktop .main-header-menu.submenu-with-border .sub-menu .sub-menu' => array( - 'top' => ( isset( $submenu_border['top'] ) && '' != $submenu_border['top'] ) ? astra_get_css_value( '-' . $submenu_border['top'], 'px' ) : '', - ), - '.ast-desktop .main-header-menu.submenu-with-border .sub-menu .menu-link, .ast-desktop .main-header-menu.submenu-with-border .children .menu-link' => array( - 'border-bottom-width' => ( $primary_submenu_item_border ) ? '1px' : '0px', - 'border-style' => 'solid', - 'border-color' => esc_attr( $primary_submenu_item_b_color ), - ), - ); - - // Submenu items goes outside? - $submenu_border_for_left_align_menu = array( - '.main-header-menu .sub-menu .menu-item.ast-left-align-sub-menu:hover > .sub-menu, .main-header-menu .sub-menu .menu-item.ast-left-align-sub-menu.focus > .sub-menu' => array( - 'margin-left' => ( ( isset( $submenu_border['left'] ) && '' != $submenu_border['left'] ) || isset( $submenu_border['right'] ) && '' != $submenu_border['right'] ) ? astra_get_css_value( '-' . ( (int) $submenu_border['left'] + (int) $submenu_border['right'] ), 'px' ) : '', - ), - ); - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { - $parse_css .= astra_parse_css( $submenu_border_style ); - } - - // Submenu items goes outside? - $parse_css .= astra_parse_css( $submenu_border_for_left_align_menu, astra_get_tablet_breakpoint( '', 1 ) ); - - /* Small Footer CSS */ - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && 'disabled' != $small_footer_layout ) : - $sml_footer_css = array( - '.ast-small-footer' => array( - 'border-top-style' => 'solid', - 'border-top-width' => astra_get_css_value( $small_footer_divider, 'px' ), - 'border-top-color' => esc_attr( $small_footer_divider_color ), - ), - ); - $parse_css .= astra_parse_css( $sml_footer_css ); - - if ( 'footer-sml-layout-2' != $small_footer_layout ) { - $sml_footer_css = array( - '.ast-small-footer-wrap' => array( - 'text-align' => 'center', - ), - ); - $parse_css .= astra_parse_css( $sml_footer_css ); - } - endif; - - /* Transparent Header - Comonent header specific CSS compatibility */ - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active && Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) { - - $html_text_color = astra_get_option( 'transparent-header-html-text-color' ); - $html_link_color = astra_get_option( 'transparent-header-html-link-color' ); - $html_link_h_color = astra_get_option( 'transparent-header-html-link-h-color' ); - - $search_icon_color = astra_get_option( 'transparent-header-search-icon-color' ); - $search_text_color = astra_get_option( 'transparent-header-search-box-placeholder-color' ); - - $search_box_bg_color = astra_get_option( 'transparent-header-search-box-background-color' ); - - $social_color = astra_get_option( 'transparent-header-social-icons-color' ); - $social_hover_color = astra_get_option( 'transparent-header-social-icons-h-color' ); - $social_bg_color = astra_get_option( 'transparent-header-social-icons-bg-color' ); - $social_bg_hover_color = astra_get_option( 'transparent-header-social-icons-bg-h-color' ); - - $widget_title_color = astra_get_option( 'transparent-header-widget-title-color' ); - $widget_content_color = astra_get_option( 'transparent-header-widget-content-color' ); - $widget_link_color = astra_get_option( 'transparent-header-widget-link-color' ); - $widget_link_hover_color = astra_get_option( 'transparent-header-widget-link-h-color' ); - - $button_color = astra_get_option( 'transparent-header-button-text-color' ); - $button_h_color = astra_get_option( 'transparent-header-button-text-h-color' ); - $button_bg_color = astra_get_option( 'transparent-header-button-bg-color' ); - $button_bg_h_color = astra_get_option( 'transparent-header-button-bg-h-color' ); - - $divider_color = astra_get_option( 'transparent-header-divider-color' ); - $account_icon_color = astra_get_option( 'transparent-account-icon-color' ); - $account_loggedout_text_color = astra_get_option( 'transparent-account-type-text-color' ); - - // Menu colors. - $account_menu_resp_color = astra_get_option( 'transparent-account-menu-color-responsive' ); - $account_menu_resp_bg_color = astra_get_option( 'transparent-account-menu-bg-obj-responsive' ); - $account_menu_resp_color_hover = astra_get_option( 'transparent-account-menu-h-color-responsive' ); - $account_menu_resp_bg_color_hover = astra_get_option( 'transparent-account-menu-h-bg-color-responsive' ); - $account_menu_resp_color_active = astra_get_option( 'transparent-account-menu-a-color-responsive' ); - $account_menu_resp_bg_color_active = astra_get_option( 'transparent-account-menu-a-bg-color-responsive' ); - - $account_menu_resp_color_desktop = ( isset( $account_menu_resp_color['desktop'] ) ) ? $account_menu_resp_color['desktop'] : ''; - $account_menu_resp_color_tablet = ( isset( $account_menu_resp_color['tablet'] ) ) ? $account_menu_resp_color['tablet'] : ''; - $account_menu_resp_color_mobile = ( isset( $account_menu_resp_color['mobile'] ) ) ? $account_menu_resp_color['mobile'] : ''; - - $account_menu_resp_bg_color_desktop = ( isset( $account_menu_resp_bg_color['desktop'] ) ) ? $account_menu_resp_bg_color['desktop'] : ''; - $account_menu_resp_bg_color_tablet = ( isset( $account_menu_resp_bg_color['tablet'] ) ) ? $account_menu_resp_bg_color['tablet'] : ''; - $account_menu_resp_bg_color_mobile = ( isset( $account_menu_resp_bg_color['mobile'] ) ) ? $account_menu_resp_bg_color['mobile'] : ''; - - $account_menu_resp_color_hover_desktop = ( isset( $account_menu_resp_color_hover['desktop'] ) ) ? $account_menu_resp_color_hover['desktop'] : ''; - $account_menu_resp_color_hover_tablet = ( isset( $account_menu_resp_color_hover['tablet'] ) ) ? $account_menu_resp_color_hover['tablet'] : ''; - $account_menu_resp_color_hover_mobile = ( isset( $account_menu_resp_color_hover['mobile'] ) ) ? $account_menu_resp_color_hover['mobile'] : ''; - - $account_menu_resp_bg_color_hover_desktop = ( isset( $account_menu_resp_bg_color_hover['desktop'] ) ) ? $account_menu_resp_bg_color_hover['desktop'] : ''; - $account_menu_resp_bg_color_hover_tablet = ( isset( $account_menu_resp_bg_color_hover['tablet'] ) ) ? $account_menu_resp_bg_color_hover['tablet'] : ''; - $account_menu_resp_bg_color_hover_mobile = ( isset( $account_menu_resp_bg_color_hover['mobile'] ) ) ? $account_menu_resp_bg_color_hover['mobile'] : ''; - - $account_menu_resp_color_active_desktop = ( isset( $account_menu_resp_color_active['desktop'] ) ) ? $account_menu_resp_color_active['desktop'] : ''; - $account_menu_resp_color_active_tablet = ( isset( $account_menu_resp_color_active['tablet'] ) ) ? $account_menu_resp_color_active['tablet'] : ''; - $account_menu_resp_color_active_mobile = ( isset( $account_menu_resp_color_active['mobile'] ) ) ? $account_menu_resp_color_active['mobile'] : ''; - - $account_menu_resp_bg_color_active_desktop = ( isset( $account_menu_resp_bg_color_active['desktop'] ) ) ? $account_menu_resp_bg_color_active['desktop'] : ''; - $account_menu_resp_bg_color_active_tablet = ( isset( $account_menu_resp_bg_color_active['tablet'] ) ) ? $account_menu_resp_bg_color_active['tablet'] : ''; - $account_menu_resp_bg_color_active_mobile = ( isset( $account_menu_resp_bg_color_active['mobile'] ) ) ? $account_menu_resp_bg_color_active['mobile'] : ''; - - $transparent_header_builder_desktop_css = array( - '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element' => array( - 'color' => esc_attr( $html_text_color ), - ), - '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element a' => array( - 'color' => esc_attr( $html_link_color ), - ), - '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element a:hover' => array( - 'color' => esc_attr( $html_link_h_color ), - ), - '.ast-theme-transparent-header .ast-header-search .astra-search-icon, .ast-theme-transparent-header .ast-header-search .search-field::placeholder' => array( - 'color' => esc_attr( $search_icon_color ), - ), - '.ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field::placeholder' => array( - 'color' => esc_attr( $search_text_color ), - ), - '.ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-form, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-submit' => array( - 'background-color' => esc_attr( $search_box_bg_color ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element' => array( - 'background' => esc_attr( $social_bg_color['desktop'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element svg' => array( - 'fill' => esc_attr( $social_color['desktop'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover' => array( - 'background' => esc_attr( $social_bg_hover_color['desktop'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover svg' => array( - 'fill' => esc_attr( $social_hover_color['desktop'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element .social-item-label' => array( - 'color' => esc_attr( $social_color['desktop'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover .social-item-label' => array( - 'color' => esc_attr( $social_hover_color['desktop'] ), - ), - '.ast-theme-transparent-header .widget-area.header-widget-area .widget-title' => array( - 'color' => esc_attr( $widget_title_color ), - ), - '.ast-theme-transparent-header .widget-area.header-widget-area .header-widget-area-inner' => array( - 'color' => esc_attr( $widget_content_color ), - ), - '.ast-theme-transparent-header .widget-area.header-widget-area .header-widget-area-inner a' => array( - 'color' => esc_attr( $widget_link_color ), - ), - '.ast-theme-transparent-header .widget-area.header-widget-area .header-widget-area-inner a:hover' => array( - 'color' => esc_attr( $widget_link_hover_color ), - ), - '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button' => array( - 'color' => esc_attr( $button_color ), - 'background' => esc_attr( $button_bg_color ), - ), - '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button:hover' => array( - 'color' => esc_attr( $button_h_color ), - 'background' => esc_attr( $button_bg_h_color ), - ), - '.ast-theme-transparent-header .ast-header-divider-element .ast-divider-wrapper' => array( - 'border-color' => esc_attr( $divider_color ), - ), - '.ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-type-icon .ahfb-svg-iconset svg path:not(.ast-hf-account-unfill), .ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-type-icon .ahfb-svg-iconset svg circle' => array( - 'fill' => esc_attr( $account_icon_color ), - ), - '.ast-theme-transparent-header .ast-header-account-wrap .ast-account-nav-menu .menu-item .menu-link' => array( - 'color' => esc_attr( $account_menu_resp_color_desktop ), - ), - '.ast-theme-transparent-header .ast-header-account-wrap .ast-account-nav-menu .menu-item:hover > .menu-link' => array( - 'color' => $account_menu_resp_color_hover_desktop, - 'background' => $account_menu_resp_bg_color_hover_desktop, - ), - '.ast-theme-transparent-header .ast-header-account-wrap .ast-account-nav-menu .menu-item.current-menu-item > .menu-link' => array( - 'color' => $account_menu_resp_color_active_desktop, - 'background' => $account_menu_resp_bg_color_active_desktop, - ), - '.ast-theme-transparent-header .ast-header-account-wrap .account-main-navigation ul' => array( - 'background' => $account_menu_resp_bg_color_desktop, - ), - '.ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-text' => array( - 'color' => $account_loggedout_text_color, - ), - ); - - if ( Astra_Builder_Helper::apply_flex_based_css() ) { - $transparent_header_widget_selector = '.ast-theme-transparent-header .widget-area.header-widget-area.header-widget-area-inner'; - } else { - $transparent_header_widget_selector = '.ast-theme-transparent-header .widget-area.header-widget-area. header-widget-area-inner'; - } - - $transparent_header_builder_desktop_css[ $transparent_header_widget_selector ] = array( - 'color' => esc_attr( $widget_content_color ), - ); - $transparent_header_builder_desktop_css[ $transparent_header_widget_selector . ' a' ] = array( - 'color' => esc_attr( $widget_link_color ), - ); - $transparent_header_builder_desktop_css[ $transparent_header_widget_selector . ' a:hover' ] = array( - 'color' => esc_attr( $widget_link_hover_color ), - ); - - if ( Astra_Builder_Helper::is_component_loaded( 'mobile-trigger', 'header', 'mobile' ) ) { - - $transparent_toggle_selector = '.ast-theme-transparent-header [data-section="section-header-mobile-trigger"]'; - - $trigger_bg = astra_get_option( 'transparent-header-toggle-btn-bg-color' ); - $trigger_border_color = astra_get_option( 'transparent-header-toggle-border-color', $trigger_bg ); - $style = astra_get_option( 'mobile-header-toggle-btn-style' ); - $default = '#ffffff'; - - if ( 'fill' !== $style ) { - $default = $theme_color; - } - - $icon_color = astra_get_option( 'transparent-header-toggle-btn-color' ); - - /** - * Off-Canvas CSS. - */ - $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg' ] = array( - 'fill' => $icon_color, - ); - - $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .mobile-menu-wrap .mobile-menu' ] = array( - // Color. - 'color' => $icon_color, - ); - - if ( 'fill' === $style ) { - $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .ast-mobile-menu-trigger-fill' ] = array( - 'background' => esc_attr( $trigger_bg ), - ); - $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .ast-mobile-menu-trigger-fill, ' . $transparent_toggle_selector . ' .ast-button-wrap .ast-mobile-menu-trigger-minimal' ] = array( - // Color & Border. - 'color' => esc_attr( $icon_color ), - 'border' => 'none', - ); - } elseif ( 'outline' === $style ) { - $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .ast-mobile-menu-trigger-outline' ] = array( - // Background. - 'background' => 'transparent', - 'color' => esc_attr( $icon_color ), - 'border-color' => $trigger_border_color, - ); - } else { - $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .ast-mobile-menu-trigger-minimal' ] = array( - 'background' => 'transparent', - ); - } - } - - $parse_css .= astra_parse_css( $transparent_header_builder_desktop_css ); - - /** - * Max-width: Tablet Breakpoint CSS. - */ - $transparent_header_builder_tablet_css = array( - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element' => array( - 'background' => esc_attr( $social_bg_color['tablet'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element svg' => array( - 'fill' => esc_attr( $social_color['tablet'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover' => array( - 'background' => esc_attr( $social_bg_hover_color['tablet'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover svg' => array( - 'fill' => esc_attr( $social_hover_color['tablet'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element .social-item-label' => array( - 'color' => esc_attr( $social_color['tablet'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover .social-item-label' => array( - 'color' => esc_attr( $social_hover_color['tablet'] ), - ), - '.ast-theme-transparent-header .ast-account-nav-menu .menu-item .menu-link' => array( - 'color' => esc_attr( $account_menu_resp_color_tablet ), - ), - '.ast-theme-transparent-header .ast-account-nav-menu .menu-item:hover > .menu-link' => array( - 'color' => $account_menu_resp_color_hover_tablet, - 'background' => $account_menu_resp_bg_color_hover_tablet, - ), - '.ast-theme-transparent-header .ast-account-nav-menu .menu-item.current-menu-item > .menu-link' => array( - 'color' => $account_menu_resp_color_active_tablet, - 'background' => $account_menu_resp_bg_color_active_tablet, - ), - '.ast-theme-transparent-header .account-main-navigation ul' => array( - 'background' => $account_menu_resp_bg_color_tablet, - ), - ); - - $parse_css .= astra_parse_css( $transparent_header_builder_tablet_css, '', astra_get_tablet_breakpoint() ); - - /** - * Max-width: Mobile Breakpoint CSS. - */ - $transparent_header_builder_mobile_css = array( - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element' => array( - 'background' => esc_attr( $social_bg_color['mobile'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element svg' => array( - 'fill' => esc_attr( $social_color['mobile'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover' => array( - 'background' => esc_attr( $social_bg_hover_color['mobile'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover svg' => array( - 'fill' => esc_attr( $social_hover_color['mobile'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element .social-item-label' => array( - 'color' => esc_attr( $social_color['mobile'] ), - ), - '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover .social-item-label' => array( - 'color' => esc_attr( $social_hover_color['mobile'] ), - ), - '.ast-theme-transparent-header .ast-account-nav-menu .menu-item .menu-link' => array( - 'color' => esc_attr( $account_menu_resp_color_mobile ), - ), - '.ast-theme-transparent-header .ast-account-nav-menu .menu-item:hover > .menu-link' => array( - 'color' => $account_menu_resp_color_hover_mobile, - 'background' => $account_menu_resp_bg_color_hover_mobile, - ), - '.ast-theme-transparent-header .ast-account-nav-menu .menu-item.current-menu-item > .menu-link' => array( - 'color' => $account_menu_resp_color_active_mobile, - 'background' => $account_menu_resp_bg_color_active_mobile, - ), - '.ast-theme-transparent-header .account-main-navigation ul' => array( - 'background' => $account_menu_resp_bg_color_mobile, - ), - ); - - $parse_css .= astra_parse_css( $transparent_header_builder_mobile_css, '', astra_get_mobile_breakpoint() ); - } - - $parse_css .= $dynamic_css; - $custom_css = astra_get_option( 'custom-css' ); - - if ( '' != $custom_css ) { - $parse_css .= $custom_css; - } - - // trim white space for faster page loading. - $parse_css = Astra_Enqueue_Scripts::trim_css( $parse_css ); - - return apply_filters( 'astra_theme_dynamic_css', $parse_css ); - - } - - /** - * Return post meta CSS - * - * @param string $dynamic_css Astra Dynamic CSS. - * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. - * @return mixed Return the CSS. - */ - public static function return_meta_output( $dynamic_css, $dynamic_css_filtered = '' ) { - - /** - * - Page Layout - * - * - Sidebar Positions CSS - */ - $secondary_width = astra_get_option( 'site-sidebar-width' ); - $primary_width = absint( 100 - $secondary_width ); - $meta_style = ''; - - // Header Separator. - $header_separator = astra_get_option( 'header-main-sep' ); - $header_separator_color = astra_get_option( 'header-main-sep-color' ); - - $meta_style = array( - '.ast-header-break-point .main-header-bar' => array( - 'border-bottom-width' => astra_get_css_value( $header_separator, 'px' ), - 'border-bottom-color' => esc_attr( $header_separator_color ), - ), - ); - - $parse_css = astra_parse_css( $meta_style ); - - $meta_style = array( - '.main-header-bar' => array( - 'border-bottom-width' => astra_get_css_value( $header_separator, 'px' ), - 'border-bottom-color' => esc_attr( $header_separator_color ), - ), - ); - - $parse_css .= astra_parse_css( $meta_style, astra_get_tablet_breakpoint( '', 1 ) ); - - if ( 'no-sidebar' !== astra_page_layout() ) : - - $meta_style = array( - '#primary' => array( - 'width' => astra_get_css_value( $primary_width, '%' ), - ), - '#secondary' => array( - 'width' => astra_get_css_value( $secondary_width, '%' ), - ), - ); - - $parse_css .= astra_parse_css( $meta_style, astra_get_tablet_breakpoint( '', 1 ) ); - - endif; - - if ( false === self::astra_submenu_below_header_fix() ) : - // If submenu below header fix is not to be loaded then add removed flex properties from class `ast-flex`. - // Also restore the padding to class `main-header-bar`. - $submenu_below_header = array( - '.ast-flex' => array( - '-webkit-align-content' => 'center', - '-ms-flex-line-pack' => 'center', - 'align-content' => 'center', - '-webkit-box-align' => 'center', - '-webkit-align-items' => 'center', - '-moz-box-align' => 'center', - '-ms-flex-align' => 'center', - 'align-items' => 'center', - ), - '.main-header-bar' => array( - 'padding' => '1em 0', - ), - '.ast-site-identity' => array( - 'padding' => '0', - ), - // CSS to open submenu just below menu. - '.header-main-layout-1 .ast-flex.main-header-container, .header-main-layout-3 .ast-flex.main-header-container' => array( - '-webkit-align-content' => 'center', - '-ms-flex-line-pack' => 'center', - 'align-content' => 'center', - '-webkit-box-align' => 'center', - '-webkit-align-items' => 'center', - '-moz-box-align' => 'center', - '-ms-flex-align' => 'center', - 'align-items' => 'center', - ), - ); - - $parse_css .= astra_parse_css( $submenu_below_header ); - - else : - // `.menu-item` required display:flex, although weight of this css increases because of which custom CSS added from child themes to be not working. - // Hence this is added to dynamic CSS which will be applied only if this filter `astra_submenu_below_header_fix` is enabled. - // @see https://github.com/brainstormforce/astra/pull/828 - $submenu_below_header = array( - '.ast-safari-browser-less-than-11 .main-header-menu .menu-item, .ast-safari-browser-less-than-11 .main-header-bar .ast-masthead-custom-menu-items' => array( - 'display' => 'block', - ), - '.main-header-menu .menu-item, #astra-footer-menu .menu-item, .main-header-bar .ast-masthead-custom-menu-items' => array( - '-js-display' => 'flex', - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - '-webkit-box-pack' => 'center', - '-webkit-justify-content' => 'center', - '-moz-box-pack' => 'center', - '-ms-flex-pack' => 'center', - 'justify-content' => 'center', - '-webkit-box-orient' => 'vertical', - '-webkit-box-direction' => 'normal', - '-webkit-flex-direction' => 'column', - '-moz-box-orient' => 'vertical', - '-moz-box-direction' => 'normal', - '-ms-flex-direction' => 'column', - 'flex-direction' => 'column', - ), - '.main-header-menu > .menu-item > .menu-link, #astra-footer-menu > .menu-item > .menu-link,' => array( - 'height' => '100%', - '-webkit-box-align' => 'center', - '-webkit-align-items' => 'center', - '-moz-box-align' => 'center', - '-ms-flex-align' => 'center', - 'align-items' => 'center', - '-js-display' => 'flex', - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - ), - ); - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { - $submenu_below_header['.ast-primary-menu-disabled .main-header-bar .ast-masthead-custom-menu-items'] = array( - 'flex' => 'unset', - ); - } - - $parse_css .= astra_parse_css( $submenu_below_header ); - - endif; - - if ( false === self::astra_submenu_open_below_header_fix() ) { - // If submenu below header fix is not to be loaded then add removed flex properties from class `ast-flex`. - // Also restore the padding to class `main-header-bar`. - $submenu_below_header = array( - // CSS to open submenu just below menu. - '.header-main-layout-1 .ast-flex.main-header-container, .header-main-layout-3 .ast-flex.main-header-container' => array( - '-webkit-align-content' => 'center', - '-ms-flex-line-pack' => 'center', - 'align-content' => 'center', - '-webkit-box-align' => 'center', - '-webkit-align-items' => 'center', - '-moz-box-align' => 'center', - '-ms-flex-align' => 'center', - 'align-items' => 'center', - ), - ); - - $parse_css .= astra_parse_css( $submenu_below_header ); - } - - $submenu_toggle = ''; - - if ( false === Astra_Icons::is_svg_icons() ) { - $submenu_toggle = array( - // HFB / Old Header Footer - CSS compatibility when SVGs are disabled. - '.main-header-menu .sub-menu .menu-item.menu-item-has-children > .menu-link:after' => array( - 'position' => 'absolute', - 'right' => '1em', - 'top' => '50%', - 'transform' => 'translate(0,-50%) rotate(270deg)', - ), - '.ast-header-break-point .main-header-bar .main-header-bar-navigation .page_item_has_children > .ast-menu-toggle::before, .ast-header-break-point .main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before, .ast-mobile-popup-drawer .main-header-bar-navigation .menu-item-has-children>.ast-menu-toggle::before, .ast-header-break-point .ast-mobile-header-wrap .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before' => array( - 'font-weight' => 'bold', - 'content' => '"\e900"', - 'font-family' => 'Astra', - 'text-decoration' => 'inherit', - 'display' => 'inline-block', - ), - '.ast-header-break-point .main-navigation ul.sub-menu .menu-item .menu-link:before' => array( - 'content' => '"\e900"', - 'font-family' => 'Astra', - 'font-size' => '.65em', - 'text-decoration' => 'inherit', - 'display' => 'inline-block', - 'transform' => 'translate(0, -2px) rotateZ(270deg)', - 'margin-right' => '5px', - ), - '.widget_search .search-form:after' => array( - 'font-family' => 'Astra', - 'font-size' => '1.2em', - 'font-weight' => 'normal', - 'content' => '"\e8b6"', - 'position' => 'absolute', - 'top' => '50%', - 'right' => '15px', - 'transform' => 'translate(0, -50%)', - ), - '.astra-search-icon::before' => array( - 'content' => '"\e8b6"', - 'font-family' => 'Astra', - 'font-style' => 'normal', - 'font-weight' => 'normal', - 'text-decoration' => 'inherit', - 'text-align' => 'center', - '-webkit-font-smoothing' => 'antialiased', - '-moz-osx-font-smoothing' => 'grayscale', - ), - '.main-header-bar .main-header-bar-navigation .page_item_has_children > a:after, .main-header-bar .main-header-bar-navigation .menu-item-has-children > a:after, .site-header-focus-item .main-header-bar-navigation .menu-item-has-children > .menu-link:after' => array( - 'content' => '"\e900"', - 'display' => 'inline-block', - 'font-family' => 'Astra', - 'font-size' => '9px', - 'font-size' => '.6rem', - 'font-weight' => 'bold', - 'text-rendering' => 'auto', - '-webkit-font-smoothing' => 'antialiased', - '-moz-osx-font-smoothing' => 'grayscale', - 'margin-left' => '10px', - 'line-height' => 'normal', - ), - '.ast-mobile-popup-drawer .main-header-bar-navigation .ast-submenu-expanded>.ast-menu-toggle::before' => array( - 'transform' => 'rotateX(180deg)', - ), - '.ast-header-break-point .main-header-bar-navigation .menu-item-has-children > .menu-link:after' => array( - 'display' => 'none', - ), - ); - } else { - if ( ! Astra_Builder_Helper::$is_header_footer_builder_active ) { - $submenu_toggle = array( - // Old Header Footer - SVG Support. - '.ast-desktop .main-header-menu .sub-menu .menu-item.menu-item-has-children>.menu-link .icon-arrow svg' => array( - 'position' => 'absolute', - 'right' => '.6em', - 'top' => '50%', - 'transform' => 'translate(0,-50%) rotate(270deg)', - ), - '.ast-header-break-point .main-navigation ul .menu-item .menu-link .icon-arrow:first-of-type svg' => array( - 'left' => '.1em', - 'top' => '.1em', - 'transform' => 'translate(0, -2px) rotateZ(270deg)', - ), - ); - } else { - $submenu_toggle = array( - // New Header Footer - SVG Support. - '.ast-header-break-point .main-navigation ul .menu-item .menu-link .icon-arrow:first-of-type svg' => array( - 'top' => '.2em', - 'margin-top' => '0px', - 'margin-left' => '0px', - 'width' => '.65em', - 'transform' => 'translate(0, -2px) rotateZ(270deg)', - ), - '.ast-mobile-popup-content .ast-submenu-expanded > .ast-menu-toggle' => array( - 'transform' => 'rotateX(180deg)', - ), - ); - } - } - - $parse_css .= astra_parse_css( $submenu_toggle ); - - $dynamic_css .= $parse_css; - - return $dynamic_css; - } - - /** - * Conditionally iclude CSS Selectors with anchors in the typography settings. - * - * Historically Astra adds Colors/Typography CSS for headings and anchors for headings but this causes irregularities with the expected output. - * For eg Link color does not work for the links inside headings. - * - * If filter `astra_include_achors_in_headings_typography` is set to true or Astra Option `include-headings-in-typography` is set to true, This will return selectors with anchors. Else This will return selectors without anchors. - * - * @access Private. - * - * @since 1.4.9 - * @param String $selectors_with_achors CSS Selectors with anchors. - * @param String $selectors_without_achors CSS Selectors withour annchors. - * - * @return String CSS Selectors based on the condition of filters. - */ - private static function conditional_headings_css_selectors( $selectors_with_achors, $selectors_without_achors ) { - - if ( true === self::anchors_in_css_selectors_heading() ) { - return $selectors_with_achors; - } else { - return $selectors_without_achors; - } - - } - - /** - * Check if CSS selectors in Headings should use anchors. - * - * @since 1.4.9 - * @return boolean true if it should include anchors, False if not. - */ - public static function anchors_in_css_selectors_heading() { - - if ( true === astra_get_option( 'include-headings-in-typography' ) && - true === apply_filters( - 'astra_include_achors_in_headings_typography', - true - ) ) { - - return true; - } - - return false; - } - - /** - * Check backwards compatibility CSS for loading submenu below the header needs to be added. - * - * @since 1.5.0 - * @return boolean true if CSS should be included, False if not. - */ - public static function astra_submenu_below_header_fix() { - - if ( false === astra_get_option( 'submenu-below-header', true ) && - false === apply_filters( - 'astra_submenu_below_header_fix', - false - ) ) { - - return false; - } - return true; - } - - /** - * Check backwards compatibility CSS for loading submenu below the header needs to be added. - * - * @since 2.1.3 - * @return boolean true if submenu below header fix is to be loaded, False if not. - */ - public static function astra_submenu_open_below_header_fix() { - - if ( false === astra_get_option( 'submenu-open-below-header', true ) && - false === apply_filters( - 'astra_submenu_open_below_header_fix', - false - ) ) { - - return false; - } - return true; - } - - /** - * Check backwards compatibility to not load default CSS for the button styling of Page Builders. - * - * @since 2.2.0 - * @return boolean true if button style CSS should be loaded, False if not. - */ - public static function page_builder_button_style_css() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['pb-button-color-compatibility'] = ( isset( $astra_settings['pb-button-color-compatibility'] ) && false === $astra_settings['pb-button-color-compatibility'] ) ? false : true; - return apply_filters( 'astra_page_builder_button_style_css', $astra_settings['pb-button-color-compatibility'] ); - } - - /** - * Elementor Theme Style - Button Text Color compatibility. This should be looked in the future for proper solution. - * - * Reference: https://github.com/elementor/elementor/issues/10733 - * Reference: https://github.com/elementor/elementor/issues/10739 - * - * @since 2.3.3 - * - * @return mixed - */ - public static function is_elementor_kit_button_color_set() { - $ele_btn_global_text_color = false; - $ele_kit_id = get_option( 'elementor_active_kit', false ); - if ( false !== $ele_kit_id ) { - $ele_global_btn_data = get_post_meta( $ele_kit_id, '_elementor_page_settings' ); - // Elementor Global theme style button text color fetch value from database. - $ele_btn_global_text_color = isset( $ele_global_btn_data[0]['button_text_color'] ) ? $ele_global_btn_data[0]['button_text_color'] : $ele_btn_global_text_color; - } - return $ele_btn_global_text_color; - } - - /** - * Check if Elementor - Disable Default Colors or Disable Default Fonts checked or unchecked. - * - * @since 2.3.3 - * - * @return mixed String if any of the settings are enabled. False if no settings are enabled. - */ - public static function elementor_default_color_font_setting() { - $ele_default_color_setting = get_option( 'elementor_disable_color_schemes' ); - $ele_default_typo_setting = get_option( 'elementor_disable_typography_schemes' ); - - if ( ( 'yes' === $ele_default_color_setting && 'yes' === $ele_default_typo_setting ) || ( false === self::is_elementor_default_color_font_comp() ) ) { - return 'color-typo'; - } - - if ( 'yes' === $ele_default_color_setting ) { - return 'color'; - } - - if ( 'yes' === $ele_default_typo_setting ) { - return 'typo'; - } - - return false; - - } - - /** - * For existing users, do not reflect direct change. - * - * @since 3.6.5 - * @return boolean true if WordPress-5.8 compatibility enabled, False if not. - */ - public static function is_block_editor_support_enabled() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['support-block-editor'] = ( isset( $astra_settings['support-block-editor'] ) && false === $astra_settings['support-block-editor'] ) ? false : true; - return apply_filters( 'astra_has_block_editor_support', $astra_settings['support-block-editor'] ); - } - - /** - * For existing users, do not provide Elementor Default Color Typo settings compatibility by default. - * - * @since 2.3.3 - * @return boolean true if elementor default color and typo setting should work with theme, False if not. - */ - public static function is_elementor_default_color_font_comp() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['ele-default-color-typo-setting-comp'] = ( isset( $astra_settings['ele-default-color-typo-setting-comp'] ) && false === $astra_settings['ele-default-color-typo-setting-comp'] ) ? false : true; - return apply_filters( 'astra_elementor_default_color_font_comp', $astra_settings['ele-default-color-typo-setting-comp'] ); - } - - /** - * For existing users, do not load the wide/full width image CSS by default. - * - * @since 2.4.4 - * @return boolean false if it is an existing user , true if not. - */ - public static function gtn_image_group_css_comp() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['gtn-full-wide-image-grp-css'] = isset( $astra_settings['gtn-full-wide-image-grp-css'] ) ? false : true; - return apply_filters( 'gtn_image_group_css_comp', $astra_settings['gtn-full-wide-image-grp-css'] ); - } - - /** - * Do not apply new wide/full Group and Cover block CSS for existing users. - * - * @since 2.5.0 - * @return boolean false if it is an existing user , true if not. - */ - public static function gtn_group_cover_css_comp() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['gtn-full-wide-grp-cover-css'] = isset( $astra_settings['gtn-full-wide-grp-cover-css'] ) ? false : true; - return apply_filters( 'astra_gtn_group_cover_css_comp', $astra_settings['gtn-full-wide-grp-cover-css'] ); - } - - /** - * Do not apply new Group, Column and Media & Text block CSS for existing users. - * - * @since 2.6.0 - * @return boolean false if it is an existing user , true if not. - */ - public static function gutenberg_core_blocks_css_comp() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['guntenberg-core-blocks-comp-css'] = isset( $astra_settings['guntenberg-core-blocks-comp-css'] ) ? false : true; - return apply_filters( 'astra_gutenberg_core_blocks_design_compatibility', $astra_settings['guntenberg-core-blocks-comp-css'] ); - } - - /** - * Do not apply new Group, Column and Media & Text block CSS for existing users. - * - * CSS for adding spacing|padding support to Gutenberg Media-&-Text Block - * - * @since 2.6.1 - * @return boolean false if it is an existing user , true if not. - */ - public static function gutenberg_media_text_block_css_compat() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['guntenberg-media-text-block-padding-css'] = isset( $astra_settings['guntenberg-media-text-block-padding-css'] ) ? false : true; - return apply_filters( 'astra_gutenberg_media_text_block_spacing_compatibility', $astra_settings['guntenberg-media-text-block-padding-css'] ); - } - - /** - * Gutenberg pattern compatibility changes. - * - * @since 3.3.0 - * @return boolean false if it is an existing user , true if not. - */ - public static function gutenberg_core_patterns_compat() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['guntenberg-button-pattern-compat-css'] = isset( $astra_settings['guntenberg-button-pattern-compat-css'] ) ? false : true; - return apply_filters( 'astra_gutenberg_patterns_compatibility', $astra_settings['guntenberg-button-pattern-compat-css'] ); - } - - /** - * Font CSS support for widget-title heading fonts & fonts which are not working in editor. - * - * 1. Adding Font-weight support to widget titles. - * 2. Customizer font CSS not supporting in editor. - * - * @since 3.6.0 - * @return boolean false if it is an existing user, true if not. - */ - public static function support_font_css_to_widget_and_in_editor() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['can-support-widget-and-editor-fonts'] = isset( $astra_settings['can-support-widget-and-editor-fonts'] ) ? false : true; - return apply_filters( 'astra_heading_fonts_typo_support', $astra_settings['can-support-widget-and-editor-fonts'] ); - } - - /** - * Whether to remove or not following CSS which restricts logo size on responsive devices. - * - * @see https://github.com/brainstormforce/astra/commit/d09f63336b73d58c8f8951726edbc90671d7f419 - * - * @since 3.6.0 - * @return boolean false if it is an existing user, true if not. - */ - public static function remove_logo_max_width_mobile_static_css() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['can-remove-logo-max-width-css'] = isset( $astra_settings['can-remove-logo-max-width-css'] ) ? false : true; - return apply_filters( 'astra_remove_logo_max_width_css', $astra_settings['can-remove-logo-max-width-css'] ); - } - - /** - * Load sidebar static CSS when it is enabled. - * - * @since 3.0.0 - */ - public static function load_sidebar_static_css() { - - $sidebar_static_css = ' - #secondary { - margin: 4em 0 2.5em; - word-break: break-word; - line-height: 2; - } - - #secondary li { - margin-bottom: 0.25em; - } - - #secondary li:last-child { - margin-bottom: 0; - } - @media (max-width: 768px) { - .js_active .ast-plain-container.ast-single-post #secondary { - margin-top: 1.5em; - } - } - .ast-separate-container.ast-two-container #secondary .widget { - background-color: #fff; - padding: 2em; - margin-bottom: 2em; - } - '; - if ( is_rtl() ) { - $sidebar_static_css .= ' - @media (min-width: 993px) { - .ast-left-sidebar #secondary { - padding-left: 60px; - } - - .ast-right-sidebar #secondary { - padding-right: 60px; - } - } - @media (max-width: 993px) { - .ast-right-sidebar #secondary { - padding-right: 30px; - } - .ast-left-sidebar #secondary { - padding-left: 30px; - } - - }'; - } else { - $sidebar_static_css .= ' - @media (min-width: 993px) { - .ast-left-sidebar #secondary { - padding-right: 60px; - } - - .ast-right-sidebar #secondary { - padding-left: 60px; - } - } - @media (max-width: 993px) { - .ast-right-sidebar #secondary { - padding-left: 30px; - } - .ast-left-sidebar #secondary { - padding-right: 30px; - } - - }'; - } - return $sidebar_static_css; - - } - - /** - * Load static card(EDD/Woo) CSS. - * - * @since 3.0.0 - * @return string static css for Woocommerce and EDD card. - */ - public static function load_cart_static_css() { - - $cart_static_css = ' - .ast-site-header-cart .cart-container, - .ast-edd-site-header-cart .ast-edd-cart-container { - transition: all 0.2s linear; - } - - .ast-site-header-cart .ast-woo-header-cart-info-wrap, - .ast-edd-site-header-cart .ast-edd-header-cart-info-wrap { - padding: 0 2px; - font-weight: 600; - line-height: 2.7; - display: inline-block; - } - - .ast-site-header-cart i.astra-icon { - font-size: 20px; - font-size: 1.3em; - font-style: normal; - font-weight: normal; - position: relative; - padding: 0 2px; - } - - .ast-site-header-cart i.astra-icon.no-cart-total:after, - .ast-header-break-point.ast-header-custom-item-outside .ast-edd-header-cart-info-wrap, - .ast-header-break-point.ast-header-custom-item-outside .ast-woo-header-cart-info-wrap { - display: none; - } - .ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap, - ast-edd-site-header-cart.ast-edd-menu-cart-outline .ast-edd-cart-menu-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .ast-edd-cart-menu-wrap { - line-height: 1.8; - } - - .ast-site-header-cart.ast-menu-cart-fill i.astra-icon, - .ast-edd-site-header-cart.ast-edd-menu-cart-fill span.astra-icon { - font-size: 1.1em; - } - - .astra-cart-drawer { - position: fixed; - display: block; - visibility: hidden; - overflow: hidden; - -webkit-overflow-scrolling: touch; - z-index: 9999; - background-color: #fff; - transition: all 0.5s ease; - transform: translate3d(0, 0, 0); - } - - .astra-cart-drawer.open-right { - width: 80%; - height: 100%; - left: 100%; - top: 0px; - transform: translate3d(0%, 0, 0); - } - - .astra-cart-drawer.active { - transform: translate3d(-100%, 0, 0); - visibility: visible; - } - - .astra-cart-drawer .astra-cart-drawer-header { - text-align: center; - text-transform: uppercase; - font-weight: 400; - border-bottom: 1px solid #f0f0f0; - padding: 0 0 0.675rem; - } - - .astra-cart-drawer .astra-cart-drawer-close .ast-close-svg { - width: 22px; - height: 22px; - } - - .astra-cart-drawer .astra-cart-drawer-title { - padding-top: 5px; - } - - .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart { - padding: 1em 1.5em; - } - - .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart a.remove { - width: 20px; - height: 20px; - line-height: 16px; - } - - .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__total { - padding: 1em 1.5em; - margin: 0; - text-align: center; - } - - .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__buttons { - padding: 10px; - text-align: center; - } - - .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__buttons .button.checkout { - margin-right: 0; - } - - .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item { - padding: .5em 2.6em .5em 1.5em; - } - - .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item .edd-remove-from-cart::after { - width: 20px; - height: 20px; - line-height: 16px; - } - - .astra-cart-drawer .astra-cart-drawer-content .edd-cart-number-of-items { - padding: 1em 1.5em 1em 1.5em; - margin-bottom: 0; - text-align: center; - } - - .astra-cart-drawer .astra-cart-drawer-content .edd_total { - padding: .5em 1.5em; - margin: 0; - text-align: center; - } - - .astra-cart-drawer .astra-cart-drawer-content .cart_item.edd_checkout { - padding: 1em 1.5em 0; - text-align: center; - margin-top: 0; - } - .astra-cart-drawer .woocommerce-mini-cart__empty-message, - .astra-cart-drawer .cart_item.empty { - text-align: center; - margin-top: 10px; - } - - body.admin-bar .astra-cart-drawer { - top: 46px; - } - - .ast-mobile-cart-active body.ast-hfb-header { - overflow: hidden; - } - - .ast-mobile-cart-active .astra-mobile-cart-overlay { - opacity: 1; - cursor: pointer; - visibility: visible; - z-index: 999; - } - - @media (max-width: 545px) { - .astra-cart-drawer.active { - width: 100%; - } - } - '; - if ( is_rtl() ) { - $cart_static_css .= ' - .ast-site-header-cart i.astra-icon:after { - content: attr(data-cart-total); - position: absolute; - font-style: normal; - top: -10px; - left: -12px; - font-weight: bold; - box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, 0.3); - font-size: 11px; - padding-right: 0px; - padding-left: 2px; - line-height: 17px; - letter-spacing: -.5px; - height: 18px; - min-width: 18px; - border-radius: 99px; - text-align: center; - z-index: 4; - } - li.woocommerce-custom-menu-item .ast-site-header-cart i.astra-icon:after, - li.edd-custom-menu-item .ast-edd-site-header-cart span.astra-icon:after { - padding-right: 2px; - } - .astra-cart-drawer .astra-cart-drawer-close { - position: absolute; - top: 0; - left: 0; - margin: 0; - padding: .6em 1em .4em; - color: #ababab; - background-color: transparent; - } - .astra-mobile-cart-overlay { - background-color: rgba(0, 0, 0, 0.4); - position: fixed; - top: 0; - left: 0; - bottom: 0; - right: 0; - visibility: hidden; - opacity: 0; - transition: opacity 0.2s ease-in-out; - } - .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item .edd-remove-from-cart { - left: 1.2em; - } - .ast-header-break-point.ast-woocommerce-cart-menu.ast-hfb-header .ast-cart-menu-wrap, .ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, - .ast-header-break-point .ast-edd-site-header-cart-wrap .ast-edd-cart-menu-wrap { - width: 2em; - height: 2em; - font-size: 1.4em; - line-height: 2; - vertical-align: middle; - text-align: left; - }'; - } else { - $cart_static_css .= ' - .ast-site-header-cart i.astra-icon:after { - content: attr(data-cart-total); - position: absolute; - font-style: normal; - top: -10px; - right: -12px; - font-weight: bold; - box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, 0.3); - font-size: 11px; - padding-left: 0px; - padding-right: 2px; - line-height: 17px; - letter-spacing: -.5px; - height: 18px; - min-width: 18px; - border-radius: 99px; - text-align: center; - z-index: 4; - } - li.woocommerce-custom-menu-item .ast-site-header-cart i.astra-icon:after, - li.edd-custom-menu-item .ast-edd-site-header-cart span.astra-icon:after { - padding-left: 2px; - } - .astra-cart-drawer .astra-cart-drawer-close { - position: absolute; - top: 0; - right: 0; - margin: 0; - padding: .6em 1em .4em; - color: #ababab; - background-color: transparent; - } - .astra-mobile-cart-overlay { - background-color: rgba(0, 0, 0, 0.4); - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - visibility: hidden; - opacity: 0; - transition: opacity 0.2s ease-in-out; - } - .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item .edd-remove-from-cart { - right: 1.2em; - } - .ast-header-break-point.ast-woocommerce-cart-menu.ast-hfb-header .ast-cart-menu-wrap, .ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, - .ast-header-break-point .ast-edd-site-header-cart-wrap .ast-edd-cart-menu-wrap { - width: 2em; - height: 2em; - font-size: 1.4em; - line-height: 2; - vertical-align: middle; - text-align: right; - }'; - } - // This CSS requires in case of :before Astra icons. But in case of SVGs this loads twice that's why removed this from static & loading conditionally. - if ( false === Astra_Icons::is_svg_icons() ) { - $cart_static_css .= ' - .ast-site-header-cart .cart-container *, - .ast-edd-site-header-cart .ast-edd-cart-container * { - transition: all 0s linear; - } - '; - } - return $cart_static_css; - } - } -} + array( + 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 6.25, '%' ), + ), + 'a, .page-title' => array( + 'color' => esc_attr( $link_color ), + ), + 'a:hover, a:focus' => array( + 'color' => esc_attr( $link_hover_color ), + ), + 'body, button, input, select, textarea, .ast-button, .ast-custom-button' => array( + 'font-family' => astra_get_font_family( $body_font_family ), + 'font-weight' => esc_attr( $body_font_weight ), + 'font-size' => astra_responsive_font( $body_font_size, 'desktop' ), + 'line-height' => esc_attr( $body_line_height ), + 'text-transform' => esc_attr( $body_text_transform ), + ), + 'blockquote' => array( + 'border-color' => astra_hex_to_rgba( $link_color, 0.15 ), + ), + 'p, .entry-content p' => array( + 'margin-bottom' => astra_get_css_value( $para_margin_bottom, 'em' ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a', + 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a' + ) => array( + 'font-family' => astra_get_css_value( $headings_font_family, 'font' ), + 'font-weight' => astra_get_css_value( $headings_font_weight, 'font' ), + 'text-transform' => esc_attr( $headings_text_transform ), + ), + + '.ast-site-identity .site-title a' => array( + 'color' => esc_attr( $title_color ), + ), + '.ast-site-identity .site-title a:hover' => array( + 'color' => esc_attr( $title_hover_color ), + ), + '.ast-site-identity .site-description' => array( + 'color' => esc_attr( $tagline_color ), + ), + '.site-title' => array( + 'font-size' => astra_responsive_font( $site_title_font_size, 'desktop' ), + 'display' => esc_attr( $desktop_title_visibility ), + ), + 'header .custom-logo-link img' => array( + 'max-width' => astra_get_css_value( $header_logo_width['desktop'], 'px' ), + ), + '.astra-logo-svg' => array( + 'width' => astra_get_css_value( $header_logo_width['desktop'], 'px' ), + ), + '.astra-logo-svg:not(.sticky-custom-logo .astra-logo-svg, .transparent-custom-logo .astra-logo-svg, .advanced-header-logo .astra-logo-svg)' => array( + 'height' => astra_get_css_value( ( ! empty( $header_logo_width['desktop-svg-height'] ) && ! is_customize_preview() ) ? $header_logo_width['desktop-svg-height'] : '', 'px' ), + ), + '.ast-archive-description .ast-archive-title' => array( + 'font-size' => astra_responsive_font( $archive_summary_title_font_size, 'desktop' ), + ), + '.site-header .site-description' => array( + 'font-size' => astra_responsive_font( $site_tagline_font_size, 'desktop' ), + 'display' => esc_attr( $desktop_tagline_visibility ), + ), + '.entry-title' => array( + 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'desktop' ), + ), + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h1, .entry-content h1, .entry-content h1 a', + 'h1, .entry-content h1' + ) => array( + 'font-size' => astra_responsive_font( $heading_h1_font_size, 'desktop' ), + 'font-weight' => astra_get_css_value( $h1_font_weight, 'font' ), + 'font-family' => astra_get_css_value( $h1_font_family, 'font' ), + 'line-height' => esc_attr( $h1_line_height ), + 'text-transform' => esc_attr( $h1_text_transform ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h2, .entry-content h2, .entry-content h2 a', + 'h2, .entry-content h2' + ) => array( + 'font-size' => astra_responsive_font( $heading_h2_font_size, 'desktop' ), + 'font-weight' => astra_get_css_value( $h2_font_weight, 'font' ), + 'font-family' => astra_get_css_value( $h2_font_family, 'font' ), + 'line-height' => esc_attr( $h2_line_height ), + 'text-transform' => esc_attr( $h2_text_transform ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h3, .entry-content h3, .entry-content h3 a', + 'h3, .entry-content h3' + ) => array( + 'font-size' => astra_responsive_font( $heading_h3_font_size, 'desktop' ), + 'font-weight' => astra_get_css_value( $h3_font_weight, 'font' ), + 'font-family' => astra_get_css_value( $h3_font_family, 'font' ), + 'line-height' => esc_attr( $h3_line_height ), + 'text-transform' => esc_attr( $h3_text_transform ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h4, .entry-content h4, .entry-content h4 a', + 'h4, .entry-content h4' + ) => array( + 'font-size' => astra_responsive_font( $heading_h4_font_size, 'desktop' ), + 'line-height' => esc_attr( $h4_line_height ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h5, .entry-content h5, .entry-content h5 a', + 'h5, .entry-content h5' + ) => array( + 'font-size' => astra_responsive_font( $heading_h5_font_size, 'desktop' ), + 'line-height' => esc_attr( $h5_line_height ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h6, .entry-content h6, .entry-content h6 a', + 'h6, .entry-content h6' + ) => array( + 'font-size' => astra_responsive_font( $heading_h6_font_size, 'desktop' ), + 'line-height' => esc_attr( $h6_line_height ), + ), + + '.ast-single-post .entry-title, .page-title' => array( + 'font-size' => astra_responsive_font( $single_post_title_font_size, 'desktop' ), + ), + // Global CSS. + '::selection' => array( + 'background-color' => esc_attr( $theme_color ), + 'color' => esc_attr( $selection_text_color ), + ), + + // Conditionally select selectors with annchors or withour anchors for text color. + self::conditional_headings_css_selectors( + 'body, h1, .entry-title a, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a', + 'body, h1, .entry-title a, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6' + ) => array( + 'color' => esc_attr( $text_color ), + ), + + // Typography. + '.tagcloud a:hover, .tagcloud a:focus, .tagcloud a.current-item' => array( + 'color' => astra_get_foreground_color( $link_color ), + 'border-color' => esc_attr( $link_color ), + 'background-color' => esc_attr( $link_color ), + ), + + // Input tags. + 'input:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="password"]:focus, input[type="reset"]:focus, input[type="search"]:focus, textarea:focus' => array( + 'border-color' => esc_attr( $link_color ), + ), + 'input[type="radio"]:checked, input[type=reset], input[type="checkbox"]:checked, input[type="checkbox"]:hover:checked, input[type="checkbox"]:focus:checked, input[type=range]::-webkit-slider-thumb' => array( + 'border-color' => esc_attr( $link_color ), + 'background-color' => esc_attr( $link_color ), + 'box-shadow' => 'none', + ), + + // Small Footer. + '.site-footer a:hover + .post-count, .site-footer a:focus + .post-count' => array( + 'background' => esc_attr( $link_color ), + 'border-color' => esc_attr( $link_color ), + ), + + '.single .nav-links .nav-previous, .single .nav-links .nav-next' => array( + 'color' => esc_attr( $link_color ), + ), + + // Blog Post Meta Typography. + '.entry-meta, .entry-meta *' => array( + 'line-height' => '1.45', + 'color' => esc_attr( $link_color ), + ), + '.entry-meta a:hover, .entry-meta a:hover *, .entry-meta a:focus, .entry-meta a:focus *, .page-links > .page-link, .page-links .page-link:hover, .post-navigation a:hover' => array( + 'color' => esc_attr( $link_hover_color ), + ), + + // Blockquote Text Color. + 'blockquote' => array( + 'color' => astra_adjust_brightness( $text_color, 75, 'darken' ), + ), + + // Widget Title. + '.widget-title' => array( + 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 1.428571429 ), + 'color' => esc_attr( $text_color ), + ), + '#cat option, .secondary .calendar_wrap thead a, .secondary .calendar_wrap thead a:visited' => array( + 'color' => esc_attr( $link_color ), + ), + '.secondary .calendar_wrap #today, .ast-progress-val span' => array( + 'background' => esc_attr( $link_color ), + ), + '.secondary a:hover + .post-count, .secondary a:focus + .post-count' => array( + 'background' => esc_attr( $link_color ), + 'border-color' => esc_attr( $link_color ), + ), + '.calendar_wrap #today > a' => array( + 'color' => astra_get_foreground_color( $link_color ), + ), + + // Pagination. + '.page-links .page-link, .single .post-navigation a' => array( + 'color' => esc_attr( $link_color ), + ), + + // Menu Toggle Border Radius. + '.ast-header-break-point .main-header-bar .ast-button-wrap .menu-toggle' => array( + 'border-radius' => ( '' !== $mobile_header_toggle_btn_border_radius ) ? esc_attr( $mobile_header_toggle_btn_border_radius ) . 'px' : '', + ), + + ); + + // Remove this condition after 2-3 updates of add-on. + if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '3.0.1', '>=' ) ) { + $css_output['.single .ast-author-details .author-title'] = array( + 'color' => esc_attr( $link_hover_color ), + ); + } + + if ( 'no-sidebar' !== astra_page_layout() ) { + $css_output['#secondary, #secondary button, #secondary input, #secondary select, #secondary textarea'] = array( + 'font-size' => astra_responsive_font( $body_font_size, 'desktop' ), + ); + } + + // Add underline to every link in content area. + $content_links_underline = astra_get_option( 'underline-content-links' ); + + if ( $content_links_underline ) { + $css_output['.ast-single-post .entry-content a, .ast-comment-content a:not(.ast-comment-edit-reply-wrap a)'] = array( + 'text-decoration' => 'underline', + ); + $css_output['.ast-single-post .wp-block-button .wp-block-button__link, .ast-single-post .elementor-button-wrapper .elementor-button'] = array( + 'text-decoration' => 'none', + ); + } + + /** + * Loaded the following CSS conditionally because of following scenarios - + * + * 1. $text_color is applying to menu-link anchors as well though $link_color should apply over there. + * 2. $link_color applying in old header as hover color for menu-anchors. + * + * @since 3.0.0 + */ + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { + // Header - Main Header CSS. + $css_output['.main-header-menu .menu-link, .ast-header-custom-item a'] = array( + 'color' => esc_attr( $text_color ), + ); + // Main - Menu Items. + $css_output['.main-header-menu .menu-item:hover > .menu-link, .main-header-menu .menu-item:hover > .ast-menu-toggle, .main-header-menu .ast-masthead-custom-menu-items a:hover, .main-header-menu .menu-item.focus > .menu-link, .main-header-menu .menu-item.focus > .ast-menu-toggle, .main-header-menu .current-menu-item > .menu-link, .main-header-menu .current-menu-ancestor > .menu-link, .main-header-menu .current-menu-item > .ast-menu-toggle, .main-header-menu .current-menu-ancestor > .ast-menu-toggle'] = array( + 'color' => esc_attr( $link_color ), + ); + $css_output['.header-main-layout-3 .ast-main-header-bar-alignment'] = array( + 'margin-right' => 'auto', + ); + if ( $is_site_rtl ) { + $css_output['.header-main-layout-2 .site-header-section-left .ast-site-identity'] = array( + 'text-align' => 'right', + ); + } else { + $css_output['.header-main-layout-2 .site-header-section-left .ast-site-identity'] = array( + 'text-align' => 'left', + ); + } + } + + $page_header_logo = ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'advanced-headers' ) && Astra_Ext_Advanced_Headers_Loader::astra_advanced_headers_design_option( 'logo-url' ) ) ? true : false; + + if ( astra_get_option( 'logo-title-inline' ) ) { + $css_output['.ast-logo-title-inline .site-logo-img'] = array( + 'padding-right' => '1em', + ); + } + + if ( get_theme_mod( 'custom_logo' ) + || astra_get_option( 'transparent-header-logo' ) + || astra_get_option( 'sticky-header-logo' ) + || $page_header_logo + || is_customize_preview() ) { + + $css_output['.site-logo-img img'] = array( + ' transition' => 'all 0.2s linear', + ); + } + + /* Parse CSS from array() */ + $parse_css = astra_parse_css( $css_output ); + + if ( ! Astra_Builder_Helper::$is_header_footer_builder_active ) { + + $old_header_mobile_toggle = array( + // toggle style + // Menu Toggle Minimal. + '.ast-header-break-point .ast-mobile-menu-buttons-minimal.menu-toggle' => array( + 'background' => 'transparent', + 'color' => esc_attr( $mobile_header_toggle_btn_style_color ), + ), + + // Menu Toggle Outline. + '.ast-header-break-point .ast-mobile-menu-buttons-outline.menu-toggle' => array( + 'background' => 'transparent', + 'border' => '1px solid ' . $mobile_header_toggle_btn_style_color, + 'color' => esc_attr( $mobile_header_toggle_btn_style_color ), + ), + + // Menu Toggle Fill. + '.ast-header-break-point .ast-mobile-menu-buttons-fill.menu-toggle' => array( + 'background' => esc_attr( $mobile_header_toggle_btn_style_color ), + 'color' => $menu_btn_color, + ), + ); + + $parse_css .= astra_parse_css( $old_header_mobile_toggle ); + } + + $parse_css .= astra_container_layout_css(); + + if ( 'no-sidebar' !== astra_page_layout() ) { + $parse_css .= Astra_Enqueue_Scripts::trim_css( self::load_sidebar_static_css() ); + } + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + $parse_css .= astra_parse_css( + array( + '#ast-desktop-header' => array( + 'display' => 'none', + ), + ), + '', + astra_get_tablet_breakpoint() + ); + + $parse_css .= astra_parse_css( + array( + '#ast-mobile-header' => array( + 'display' => 'none', + ), + ), + astra_get_tablet_breakpoint() + ); + } + + // Comments CSS. + if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { + require_once ASTRA_THEME_DIR . 'inc/dynamic-css/comments.php'; // PHPCS:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + } else { + require_once ASTRA_THEME_DIR . 'inc/dynamic-css/comments-flex.php'; // PHPCS:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + } + + if ( Astra_Builder_Helper::is_component_loaded( 'woo-cart', 'header' ) || Astra_Builder_Helper::is_component_loaded( 'edd-cart', 'header' ) ) { + $parse_css .= Astra_Enqueue_Scripts::trim_css( self::load_cart_static_css() ); + } + + if ( ! Astra_Builder_Helper::$is_header_footer_builder_active ) { + $footer_css_output = array( + '.ast-small-footer' => array( + 'color' => esc_attr( $footer_color ), + ), + '.ast-small-footer > .ast-footer-overlay' => astra_get_background_obj( $footer_bg_obj ), + + '.ast-small-footer a' => array( + 'color' => esc_attr( $footer_link_color ), + ), + '.ast-small-footer a:hover' => array( + 'color' => esc_attr( $footer_link_h_color ), + ), + + // Advanced Footer colors/fonts. + '.footer-adv .footer-adv-overlay' => array( + 'border-top-style' => 'solid', + 'border-top-width' => astra_get_css_value( $footer_adv_border_width, 'px' ), + 'border-top-color' => esc_attr( $footer_adv_border_color ), + ), + '.footer-adv .widget-title,.footer-adv .widget-title a' => array( + 'color' => esc_attr( $footer_adv_widget_title_color ), + ), + + '.footer-adv' => array( + 'color' => esc_attr( $footer_adv_text_color ), + ), + + '.footer-adv a' => array( + 'color' => esc_attr( $footer_adv_link_color ), + ), + + '.footer-adv .tagcloud a:hover, .footer-adv .tagcloud a.current-item' => array( + 'border-color' => esc_attr( $footer_adv_link_color ), + 'background-color' => esc_attr( $footer_adv_link_color ), + ), + + '.footer-adv a:hover, .footer-adv .no-widget-text a:hover, .footer-adv a:focus, .footer-adv .no-widget-text a:focus' => array( + 'color' => esc_attr( $footer_adv_link_h_color ), + ), + + '.footer-adv .calendar_wrap #today, .footer-adv a:hover + .post-count' => array( + 'background-color' => esc_attr( $footer_adv_link_color ), + ), + + '.footer-adv-overlay' => astra_get_background_obj( $footer_adv_bg_obj ), + + ); + + $parse_css .= astra_parse_css( $footer_css_output ); + } + + // Paginaiton CSS. + require_once ASTRA_THEME_DIR . 'inc/dynamic-css/pagination.php'; // PHPCS:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + // Related Posts Dynamic CSS. + + /** + * + * Fix button aligment issue comming from the gutenberg plugin (v9.3.0). + */ + $gtn_plugin_button_center_alignment = array( + '.wp-block-buttons.aligncenter' => array( + 'justify-content' => 'center', + ), + ); + $parse_css .= astra_parse_css( $gtn_plugin_button_center_alignment ); + + $ast_container_layout = astra_get_content_layout(); + + /* + * Fix the wide width issue in gutenberg + * check if the current user is existing user or new user. + * if new user load the CSS bty default if existing provide a filter + */ + if ( self::gtn_image_group_css_comp() ) { + + if ( 'content-boxed-container' == $ast_container_layout || 'boxed-container' == $ast_container_layout ) { + $parse_css .= astra_parse_css( + array( + '.ast-separate-container.ast-right-sidebar .entry-content .wp-block-image.alignfull,.ast-separate-container.ast-left-sidebar .entry-content .wp-block-image.alignfull,.ast-separate-container.ast-right-sidebar .entry-content .wp-block-cover.alignfull,.ast-separate-container.ast-left-sidebar .entry-content .wp-block-cover.alignfull' => array( + 'margin-left' => '-6.67em', + 'margin-right' => '-6.67em', + 'max-width' => 'unset', + 'width' => 'unset', + ), + '.ast-separate-container.ast-right-sidebar .entry-content .wp-block-image.alignwide,.ast-separate-container.ast-left-sidebar .entry-content .wp-block-image.alignwide,.ast-separate-container.ast-right-sidebar .entry-content .wp-block-cover.alignwide,.ast-separate-container.ast-left-sidebar .entry-content .wp-block-cover.alignwide' => array( + 'margin-left' => '-20px', + 'margin-right' => '-20px', + 'max-width' => 'unset', + 'width' => 'unset', + ), + ), + '1200' + ); + } + + $gtn_full_wide_image_css = array( + '.wp-block-group .has-background' => array( + 'padding' => '20px', + ), + ); + $parse_css .= astra_parse_css( $gtn_full_wide_image_css, '1200' ); + + } else { + + $gtn_tablet_column_css = array( + '.entry-content .wp-block-columns .wp-block-column' => array( + 'margin-left' => '0px', + ), + ); + + $parse_css .= astra_parse_css( $gtn_tablet_column_css, '', '782' ); + } + + if ( self::gtn_group_cover_css_comp() ) { + + if ( 'no-sidebar' !== astra_page_layout() ) { + + switch ( $ast_container_layout ) { + case 'content-boxed-container': + case 'boxed-container': + $parse_css .= astra_parse_css( + array( + // With container - Sidebar. + '.ast-separate-container.ast-right-sidebar .entry-content .wp-block-group.alignwide, .ast-separate-container.ast-left-sidebar .entry-content .wp-block-group.alignwide, .ast-separate-container.ast-right-sidebar .entry-content .wp-block-cover.alignwide, .ast-separate-container.ast-left-sidebar .entry-content .wp-block-cover.alignwide' => array( + 'margin-left' => '-20px', + 'margin-right' => '-20px', + 'padding-left' => '20px', + 'padding-right' => '20px', + ), + '.ast-separate-container.ast-right-sidebar .entry-content .wp-block-group.alignfull, .ast-separate-container.ast-left-sidebar .entry-content .wp-block-group.alignfull, .ast-separate-container.ast-right-sidebar .entry-content .wp-block-cover.alignfull, .ast-separate-container.ast-left-sidebar .entry-content .wp-block-cover.alignfull' => array( + 'margin-left' => '-6.67em', + 'margin-right' => '-6.67em', + 'padding-left' => '6.67em', + 'padding-right' => '6.67em', + ), + ), + '1200' + ); + break; + + case 'plain-container': + $parse_css .= astra_parse_css( + array( + // Without container - Sidebar. + '.ast-plain-container.ast-right-sidebar .entry-content .wp-block-group.alignwide, .ast-plain-container.ast-left-sidebar .entry-content .wp-block-group.alignwide, .ast-plain-container.ast-right-sidebar .entry-content .wp-block-group.alignfull, .ast-plain-container.ast-left-sidebar .entry-content .wp-block-group.alignfull' => array( + 'padding-left' => '20px', + 'padding-right' => '20px', + ), + ), + '1200' + ); + break; + + case 'page-builder': + $parse_css .= astra_parse_css( + array( + '.ast-page-builder-template.ast-left-sidebar .entry-content .wp-block-cover.alignwide, .ast-page-builder-template.ast-right-sidebar .entry-content .wp-block-cover.alignwide, .ast-page-builder-template.ast-left-sidebar .entry-content .wp-block-cover.alignfull, .ast-page-builder-template.ast-right-sidebar .entry-content .wp-block-cover.alignful' => array( + 'padding-right' => '0', + 'padding-left' => '0', + ), + ), + '1200' + ); + break; + } + } else { + + switch ( $container_layout ) { + case 'content-boxed-container': + case 'boxed-container': + $parse_css .= astra_parse_css( + array( + // With container - No Sidebar. + '.ast-no-sidebar.ast-separate-container .entry-content .wp-block-group.alignwide, .ast-no-sidebar.ast-separate-container .entry-content .wp-block-cover.alignwide' => array( + 'margin-left' => '-20px', + 'margin-right' => '-20px', + 'padding-left' => '20px', + 'padding-right' => '20px', + ), + '.ast-no-sidebar.ast-separate-container .entry-content .wp-block-cover.alignfull, .ast-no-sidebar.ast-separate-container .entry-content .wp-block-group.alignfull' => array( + 'margin-left' => '-6.67em', + 'margin-right' => '-6.67em', + 'padding-left' => '6.67em', + 'padding-right' => '6.67em', + ), + ), + '1200' + ); + break; + + case 'plain-container': + $parse_css .= astra_parse_css( + array( + // Without container - No Sidebar. + '.ast-plain-container.ast-no-sidebar .entry-content .alignwide .wp-block-cover__inner-container, .ast-plain-container.ast-no-sidebar .entry-content .alignfull .wp-block-cover__inner-container' => array( + 'width' => astra_get_css_value( $site_content_width + 40, 'px' ), + ), + ), + '1200' + ); + break; + + case 'page-builder': + $parse_css .= astra_parse_css( + array( + '.ast-page-builder-template.ast-no-sidebar .entry-content .wp-block-cover.alignwide, .ast-page-builder-template.ast-no-sidebar .entry-content .wp-block-cover.alignfull' => array( + 'padding-right' => '0', + 'padding-left' => '0', + ), + ), + '1200' + ); + break; + } + } + + $parse_css .= astra_parse_css( + array( + '.wp-block-cover-image.alignwide .wp-block-cover__inner-container, .wp-block-cover.alignwide .wp-block-cover__inner-container, .wp-block-cover-image.alignfull .wp-block-cover__inner-container, .wp-block-cover.alignfull .wp-block-cover__inner-container' => array( + 'width' => '100%', + ), + ), + '1200' + ); + + // Remove margin top when Primary Header is not set and No Sidebar is added in Full-Width / Contained Layout. + if ( is_singular() ) { + $display_header = get_post_meta( get_the_ID(), 'ast-main-header-display', true ); + if ( 'disabled' === $display_header && apply_filters( 'astra_content_margin_full_width_contained', true ) || ( Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) || ( self::gutenberg_core_blocks_css_comp() ) ) { + $gtn_margin_top = array( + '.ast-plain-container.ast-no-sidebar #primary' => array( + 'margin-top' => '0', + 'margin-bottom' => '0', + ), + ); + $parse_css .= astra_parse_css( $gtn_margin_top ); + } + } + } + + if ( self::gutenberg_core_blocks_css_comp() ) { + + /** + * If transparent header is activated then it adds top 1.5em padding space, so this CSS will fix this issue. + * This issue is only visible on responsive devices. + * + * @since 2.6.0 + */ + if ( is_singular() ) { + + $trans_header_responsive_top_space_css_fix = array( + '.ast-theme-transparent-header #primary, .ast-theme-transparent-header #secondary' => array( + 'padding' => 0, + ), + ); + + /* Parse CSS from array() -> max-width: (tablet-breakpoint)px CSS */ + $parse_css .= astra_parse_css( $trans_header_responsive_top_space_css_fix, '', astra_get_tablet_breakpoint() ); + } + + $desktop_screen_gb_css = array( + // Group block, Columns block, Gallery block, Table block & has-text-align-center selector compatibility Desktop CSS. + '.wp-block-columns' => array( + 'margin-bottom' => 'unset', + ), + '.wp-block-image.size-full' => array( + 'margin' => '2rem 0', + ), + '.wp-block-separator.has-background' => array( + 'padding' => '0', + ), + '.wp-block-gallery' => array( + 'margin-bottom' => '1.6em', + ), + '.wp-block-group' => array( + 'padding-top' => '4em', + 'padding-bottom' => '4em', + ), + '.wp-block-group__inner-container .wp-block-columns:last-child, .wp-block-group__inner-container :last-child, .wp-block-table table' => array( + 'margin-bottom' => '0', + ), + '.blocks-gallery-grid' => array( + 'width' => '100%', + ), + '.wp-block-navigation-link__content' => array( + 'padding' => '5px 0', + ), + '.wp-block-group .wp-block-group .has-text-align-center, .wp-block-group .wp-block-column .has-text-align-center' => array( + 'max-width' => '100%', + ), + '.has-text-align-center' => array( + 'margin' => '0 auto', + ), + ); + + /* Parse CSS from array() -> Desktop CSS */ + $parse_css .= astra_parse_css( $desktop_screen_gb_css ); + + $middle_screen_min_gb_css = array( + // Group & Column block > align compatibility (min-width:1200px) CSS. + '.wp-block-cover__inner-container, .alignwide .wp-block-group__inner-container, .alignfull .wp-block-group__inner-container' => array( + 'max-width' => '1200px', + 'margin' => '0 auto', + ), + '.wp-block-group.alignnone, .wp-block-group.aligncenter, .wp-block-group.alignleft, .wp-block-group.alignright, .wp-block-group.alignwide, .wp-block-columns.alignwide' => array( + 'margin' => '2rem 0 1rem 0', + ), + ); + + /* Parse CSS from array() -> min-width: (1200)px CSS */ + $parse_css .= astra_parse_css( $middle_screen_min_gb_css, '1200' ); + + $middle_screen_max_gb_css = array( + // Group & Column block (max-width:1200px) CSS. + '.wp-block-group' => array( + 'padding' => '3em', + ), + '.wp-block-group .wp-block-group' => array( + 'padding' => '1.5em', + ), + '.wp-block-columns, .wp-block-column' => array( + 'margin' => '1rem 0', + ), + ); + + /* Parse CSS from array() -> max-width: (1200)px CSS */ + $parse_css .= astra_parse_css( $middle_screen_max_gb_css, '', '1200' ); + + $tablet_screen_min_gb_css = array( + // Columns inside Group block compatibility (min-width: tablet-breakpoint) CSS. + '.wp-block-columns .wp-block-group' => array( + 'padding' => '2em', + ), + ); + + /* Parse CSS from array() -> min-width: (tablet-breakpoint)px CSS */ + $parse_css .= astra_parse_css( $tablet_screen_min_gb_css, astra_get_tablet_breakpoint() ); + + $mobile_screen_max_gb_css = array( + // Content | image | video inside Media & Text block, Cover block, Image inside cover block compatibility (max-width: mobile-breakpoint) CSS. + '.wp-block-cover-image .wp-block-cover__inner-container, .wp-block-cover .wp-block-cover__inner-container' => array( + 'width' => 'unset', + ), + '.wp-block-cover, .wp-block-cover-image' => array( + 'padding' => '2em 0', + ), + '.wp-block-group, .wp-block-cover' => array( + 'padding' => '2em', + ), + '.wp-block-media-text__media img, .wp-block-media-text__media video' => array( + 'width' => 'unset', + 'max-width' => '100%', + ), + '.wp-block-media-text.has-background .wp-block-media-text__content' => array( + 'padding' => '1em', + ), + ); + + if ( ! self::gutenberg_media_text_block_css_compat() ) { + // Added this [! self::gutenberg_media_text_block_css_compat()] condition as we update the same selector CSS in gutenberg_media_text_block_css_compat() function with new padding: 8% 0; CSS for max-width: (mobile-breakpoint). + $mobile_screen_max_gb_css['.wp-block-media-text .wp-block-media-text__content'] = array( + 'padding' => '3em 2em', + ); + } + + /* Parse CSS from array() -> max-width: (mobile-breakpoint)px CSS */ + $parse_css .= astra_parse_css( $mobile_screen_max_gb_css, '', astra_get_mobile_breakpoint() ); + } + + if ( self::gutenberg_media_text_block_css_compat() ) { + + /** + * Remove #primary padding on mobile devices which compromises deigned layout. + * + * @since 2.6.1 + */ + if ( is_singular() ) { + + $remove_primary_padding_on_mobile_css = array( + '.ast-plain-container.ast-no-sidebar #primary' => array( + 'padding' => 0, + ), + ); + + /* Parse CSS from array() -> max-width: (tablet-breakpoint)px CSS */ + $parse_css .= astra_parse_css( $remove_primary_padding_on_mobile_css, '', astra_get_tablet_breakpoint() ); + } + + $media_text_block_padding_css = array( + // Media & Text block CSS compatibility (min-width: mobile-breakpoint) CSS. + '.entry-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content' => array( + 'padding' => '0 8% 0 0', + ), + '.entry-content .wp-block-media-text .wp-block-media-text__content' => array( + 'padding' => '0 0 0 8%', + ), + '.ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-bottom-left > *, .ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-bottom-right > *, .ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-top-left > *, .ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-top-right > *, .ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-center-right > *, .ast-plain-container .site-content .entry-content .has-custom-content-position.is-position-center-left > *' => array( + 'margin' => 0, + ), + ); + + /* Parse CSS from array() -> min-width: (mobile-breakpoint)px CSS */ + $parse_css .= astra_parse_css( $media_text_block_padding_css, astra_get_mobile_breakpoint() ); + + $mobile_screen_media_text_block_css = array( + // Media & Text block padding CSS for (max-width: mobile-breakpoint) CSS. + '.entry-content .wp-block-media-text .wp-block-media-text__content' => array( + 'padding' => '8% 0', + ), + '.wp-block-media-text .wp-block-media-text__media img' => array( + 'width' => 'auto', + 'max-width' => '100%', + ), + ); + + /* Parse CSS from array() -> max-width: (mobile-breakpoint)px CSS */ + $parse_css .= astra_parse_css( $mobile_screen_media_text_block_css, '', astra_get_mobile_breakpoint() ); + } + + /** + * When supporting GB button outline patterns in v3.3.0 we have given 2px as default border for GB outline button, where we restrict button border for flat type buttons. + * But now while reverting this change there is no need of default border because whatever customizer border will set it should behave accordingly. Although it is empty ('') WP applying 2px as default border for outline buttons. + * + * @since 3.6.3 + */ + $default_border_size = '2px'; + if ( astra_button_default_padding_updated() ) { + $default_border_size = ''; + } + + // Outline Gutenberg button compatibility CSS. + $theme_btn_top_border = ( isset( $global_custom_button_border_size['top'] ) && ( '' !== $global_custom_button_border_size['top'] && '0' !== $global_custom_button_border_size['top'] ) ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : $default_border_size; + $theme_btn_right_border = ( isset( $global_custom_button_border_size['right'] ) && ( '' !== $global_custom_button_border_size['right'] && '0' !== $global_custom_button_border_size['right'] ) ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : $default_border_size; + $theme_btn_left_border = ( isset( $global_custom_button_border_size['left'] ) && ( '' !== $global_custom_button_border_size['left'] && '0' !== $global_custom_button_border_size['left'] ) ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : $default_border_size; + $theme_btn_bottom_border = ( isset( $global_custom_button_border_size['bottom'] ) && ( '' !== $global_custom_button_border_size['bottom'] && '0' !== $global_custom_button_border_size['bottom'] ) ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : $default_border_size; + + if ( self::gutenberg_core_patterns_compat() ) { + + $outline_button_css = array( + '.wp-block-button.is-style-outline .wp-block-button__link' => array( + 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), + 'border-top-width' => esc_attr( $theme_btn_top_border ), + 'border-right-width' => esc_attr( $theme_btn_right_border ), + 'border-bottom-width' => esc_attr( $theme_btn_bottom_border ), + 'border-left-width' => esc_attr( $theme_btn_left_border ), + ), + '.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color), .wp-block-button.wp-block-button__link.is-style-outline:not(.has-text-color)' => array( + 'color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), + ), + '.wp-block-button.is-style-outline .wp-block-button__link:hover, .wp-block-button.is-style-outline .wp-block-button__link:focus' => array( + 'color' => esc_attr( $btn_text_hover_color ) . ' !important', + 'background-color' => esc_attr( $btn_bg_hover_color ), + 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ), + ), + // Adding CSS to highlight current paginated number. + '.post-page-numbers.current .page-link, .ast-pagination .page-numbers.current' => array( + 'color' => astra_get_foreground_color( $theme_color ), + 'border-color' => esc_attr( $theme_color ), + 'background-color' => esc_attr( $theme_color ), + 'border-radius' => '2px', + ), + ); + + /* Parse CSS from array() -> All media CSS */ + $parse_css .= astra_parse_css( $outline_button_css ); + + if ( ! astra_button_default_padding_updated() ) { + // Tablet CSS. + $outline_button_tablet_css = array( + '.wp-block-button.is-style-outline .wp-block-button__link' => array( + 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', + 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', + 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', + 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', + ), + ); + + $parse_css .= astra_parse_css( $outline_button_tablet_css, '', astra_get_tablet_breakpoint() ); + + // Mobile CSS. + $outline_button_mobile_css = array( + '.wp-block-button.is-style-outline .wp-block-button__link' => array( + 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', + 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', + 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', + 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', + ), + ); + + $parse_css .= astra_parse_css( $outline_button_mobile_css, '', astra_get_mobile_breakpoint() ); + } + + if ( $is_site_rtl ) { + $gb_patterns_min_mobile_css = array( + '.entry-content > .alignleft' => array( + 'margin-left' => '20px', + ), + '.entry-content > .alignright' => array( + 'margin-right' => '20px', + ), + ); + } else { + $gb_patterns_min_mobile_css = array( + '.entry-content > .alignleft' => array( + 'margin-right' => '20px', + ), + '.entry-content > .alignright' => array( + 'margin-left' => '20px', + ), + ); + } + + if ( ! astra_button_default_padding_updated() ) { + $gb_patterns_min_mobile_css['.wp-block-group.has-background'] = array( + 'padding' => '20px', + ); + } + + /* Parse CSS from array() -> min-width: (mobile-breakpoint) px CSS */ + $parse_css .= astra_parse_css( $gb_patterns_min_mobile_css, astra_get_mobile_breakpoint() ); + } + + if ( astra_button_default_padding_updated() ) { + $outline_button_css = array( + '.wp-block-button.is-style-outline .wp-block-button__link' => array( + 'border-top-width' => esc_attr( $theme_btn_top_border ), + 'border-right-width' => esc_attr( $theme_btn_right_border ), + 'border-bottom-width' => esc_attr( $theme_btn_bottom_border ), + 'border-left-width' => esc_attr( $theme_btn_left_border ), + ), + ); + + /* Parse CSS from array() -> All media CSS */ + $parse_css .= astra_parse_css( $outline_button_css ); + } + + if ( $is_widget_title_support_font_weight ) { + $widget_title_font_weight_support = array( + 'h1.widget-title' => array( + 'font-weight' => esc_attr( $h1_font_weight ), + ), + 'h2.widget-title' => array( + 'font-weight' => esc_attr( $h2_font_weight ), + ), + 'h3.widget-title' => array( + 'font-weight' => esc_attr( $h3_font_weight ), + ), + ); + + /* Parse CSS from array() -> All media CSS */ + $parse_css .= astra_parse_css( $widget_title_font_weight_support ); + } + + $static_layout_css = array( + '.ast-separate-container .ast-article-post, .ast-separate-container .ast-article-single' => array( + 'padding' => '1.5em 2.14em', + ), + '.ast-separate-container #primary, .ast-separate-container #secondary' => array( + 'padding' => '1.5em 0', + ), + '#primary, #secondary' => array( + 'padding' => '1.5em 0', + 'margin' => 0, + ), + '.ast-left-sidebar #content > .ast-container' => array( + 'display' => 'flex', + 'flex-direction' => 'column-reverse', + 'width' => '100%', + ), + '.ast-author-box img.avatar' => array( + 'margin' => '20px 0 0 0', + ), + ); + + /* Parse CSS from array() -> max-width: (tablet-breakpoint)px CSS */ + $parse_css .= astra_parse_css( $static_layout_css, '', astra_get_tablet_breakpoint() ); + + if ( is_author() ) { + $parse_css .= astra_parse_css( + array( + '.ast-author-box img.avatar' => array( + 'margin' => '20px 0 0 0', + ), + ), + astra_get_tablet_breakpoint() + ); + } + + if ( 'no-sidebar' !== astra_page_layout() ) { + $static_secondary_layout_css = array( + '#secondary.secondary' => array( + 'padding-top' => 0, + ), + '.ast-separate-container.ast-right-sidebar #secondary' => array( + 'padding-left' => '1em', + 'padding-right' => '1em', + ), + '.ast-separate-container.ast-two-container #secondary' => array( + 'padding-left' => 0, + 'padding-right' => 0, + ), + '.ast-page-builder-template .entry-header #secondary, .ast-page-builder-template #secondary' => array( + 'margin-top' => '1.5em', + ), + ); + $parse_css .= astra_parse_css( $static_secondary_layout_css, '', astra_get_tablet_breakpoint() ); + } + + if ( 'no-sidebar' !== astra_page_layout() ) { + if ( $is_site_rtl ) { + $static_layout_lang_direction_css = array( + '.ast-right-sidebar #primary' => array( + 'padding-left' => 0, + ), + '.ast-page-builder-template.ast-left-sidebar #secondary, ast-page-builder-template.ast-right-sidebar #secondary' => array( + 'padding-left' => '20px', + 'padding-right' => '20px', + ), + '.ast-right-sidebar #secondary, .ast-left-sidebar #primary' => array( + 'padding-right' => 0, + ), + '.ast-left-sidebar #secondary' => array( + 'padding-left' => 0, + ), + ); + } else { + $static_layout_lang_direction_css = array( + '.ast-right-sidebar #primary' => array( + 'padding-right' => 0, + ), + '.ast-page-builder-template.ast-left-sidebar #secondary, .ast-page-builder-template.ast-right-sidebar #secondary' => array( + 'padding-right' => '20px', + 'padding-left' => '20px', + ), + '.ast-right-sidebar #secondary, .ast-left-sidebar #primary' => array( + 'padding-left' => 0, + ), + '.ast-left-sidebar #secondary' => array( + 'padding-right' => 0, + ), + ); + } + /* Parse CSS from array() -> max-width: (tablet-breakpoint)px CSS */ + $parse_css .= astra_parse_css( $static_layout_lang_direction_css, '', astra_get_tablet_breakpoint() ); + } + + $static_layout_css_min = array( + '.ast-separate-container.ast-right-sidebar #primary, .ast-separate-container.ast-left-sidebar #primary' => array( + 'border' => 0, + ), + '.search-no-results.ast-separate-container #primary' => array( + 'margin-bottom' => '4em', + ), + ); + + if ( is_author() ) { + $author_table_css = array( + '.ast-author-box' => array( + '-js-display' => 'flex', + 'display' => 'flex', + ), + '.ast-author-bio' => array( + 'flex' => '1', + ), + ); + $static_layout_css_min = array_merge( $static_layout_css_min, $author_table_css ); + } + + /* Parse CSS from array() -> min-width: (tablet-breakpoint + 1)px CSS */ + $parse_css .= astra_parse_css( $static_layout_css_min, astra_get_tablet_breakpoint( '', '1' ) ); + + // 404 Page. + if ( is_404() ) { + + $page_404 = array( + '.ast-404-layout-1 .ast-404-text' => array( + 'font-size' => astra_get_font_css_value( '200' ), + ), + ); + $parse_css .= astra_parse_css( $page_404 ); + + $parse_css .= astra_parse_css( + array( + '.error404.ast-separate-container #primary' => array( + 'margin-bottom' => '4em', + ), + ), + astra_get_tablet_breakpoint( '', '1' ) + ); + + $parse_css .= astra_parse_css( + array( + '.ast-404-layout-1 .ast-404-text' => array( + 'font-size' => astra_get_font_css_value( 100 ), + ), + ), + '', + '920' + ); + } + + if ( 'no-sidebar' !== astra_page_layout() ) { + + if ( $is_site_rtl ) { + $static_layout_min_lang_direction_css = array( + '.ast-right-sidebar #primary' => array( + 'border-left' => '1px solid #eee', + ), + '.ast-right-sidebar #secondary' => array( + 'border-right' => '1px solid #eee', + 'margin-right' => '-1px', + ), + '.ast-left-sidebar #primary' => array( + 'border-right' => '1px solid #eee', + ), + '.ast-left-sidebar #secondary' => array( + 'border-left' => '1px solid #eee', + 'margin-left' => '-1px', + ), + '.ast-separate-container.ast-two-container.ast-right-sidebar #secondary' => array( + 'padding-right' => '30px', + 'padding-left' => 0, + ), + '.ast-separate-container.ast-two-container.ast-left-sidebar #secondary' => array( + 'padding-left' => '30px', + 'padding-right' => 0, + ), + '.ast-separate-container.ast-right-sidebar #secondary, .ast-separate-container.ast-left-sidebar #secondary' => array( + 'border' => 0, + 'margin-left' => 'auto', + 'margin-right' => 'auto', + ), + '.ast-separate-container.ast-two-container #secondary .widget:last-child' => array( + 'margin-bottom' => 0, + ), + ); + } else { + $static_layout_min_lang_direction_css = array( + '.ast-right-sidebar #primary' => array( + 'border-right' => '1px solid #eee', + ), + '.ast-left-sidebar #primary' => array( + 'border-left' => '1px solid #eee', + ), + '.ast-right-sidebar #secondary' => array( + 'border-left' => '1px solid #eee', + 'margin-left' => '-1px', + ), + '.ast-left-sidebar #secondary' => array( + 'border-right' => '1px solid #eee', + 'margin-right' => '-1px', + ), + '.ast-separate-container.ast-two-container.ast-right-sidebar #secondary' => array( + 'padding-left' => '30px', + 'padding-right' => 0, + ), + '.ast-separate-container.ast-two-container.ast-left-sidebar #secondary' => array( + 'padding-right' => '30px', + 'padding-left' => 0, + ), + '.ast-separate-container.ast-right-sidebar #secondary, .ast-separate-container.ast-left-sidebar #secondary' => array( + 'border' => 0, + 'margin-left' => 'auto', + 'margin-right' => 'auto', + ), + '.ast-separate-container.ast-two-container #secondary .widget:last-child' => array( + 'margin-bottom' => 0, + ), + ); + } + + /* Parse CSS from array() -> min-width: (tablet-breakpoint + 1)px CSS */ + $parse_css .= astra_parse_css( $static_layout_min_lang_direction_css, astra_get_tablet_breakpoint( '', '1' ) ); + } + + /** + * Elementor & Gutenberg button backward compatibility for default styling. + */ + if ( self::page_builder_button_style_css() ) { + + $search_button_selector = $is_wp_5_8_support_enabled ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' : ''; + $search_button_hover_selector = $is_wp_5_8_support_enabled ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:focus' : ''; + + /** + * Global button CSS - Desktop. + */ + $global_button_desktop = array( + '.menu-toggle, button, .ast-button, .ast-custom-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' . $search_button_selector => array( + 'border-style' => 'solid', + 'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '0', + 'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '0', + 'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '0', + 'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '0', + 'color' => esc_attr( $btn_text_color ), + 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), + 'background-color' => esc_attr( $btn_bg_color ), + 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), + 'font-family' => astra_get_font_family( $theme_btn_font_family ), + 'font-weight' => esc_attr( $theme_btn_font_weight ), + 'font-size' => astra_get_font_css_value( $theme_btn_font_size['desktop'], $theme_btn_font_size['desktop-unit'] ), + 'line-height' => esc_attr( $theme_btn_line_height ), + 'text-transform' => esc_attr( $theme_btn_text_transform ), + 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), + ), + 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .ast-custom-button:hover .button:hover, .ast-custom-button:hover , input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus' . $search_button_hover_selector => array( + 'color' => esc_attr( $btn_text_hover_color ), + 'background-color' => esc_attr( $btn_bg_hover_color ), + 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ), + + ), + ); + + $btn_text_color_selectors = '.wp-block-button .wp-block-button__link, '; + + if ( 'color-typo' === self::elementor_default_color_font_setting() || 'color' === self::elementor_default_color_font_setting() || 'typo' === self::elementor_default_color_font_setting() ) { + $ele_btn_default_desktop = array( + '.elementor-button-wrapper .elementor-button' => array( + 'border-style' => 'solid', + 'text-decoration' => 'none', + 'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '0', + 'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '0', + 'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '0', + 'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '0', + ), + 'body .elementor-button.elementor-size-sm, body .elementor-button.elementor-size-xs, body .elementor-button.elementor-size-md, body .elementor-button.elementor-size-lg, body .elementor-button.elementor-size-xl, body .elementor-button' => array( + 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), + ), + ); + + /* Parse CSS from array() */ + $parse_css .= astra_parse_css( $ele_btn_default_desktop ); + + $ele_btn_default_tablet = array( + '.elementor-button-wrapper .elementor-button.elementor-size-sm, .elementor-button-wrapper .elementor-button.elementor-size-xs, .elementor-button-wrapper .elementor-button.elementor-size-md, .elementor-button-wrapper .elementor-button.elementor-size-lg, .elementor-button-wrapper .elementor-button.elementor-size-xl, .elementor-button-wrapper .elementor-button' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), + ), + ); + + /* Parse CSS from array() */ + $parse_css .= astra_parse_css( $ele_btn_default_tablet, '', astra_get_tablet_breakpoint() ); + + $ele_btn_default_mobile = array( + '.elementor-button-wrapper .elementor-button.elementor-size-sm, .elementor-button-wrapper .elementor-button.elementor-size-xs, .elementor-button-wrapper .elementor-button.elementor-size-md, .elementor-button-wrapper .elementor-button.elementor-size-lg, .elementor-button-wrapper .elementor-button.elementor-size-xl, .elementor-button-wrapper .elementor-button' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), + ), + ); + + /* Parse CSS from array() */ + $parse_css .= astra_parse_css( $ele_btn_default_mobile, '', astra_get_mobile_breakpoint() ); + } + + if ( 'color-typo' === self::elementor_default_color_font_setting() || 'color' === self::elementor_default_color_font_setting() ) { + // Check if Global Elementor - Theme Style - button color is set. If yes then remove ( :visited ) CSS for the compatibility. + if ( false === self::is_elementor_kit_button_color_set() ) { + $btn_text_color_selectors .= '.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited'; + } else { + $btn_text_color_selectors .= '.elementor-button-wrapper .elementor-button'; + } + + $ele_btn_color_builder_desktop = array( + '.elementor-button-wrapper .elementor-button' => array( + 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), + 'background-color' => esc_attr( $btn_bg_color ), + ), + '.elementor-button-wrapper .elementor-button:hover, .elementor-button-wrapper .elementor-button:focus' => array( + 'color' => esc_attr( $btn_text_hover_color ), + 'background-color' => esc_attr( $btn_bg_hover_color ), + 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ), + + ), + ); + + /* Parse CSS from array() */ + $parse_css .= astra_parse_css( $ele_btn_color_builder_desktop ); + } + + $global_button_page_builder_text_color_desktop = array( + $btn_text_color_selectors => array( + 'color' => esc_attr( $btn_text_color ), + ), + ); + + /* Parse CSS from array() */ + $parse_css .= astra_parse_css( $global_button_page_builder_text_color_desktop ); + + if ( 'color-typo' === self::elementor_default_color_font_setting() || 'typo' === self::elementor_default_color_font_setting() ) { + $ele_btn_typo_builder_desktop = array( + '.elementor-button-wrapper .elementor-button' => array( + 'font-family' => astra_get_font_family( $theme_btn_font_family ), + 'font-weight' => esc_attr( $theme_btn_font_weight ), + 'line-height' => esc_attr( $theme_btn_line_height ), + 'text-transform' => esc_attr( $theme_btn_text_transform ), + 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), + ), + 'body .elementor-button.elementor-size-sm, body .elementor-button.elementor-size-xs, body .elementor-button.elementor-size-md, body .elementor-button.elementor-size-lg, body .elementor-button.elementor-size-xl, body .elementor-button' => array( + 'font-size' => astra_responsive_font( $theme_btn_font_size, 'desktop' ), + ), + ); + + /* Parse CSS from array() */ + $parse_css .= astra_parse_css( $ele_btn_typo_builder_desktop ); + } + + $global_button_page_builder_desktop = array( + '.wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' => array( + 'color' => esc_attr( $btn_text_hover_color ), + 'background-color' => esc_attr( $btn_bg_hover_color ), + 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ), + ), + '.elementor-widget-heading h1.elementor-heading-title' => array( + 'line-height' => esc_attr( $h1_line_height ), + ), + '.elementor-widget-heading h2.elementor-heading-title' => array( + 'line-height' => esc_attr( $h2_line_height ), + ), + '.elementor-widget-heading h3.elementor-heading-title' => array( + 'line-height' => esc_attr( $h3_line_height ), + ), + '.elementor-widget-heading h4.elementor-heading-title' => array( + 'line-height' => esc_attr( $h4_line_height ), + ), + '.elementor-widget-heading h5.elementor-heading-title' => array( + 'line-height' => esc_attr( $h5_line_height ), + ), + '.elementor-widget-heading h6.elementor-heading-title' => array( + 'line-height' => esc_attr( $h6_line_height ), + ), + ); + + if ( self::gutenberg_core_patterns_compat() && ! astra_button_default_padding_updated() ) { + $theme_outline_gb_btn_top_border = ( isset( $global_custom_button_border_size['top'] ) && ( '' !== $global_custom_button_border_size['top'] && '0' !== $global_custom_button_border_size['top'] ) ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '2px'; + $theme_outline_gb_btn_right_border = ( isset( $global_custom_button_border_size['right'] ) && ( '' !== $global_custom_button_border_size['right'] && '0' !== $global_custom_button_border_size['right'] ) ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '2px'; + $theme_outline_gb_btn_bottom_border = ( isset( $global_custom_button_border_size['bottom'] ) && ( '' !== $global_custom_button_border_size['bottom'] && '0' !== $global_custom_button_border_size['bottom'] ) ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '2px'; + $theme_outline_gb_btn_left_border = ( isset( $global_custom_button_border_size['left'] ) && ( '' !== $global_custom_button_border_size['left'] && '0' !== $global_custom_button_border_size['left'] ) ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '2px'; + + $global_button_page_builder_desktop['.wp-block-button .wp-block-button__link'] = array( + 'border' => 'none', + 'background-color' => esc_attr( $btn_bg_color ), + 'color' => esc_attr( $btn_text_color ), + 'font-family' => astra_get_font_family( $theme_btn_font_family ), + 'font-weight' => esc_attr( $theme_btn_font_weight ), + 'line-height' => esc_attr( $theme_btn_line_height ), + 'text-transform' => esc_attr( $theme_btn_text_transform ), + 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), + 'font-size' => astra_responsive_font( $theme_btn_font_size, 'desktop' ), + 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), + 'padding' => '15px 30px', + ); + $global_button_page_builder_desktop['.wp-block-button.is-style-outline .wp-block-button__link'] = array( + 'border-style' => 'solid', + 'border-top-width' => esc_attr( $theme_outline_gb_btn_top_border ), + 'border-right-width' => esc_attr( $theme_outline_gb_btn_right_border ), + 'border-left-width' => esc_attr( $theme_outline_gb_btn_left_border ), + 'border-bottom-width' => esc_attr( $theme_outline_gb_btn_bottom_border ), + 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), + 'padding-top' => 'calc(15px - ' . (int) $theme_outline_gb_btn_top_border . 'px)', + 'padding-right' => 'calc(30px - ' . (int) $theme_outline_gb_btn_right_border . 'px)', + 'padding-bottom' => 'calc(15px - ' . (int) $theme_outline_gb_btn_bottom_border . 'px)', + 'padding-left' => 'calc(30px - ' . (int) $theme_outline_gb_btn_left_border . 'px)', + ); + + $global_button_page_builder_tablet = array( + '.wp-block-button .wp-block-button__link' => array( + 'font-size' => astra_responsive_font( $theme_btn_font_size, 'tablet' ), + 'border' => 'none', + 'padding' => '15px 30px', + ), + '.wp-block-button.is-style-outline .wp-block-button__link' => array( + 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', + 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', + 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', + 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', + ), + ); + + $global_button_page_builder_mobile = array( + '.wp-block-button .wp-block-button__link' => array( + 'font-size' => astra_responsive_font( $theme_btn_font_size, 'mobile' ), + 'border' => 'none', + 'padding' => '15px 30px', + ), + '.wp-block-button.is-style-outline .wp-block-button__link' => array( + 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', + 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', + 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', + 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', + ), + ); + } else { + + $default_border_size = '0'; + if ( astra_button_default_padding_updated() ) { + $default_border_size = ''; + } + + $global_button_page_builder_desktop['.wp-block-button .wp-block-button__link'] = array( + 'border-style' => 'solid', + 'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : $default_border_size, + 'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : $default_border_size, + 'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : $default_border_size, + 'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : $default_border_size, + 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), + 'background-color' => esc_attr( $btn_bg_color ), + 'color' => esc_attr( $btn_text_color ), + 'font-family' => astra_get_font_family( $theme_btn_font_family ), + 'font-weight' => esc_attr( $theme_btn_font_weight ), + 'line-height' => esc_attr( $theme_btn_line_height ), + 'text-transform' => esc_attr( $theme_btn_text_transform ), + 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), + 'font-size' => astra_responsive_font( $theme_btn_font_size, 'desktop' ), + 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), + ); + + $global_button_page_builder_tablet = array( + '.wp-block-button .wp-block-button__link' => array( + 'font-size' => astra_responsive_font( $theme_btn_font_size, 'tablet' ), + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), + ), + ); + + $global_button_page_builder_mobile = array( + '.wp-block-button .wp-block-button__link' => array( + 'font-size' => astra_responsive_font( $theme_btn_font_size, 'mobile' ), + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), + ), + ); + } + + /* Parse CSS from array() */ + $parse_css .= astra_parse_css( $global_button_page_builder_desktop ); + + /* Parse CSS from array() */ + $parse_css .= astra_parse_css( $global_button_page_builder_tablet, '', astra_get_tablet_breakpoint() ); + + /* Parse CSS from array() */ + $parse_css .= astra_parse_css( $global_button_page_builder_mobile, '', astra_get_mobile_breakpoint() ); + } else { + + $search_button_selector = $is_wp_5_8_support_enabled ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' : ''; + $search_button_hover_selector = $is_wp_5_8_support_enabled ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:focus' : ''; + + /** + * Global button CSS - Desktop. + */ + $global_button_desktop = array( + '.menu-toggle, button, .ast-button, .ast-custom-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' . $search_button_selector => array( + 'color' => esc_attr( $btn_text_color ), + 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), + 'background-color' => esc_attr( $btn_bg_color ), + 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), + 'font-family' => astra_get_font_family( $theme_btn_font_family ), + 'font-weight' => esc_attr( $theme_btn_font_weight ), + 'font-size' => astra_get_font_css_value( $theme_btn_font_size['desktop'], $theme_btn_font_size['desktop-unit'] ), + 'text-transform' => esc_attr( $theme_btn_text_transform ), + 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), + ), + 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .ast-custom-button:hover .button:hover, .ast-custom-button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus' . $search_button_hover_selector => array( + 'color' => esc_attr( $btn_text_hover_color ), + 'background-color' => esc_attr( $btn_bg_hover_color ), + 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ), + + ), + ); + } + + /* Parse CSS from array() */ + $parse_css .= astra_parse_css( $global_button_desktop ); + + /* Parse CSS from array() -> min-width: (tablet-breakpoint) px CSS */ + if ( empty( $site_content_width ) ) { + $container_min_tablet_css = array( + '.ast-container' => array( + 'max-width' => '100%', + ), + ); + $parse_css .= astra_parse_css( $container_min_tablet_css, astra_get_tablet_breakpoint() ); + } + + $container_min_mobile_css = array( + '.ast-container' => array( + 'max-width' => '100%', + ), + ); + + /* Parse CSS from array() -> min-width: (mobile-breakpoint) px CSS */ + $parse_css .= astra_parse_css( $container_min_mobile_css, astra_get_mobile_breakpoint() ); + + $global_button_mobile = array( + '.ast-separate-container .ast-article-post, .ast-separate-container .ast-article-single, .ast-separate-container .comments-title, .ast-separate-container .ast-archive-description' => array( + 'padding' => '1.5em 1em', + ), + '.ast-separate-container #content .ast-container' => array( + 'padding-left' => '0.54em', + 'padding-right' => '0.54em', + ), + '.ast-separate-container .ast-comment-list li.depth-1' => array( + 'padding' => '1.5em 1em', + 'margin-bottom' => '1.5em', + ), + '.ast-separate-container .ast-comment-list .bypostauthor' => array( + 'padding' => '.5em', + ), + '.ast-search-menu-icon.ast-dropdown-active .search-field' => array( + 'width' => '170px', + ), + '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' => array( + 'font-size' => astra_get_font_css_value( $theme_btn_font_size['mobile'], $theme_btn_font_size['mobile-unit'] ), + ), + '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), + 'font-size' => astra_responsive_font( $theme_btn_font_size, 'mobile' ), + ), + ); + + if ( 'no-sidebar' !== astra_page_layout() ) { + $global_button_mobile['.ast-separate-container #secondary'] = array( + 'padding-top' => 0, + ); + $global_button_mobile['.ast-separate-container.ast-two-container #secondary .widget'] = array( + 'margin-bottom' => '1.5em', + 'padding-left' => '1em', + 'padding-right' => '1em', + ); + } + + // Add/Remove logo max-width: 100%; CSS for logo in old header layout. + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && false === self::remove_logo_max_width_mobile_static_css() ) { + $global_button_mobile['.site-branding img, .site-header .site-logo-img .custom-logo-link img'] = array( + 'max-width' => '100%', + ); + } + + /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */ + $parse_css .= astra_parse_css( $global_button_mobile, '', astra_get_mobile_breakpoint() ); + + /** + * Global button CSS - -> max-width: (tablet-breakpoint) px. + */ + $global_button_tablet = array( + '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' => array( + 'font-size' => astra_get_font_css_value( $theme_btn_font_size['tablet'], $theme_btn_font_size['tablet-unit'] ), + ), + '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), + 'font-size' => astra_responsive_font( $theme_btn_font_size, 'tablet' ), + ), + '.ast-mobile-header-stack .main-header-bar .ast-search-menu-icon' => array( + 'display' => 'inline-block', + ), + '.ast-header-break-point.ast-header-custom-item-outside .ast-mobile-header-stack .main-header-bar .ast-search-icon' => array( + 'margin' => '0', + ), + '.ast-comment-avatar-wrap img' => array( + 'max-width' => '2.5em', + ), + '.ast-separate-container .ast-comment-list li.depth-1' => array( + 'padding' => '1.5em 2.14em', + ), + '.ast-separate-container .comment-respond' => array( + 'padding' => '2em 2.14em', + ), + '.ast-comment-meta' => array( + 'padding' => '0 1.8888em 1.3333em', + ), + ); + + /* Parse CSS from array() -> max-width: (tablet-breakpoint) px CSS */ + $parse_css .= astra_parse_css( $global_button_tablet, '', astra_get_tablet_breakpoint() ); + + if ( Astra_Builder_Helper::is_component_loaded( 'search', 'header', 'mobile' ) ) { + + if ( $is_site_rtl ) { + $global_button_tablet_lang_direction_css = array( + '.ast-header-break-point .ast-search-menu-icon.slide-search .search-form' => array( + 'left' => '0', + ), + '.ast-header-break-point .ast-mobile-header-stack .ast-search-menu-icon.slide-search .search-form' => array( + 'left' => '-1em', + ), + ); + } else { + $global_button_tablet_lang_direction_css = array( + '.ast-header-break-point .ast-search-menu-icon.slide-search .search-form' => array( + 'right' => '0', + ), + '.ast-header-break-point .ast-mobile-header-stack .ast-search-menu-icon.slide-search .search-form' => array( + 'right' => '-1em', + ), + ); + } + + $parse_css .= astra_parse_css( $global_button_tablet_lang_direction_css, '', astra_get_tablet_breakpoint() ); + } + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && 'custom-button' === $header_custom_button_style ) { + $css_output = array( + + // Header button typography stylings. + '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button, .ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( + 'font-family' => astra_get_font_family( $header_custom_btn_font_family ), + 'font-weight' => esc_attr( $header_custom_btn_font_weight ), + 'font-size' => astra_responsive_font( $header_custom_btn_font_size, 'desktop' ), + 'line-height' => esc_attr( $header_custom_btn_line_height ), + 'text-transform' => esc_attr( $header_custom_btn_text_transform ), + 'letter-spacing' => astra_get_css_value( $header_custom_btn_letter_spacing, 'px' ), + ), + + // Custom menu item button - Default. + '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( + 'color' => esc_attr( $header_custom_button_text_color ), + 'background-color' => esc_attr( $header_custom_button_back_color ), + 'padding-top' => astra_responsive_spacing( $header_custom_button_spacing, 'top', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $header_custom_button_spacing, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $header_custom_button_spacing, 'left', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $header_custom_button_spacing, 'right', 'desktop' ), + 'border-radius' => astra_get_css_value( $header_custom_button_radius, 'px' ), + 'border-style' => 'solid', + 'border-color' => esc_attr( $header_custom_button_border_color ), + 'border-top-width' => ( isset( $header_custom_button_border_size['top'] ) && '' !== $header_custom_button_border_size['top'] ) ? astra_get_css_value( $header_custom_button_border_size['top'], 'px' ) : '0px', + 'border-right-width' => ( isset( $header_custom_button_border_size['right'] ) && '' !== $header_custom_button_border_size['right'] ) ? astra_get_css_value( $header_custom_button_border_size['right'], 'px' ) : '0px', + 'border-left-width' => ( isset( $header_custom_button_border_size['left'] ) && '' !== $header_custom_button_border_size['left'] ) ? astra_get_css_value( $header_custom_button_border_size['left'], 'px' ) : '0px', + 'border-bottom-width' => ( isset( $header_custom_button_border_size['bottom'] ) && '' !== $header_custom_button_border_size['bottom'] ) ? astra_get_css_value( $header_custom_button_border_size['bottom'], 'px' ) : '0px', + ), + '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' => array( + 'color' => esc_attr( $header_custom_button_text_h_color ), + 'background-color' => esc_attr( $header_custom_button_back_h_color ), + 'border-color' => esc_attr( $header_custom_button_border_h_color ), + ), + + // Custom menu item button - Transparent. + '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( + 'color' => esc_attr( $header_custom_trans_button_text_color ), + 'background-color' => esc_attr( $header_custom_trans_button_back_color ), + 'padding-top' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'top', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'left', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'right', 'desktop' ), + 'border-radius' => astra_get_css_value( $header_custom_trans_button_radius, 'px' ), + 'border-style' => 'solid', + 'border-color' => esc_attr( $header_custom_trans_button_border_color ), + 'border-top-width' => ( isset( $header_custom_trans_button_border_size['top'] ) && '' !== $header_custom_trans_button_border_size['top'] ) ? astra_get_css_value( $header_custom_trans_button_border_size['top'], 'px' ) : '', + 'border-right-width' => ( isset( $header_custom_trans_button_border_size['right'] ) && '' !== $header_custom_trans_button_border_size['right'] ) ? astra_get_css_value( $header_custom_trans_button_border_size['right'], 'px' ) : '', + 'border-left-width' => ( isset( $header_custom_trans_button_border_size['left'] ) && '' !== $header_custom_trans_button_border_size['left'] ) ? astra_get_css_value( $header_custom_trans_button_border_size['left'], 'px' ) : '', + 'border-bottom-width' => ( isset( $header_custom_trans_button_border_size['bottom'] ) && '' !== $header_custom_trans_button_border_size['bottom'] ) ? astra_get_css_value( $header_custom_trans_button_border_size['bottom'], 'px' ) : '', + ), + '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' => array( + 'color' => esc_attr( $header_custom_trans_button_text_h_color ), + 'background-color' => esc_attr( $header_custom_trans_button_back_h_color ), + 'border-color' => esc_attr( $header_custom_trans_button_border_h_color ), + ), + ); + + /* Parse CSS from array() */ + $parse_css .= astra_parse_css( $css_output ); + + /* Parse CSS from array()*/ + + /* Custom Menu Item Button */ + $custom_button_css = array( + '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( + 'font-size' => astra_responsive_font( $header_custom_btn_font_size, 'tablet' ), + 'padding-top' => astra_responsive_spacing( $header_custom_button_spacing, 'top', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $header_custom_button_spacing, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $header_custom_button_spacing, 'left', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $header_custom_button_spacing, 'right', 'tablet' ), + ), + ); + + $custom_trans_button_css = array( + '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( + 'font-size' => astra_responsive_font( $header_custom_btn_font_size, 'tablet' ), + 'padding-top' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'top', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'left', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'right', 'tablet' ), + ), + ); + + /* Parse CSS from array()*/ + $parse_css .= astra_parse_css( array_merge( $custom_button_css, $custom_trans_button_css ), '', astra_get_tablet_breakpoint() ); + + /* Custom Menu Item Button */ + $custom_button = array( + '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( + 'font-size' => astra_responsive_font( $header_custom_btn_font_size, 'mobile' ), + 'padding-top' => astra_responsive_spacing( $header_custom_button_spacing, 'top', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $header_custom_button_spacing, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $header_custom_button_spacing, 'left', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $header_custom_button_spacing, 'right', 'mobile' ), + ), + ); + + $custom_trans_button = array( + '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' => array( + 'font-size' => astra_responsive_font( $header_custom_btn_font_size, 'mobile' ), + 'padding-top' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'top', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'left', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $header_custom_trans_button_spacing, 'right', 'mobile' ), + ), + ); + + /* Parse CSS from array()*/ + $parse_css .= astra_parse_css( array_merge( $custom_button, $custom_trans_button ), '', astra_get_mobile_breakpoint() ); + } + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { + // Foreground color. + if ( ! empty( $footer_adv_link_color ) ) { + $footer_adv_tagcloud = array( + '.footer-adv .tagcloud a:hover, .footer-adv .tagcloud a.current-item' => array( + 'color' => astra_get_foreground_color( $footer_adv_link_color ), + ), + '.footer-adv .calendar_wrap #today' => array( + 'color' => astra_get_foreground_color( $footer_adv_link_color ), + ), + ); + $parse_css .= astra_parse_css( $footer_adv_tagcloud ); + } + } + + /* Width for Footer */ + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && 'content' != $astra_footer_width ) { + $genral_global_responsive = array( + '.ast-small-footer .ast-container' => array( + 'max-width' => '100%', + 'padding-left' => '35px', + 'padding-right' => '35px', + ), + ); + + /* Parse CSS from array()*/ + $parse_css .= astra_parse_css( $genral_global_responsive, astra_get_tablet_breakpoint( '', 1 ) ); + } + + /* Width for Comments for Full Width / Stretched Template */ + if ( 'page-builder' == $container_layout ) { + $page_builder_comment = array( + '.ast-page-builder-template .comments-area, .single.ast-page-builder-template .entry-header, .single.ast-page-builder-template .post-navigation, .single.ast-page-builder-template .ast-single-related-posts-container' => array( + 'max-width' => astra_get_css_value( $site_content_width + 40, 'px' ), + 'margin-left' => 'auto', + 'margin-right' => 'auto', + ), + ); + /* Parse CSS from array()*/ + $parse_css .= astra_parse_css( $page_builder_comment, astra_get_mobile_breakpoint( '', 1 ) ); + + } + + $separate_container_css = array( + 'body, .ast-separate-container' => astra_get_responsive_background_obj( $box_bg_obj, 'desktop' ), + ); + $parse_css .= astra_parse_css( $separate_container_css ); + + $tablet_typo = array(); + + if ( isset( $body_font_size['tablet'] ) && '' != $body_font_size['tablet'] ) { + + $tablet_typo = array( + // Widget Title. + '.widget-title' => array( + 'font-size' => astra_get_font_css_value( (int) $body_font_size['tablet'] * 1.428571429, 'px', 'tablet' ), + ), + ); + } + + /* Tablet Typography */ + $tablet_typography = array( + 'body, button, input, select, textarea, .ast-button, .ast-custom-button' => array( + 'font-size' => astra_responsive_font( $body_font_size, 'tablet' ), + ), + '#secondary, #secondary button, #secondary input, #secondary select, #secondary textarea' => array( + 'font-size' => astra_responsive_font( $body_font_size, 'tablet' ), + ), + '.site-title' => array( + 'font-size' => astra_responsive_font( $site_title_font_size, 'tablet' ), + 'display' => esc_attr( $tablet_title_visibility ), + ), + '.ast-archive-description .ast-archive-title' => array( + 'font-size' => astra_responsive_font( $archive_summary_title_font_size, 'tablet', 40 ), + ), + '.site-header .site-description' => array( + 'font-size' => astra_responsive_font( $site_tagline_font_size, 'tablet' ), + 'display' => esc_attr( $tablet_tagline_visibility ), + ), + '.entry-title' => array( + 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'tablet', 30 ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h1, .entry-content h1, .entry-content h1 a', + 'h1, .entry-content h1' + ) => array( + 'font-size' => astra_responsive_font( $heading_h1_font_size, 'tablet', 30 ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h2, .entry-content h2, .entry-content h2 a', + 'h2, .entry-content h2' + ) => array( + 'font-size' => astra_responsive_font( $heading_h2_font_size, 'tablet', 25 ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h3, .entry-content h3, .entry-content h3 a', + 'h3, .entry-content h3' + ) => array( + 'font-size' => astra_responsive_font( $heading_h3_font_size, 'tablet', 20 ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h4, .entry-content h4, .entry-content h4 a', + 'h4, .entry-content h4' + ) => array( + 'font-size' => astra_responsive_font( $heading_h4_font_size, 'tablet' ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h5, .entry-content h5, .entry-content h5 a', + 'h5, .entry-content h5' + ) => array( + 'font-size' => astra_responsive_font( $heading_h5_font_size, 'tablet' ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h6, .entry-content h6, .entry-content h6 a', + 'h6, .entry-content h6' + ) => array( + 'font-size' => astra_responsive_font( $heading_h6_font_size, 'tablet' ), + ), + '.ast-single-post .entry-title, .page-title' => array( + 'font-size' => astra_responsive_font( $single_post_title_font_size, 'tablet', 30 ), + ), + '.astra-logo-svg' => array( + 'width' => astra_get_css_value( $header_logo_width['tablet'], 'px' ), + ), + '.astra-logo-svg:not(.sticky-custom-logo .astra-logo-svg, .transparent-custom-logo .astra-logo-svg, .advanced-header-logo .astra-logo-svg)' => array( + 'height' => astra_get_css_value( ( ! empty( $header_logo_width['tablet-svg-height'] ) && ! is_customize_preview() ) ? $header_logo_width['tablet-svg-height'] : '', 'px' ), + ), + 'header .custom-logo-link img, .ast-header-break-point .site-logo-img .custom-mobile-logo-link img' => array( + 'max-width' => astra_get_css_value( $header_logo_width['tablet'], 'px' ), + ), + 'body, .ast-separate-container' => astra_get_responsive_background_obj( $box_bg_obj, 'tablet' ), + ); + + /* Parse CSS from array()*/ + $parse_css .= astra_parse_css( array_merge( $tablet_typo, $tablet_typography ), '', astra_get_tablet_breakpoint() ); + + $mobile_typo = array(); + if ( isset( $body_font_size['mobile'] ) && '' != $body_font_size['mobile'] ) { + $mobile_typo = array( + // Widget Title. + '.widget-title' => array( + 'font-size' => astra_get_font_css_value( (int) $body_font_size['mobile'] * 1.428571429, 'px', 'mobile' ), + ), + ); + } + + /* Mobile Typography */ + $mobile_typography = array( + 'body, button, input, select, textarea, .ast-button, .ast-custom-button' => array( + 'font-size' => astra_responsive_font( $body_font_size, 'mobile' ), + ), + '#secondary, #secondary button, #secondary input, #secondary select, #secondary textarea' => array( + 'font-size' => astra_responsive_font( $body_font_size, 'mobile' ), + ), + '.site-title' => array( + 'font-size' => astra_responsive_font( $site_title_font_size, 'mobile' ), + 'display' => esc_attr( $mobile_title_visibility ), + ), + '.ast-archive-description .ast-archive-title' => array( + 'font-size' => astra_responsive_font( $archive_summary_title_font_size, 'mobile', 40 ), + ), + '.site-header .site-description' => array( + 'font-size' => astra_responsive_font( $site_tagline_font_size, 'mobile' ), + 'display' => esc_attr( $mobile_tagline_visibility ), + ), + '.entry-title' => array( + 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'mobile', 30 ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h1, .entry-content h1, .entry-content h1 a', + 'h1, .entry-content h1' + ) => array( + 'font-size' => astra_responsive_font( $heading_h1_font_size, 'mobile', 30 ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h2, .entry-content h2, .entry-content h2 a', + 'h2, .entry-content h2' + ) => array( + 'font-size' => astra_responsive_font( $heading_h2_font_size, 'mobile', 25 ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h3, .entry-content h3, .entry-content h3 a', + 'h3, .entry-content h3' + ) => array( + 'font-size' => astra_responsive_font( $heading_h3_font_size, 'mobile', 20 ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h4, .entry-content h4, .entry-content h4 a', + 'h4, .entry-content h4' + ) => array( + 'font-size' => astra_responsive_font( $heading_h4_font_size, 'mobile' ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h5, .entry-content h5, .entry-content h5 a', + 'h5, .entry-content h5' + ) => array( + 'font-size' => astra_responsive_font( $heading_h5_font_size, 'mobile' ), + ), + + // Conditionally select the css selectors with or without achors. + self::conditional_headings_css_selectors( + 'h6, .entry-content h6, .entry-content h6 a', + 'h6, .entry-content h6' + ) => array( + 'font-size' => astra_responsive_font( $heading_h6_font_size, 'mobile' ), + ), + + '.ast-single-post .entry-title, .page-title' => array( + 'font-size' => astra_responsive_font( $single_post_title_font_size, 'mobile', 30 ), + ), + '.ast-header-break-point .site-branding img, .ast-header-break-point .custom-logo-link img' => array( + 'max-width' => astra_get_css_value( $header_logo_width['mobile'], 'px' ), + ), + '.astra-logo-svg' => array( + 'width' => astra_get_css_value( $header_logo_width['mobile'], 'px' ), + ), + '.astra-logo-svg:not(.sticky-custom-logo .astra-logo-svg, .transparent-custom-logo .astra-logo-svg, .advanced-header-logo .astra-logo-svg)' => array( + 'height' => astra_get_css_value( ( ! empty( $header_logo_width['mobile-svg-height'] ) && ! is_customize_preview() ) ? $header_logo_width['mobile-svg-height'] : '', 'px' ), + ), + '.ast-header-break-point .site-logo-img .custom-mobile-logo-link img' => array( + 'max-width' => astra_get_css_value( $header_logo_width['mobile'], 'px' ), + ), + 'body, .ast-separate-container' => astra_get_responsive_background_obj( $box_bg_obj, 'mobile' ), + ); + + /* Parse CSS from array()*/ + $parse_css .= astra_parse_css( array_merge( $mobile_typo, $mobile_typography ), '', astra_get_mobile_breakpoint() ); + + /* + * Responsive Font Size for Tablet & Mobile to the root HTML element + */ + + // Tablet Font Size for HTML tag. + if ( '' == $body_font_size['tablet'] ) { + $html_tablet_typography = array( + 'html' => array( + 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 5.7, '%' ), + ), + ); + $parse_css .= astra_parse_css( $html_tablet_typography, '', astra_get_tablet_breakpoint() ); + } + // Mobile Font Size for HTML tag. + if ( '' == $body_font_size['mobile'] ) { + $html_mobile_typography = array( + 'html' => array( + 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 5.7, '%' ), + ), + ); + } else { + $html_mobile_typography = array( + 'html' => array( + 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 6.25, '%' ), + ), + ); + } + /* Parse CSS from array()*/ + $parse_css .= astra_parse_css( $html_mobile_typography, '', astra_get_mobile_breakpoint() ); + + /* Site width Responsive */ + $site_width = array( + '.ast-container' => array( + 'max-width' => astra_get_css_value( $site_content_width + 40, 'px' ), + ), + ); + + /* Parse CSS from array()*/ + $parse_css .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) ); + + if ( is_astra_addon_3_5_0_version() ) { + $mega_menu_css = array( + '.ast-desktop .main-header-menu:not(#ast-hf-mobile-menu) .astra-full-megamenu-wrapper .sub-menu, .ast-desktop .main-header-menu:not(#ast-hf-mobile-menu) .astra-megamenu .sub-menu' => array( + 'box-shadow' => 'none', + ), + '.ast-desktop .main-header-menu:not(#ast-hf-mobile-menu) .astra-full-megamenu-wrapper' => array( + 'box-shadow' => '0 4px 10px -2px rgba(0, 0, 0, 0.1)', + ), + '.ast-desktop .main-header-menu > .menu-item .astra-full-megamenu-wrapper:before' => array( + 'position' => 'absolute', + 'content' => '', + 'top' => '0', + 'right' => '0', + 'width' => '100%', + 'transform' => 'translateY(-100%)', + ), + ); + $parse_css .= astra_parse_css( $mega_menu_css ); + } + /** + * Astra Fonts + */ + if ( apply_filters( 'astra_enable_default_fonts', true ) ) { + $astra_fonts = '@font-face {'; + $astra_fonts .= 'font-family: "Astra";'; + $astra_fonts .= 'src: url(' . ASTRA_THEME_URI . 'assets/fonts/astra.woff) format("woff"),'; + $astra_fonts .= 'url(' . ASTRA_THEME_URI . 'assets/fonts/astra.ttf) format("truetype"),'; + $astra_fonts .= 'url(' . ASTRA_THEME_URI . 'assets/fonts/astra.svg#astra) format("svg");'; + $astra_fonts .= 'font-weight: normal;'; + $astra_fonts .= 'font-style: normal;'; + $astra_fonts .= 'font-display: ' . astra_get_fonts_display_property() . ';'; + $astra_fonts .= '}'; + $parse_css .= $astra_fonts; + } + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { + /** + * Hide the default naviagtion markup for responsive devices. + * Once class .ast-header-break-point is added to the body below CSS will be override by the + * .ast-header-break-point class + */ + $astra_navigation = '@media (max-width:' . $header_break_point . 'px) {'; + $astra_navigation .= '.main-header-bar .main-header-bar-navigation{'; + $astra_navigation .= 'display:none;'; + $astra_navigation .= '}'; + $astra_navigation .= '}'; + $parse_css .= $astra_navigation; + } + + /* Blog */ + if ( 'custom' === $blog_width ) : + + /* Site width Responsive */ + $blog_css = array( + '.blog .site-content > .ast-container, .archive .site-content > .ast-container, .search .site-content > .ast-container' => array( + 'max-width' => astra_get_css_value( $blog_max_width, 'px' ), + ), + ); + $parse_css .= astra_parse_css( $blog_css, astra_get_tablet_breakpoint( '', 1 ) ); + endif; + + /* Single Blog */ + if ( 'custom' === $single_post_max ) : + + /* Site width Responsive */ + $single_blog_css = array( + '.single-post .site-content > .ast-container' => array( + 'max-width' => astra_get_css_value( $single_post_max_width, 'px' ), + ), + ); + $parse_css .= astra_parse_css( $single_blog_css, astra_get_tablet_breakpoint( '', 1 ) ); + endif; + + // Primary Submenu Border Width & Color. + $submenu_border_style = array( + '.ast-desktop .main-header-menu.submenu-with-border .sub-menu, .ast-desktop .main-header-menu.submenu-with-border .astra-full-megamenu-wrapper' => array( + 'border-color' => esc_attr( $primary_submenu_b_color ), + ), + + '.ast-desktop .main-header-menu.submenu-with-border .sub-menu' => array( + 'border-top-width' => astra_get_css_value( $submenu_border['top'], 'px' ), + 'border-right-width' => astra_get_css_value( $submenu_border['right'], 'px' ), + 'border-left-width' => astra_get_css_value( $submenu_border['left'], 'px' ), + 'border-bottom-width' => astra_get_css_value( $submenu_border['bottom'], 'px' ), + 'border-style' => 'solid', + ), + '.ast-desktop .main-header-menu.submenu-with-border .sub-menu .sub-menu' => array( + 'top' => ( isset( $submenu_border['top'] ) && '' != $submenu_border['top'] ) ? astra_get_css_value( '-' . $submenu_border['top'], 'px' ) : '', + ), + '.ast-desktop .main-header-menu.submenu-with-border .sub-menu .menu-link, .ast-desktop .main-header-menu.submenu-with-border .children .menu-link' => array( + 'border-bottom-width' => ( $primary_submenu_item_border ) ? '1px' : '0px', + 'border-style' => 'solid', + 'border-color' => esc_attr( $primary_submenu_item_b_color ), + ), + ); + + // Submenu items goes outside? + $submenu_border_for_left_align_menu = array( + '.main-header-menu .sub-menu .menu-item.ast-left-align-sub-menu:hover > .sub-menu, .main-header-menu .sub-menu .menu-item.ast-left-align-sub-menu.focus > .sub-menu' => array( + 'margin-left' => ( ( isset( $submenu_border['left'] ) && '' != $submenu_border['left'] ) || isset( $submenu_border['right'] ) && '' != $submenu_border['right'] ) ? astra_get_css_value( '-' . ( (int) $submenu_border['left'] + (int) $submenu_border['right'] ), 'px' ) : '', + ), + ); + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { + $parse_css .= astra_parse_css( $submenu_border_style ); + } + + // Submenu items goes outside? + $parse_css .= astra_parse_css( $submenu_border_for_left_align_menu, astra_get_tablet_breakpoint( '', 1 ) ); + + /* Small Footer CSS */ + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && 'disabled' != $small_footer_layout ) : + $sml_footer_css = array( + '.ast-small-footer' => array( + 'border-top-style' => 'solid', + 'border-top-width' => astra_get_css_value( $small_footer_divider, 'px' ), + 'border-top-color' => esc_attr( $small_footer_divider_color ), + ), + ); + $parse_css .= astra_parse_css( $sml_footer_css ); + + if ( 'footer-sml-layout-2' != $small_footer_layout ) { + $sml_footer_css = array( + '.ast-small-footer-wrap' => array( + 'text-align' => 'center', + ), + ); + $parse_css .= astra_parse_css( $sml_footer_css ); + } + endif; + + /* Transparent Header - Comonent header specific CSS compatibility */ + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active && Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) { + + $html_text_color = astra_get_option( 'transparent-header-html-text-color' ); + $html_link_color = astra_get_option( 'transparent-header-html-link-color' ); + $html_link_h_color = astra_get_option( 'transparent-header-html-link-h-color' ); + + $search_icon_color = astra_get_option( 'transparent-header-search-icon-color' ); + $search_text_color = astra_get_option( 'transparent-header-search-box-placeholder-color' ); + + $search_box_bg_color = astra_get_option( 'transparent-header-search-box-background-color' ); + + $social_color = astra_get_option( 'transparent-header-social-icons-color' ); + $social_hover_color = astra_get_option( 'transparent-header-social-icons-h-color' ); + $social_bg_color = astra_get_option( 'transparent-header-social-icons-bg-color' ); + $social_bg_hover_color = astra_get_option( 'transparent-header-social-icons-bg-h-color' ); + + $widget_title_color = astra_get_option( 'transparent-header-widget-title-color' ); + $widget_content_color = astra_get_option( 'transparent-header-widget-content-color' ); + $widget_link_color = astra_get_option( 'transparent-header-widget-link-color' ); + $widget_link_hover_color = astra_get_option( 'transparent-header-widget-link-h-color' ); + + $button_color = astra_get_option( 'transparent-header-button-text-color' ); + $button_h_color = astra_get_option( 'transparent-header-button-text-h-color' ); + $button_bg_color = astra_get_option( 'transparent-header-button-bg-color' ); + $button_bg_h_color = astra_get_option( 'transparent-header-button-bg-h-color' ); + + $divider_color = astra_get_option( 'transparent-header-divider-color' ); + $account_icon_color = astra_get_option( 'transparent-account-icon-color' ); + $account_loggedout_text_color = astra_get_option( 'transparent-account-type-text-color' ); + + // Menu colors. + $account_menu_resp_color = astra_get_option( 'transparent-account-menu-color-responsive' ); + $account_menu_resp_bg_color = astra_get_option( 'transparent-account-menu-bg-obj-responsive' ); + $account_menu_resp_color_hover = astra_get_option( 'transparent-account-menu-h-color-responsive' ); + $account_menu_resp_bg_color_hover = astra_get_option( 'transparent-account-menu-h-bg-color-responsive' ); + $account_menu_resp_color_active = astra_get_option( 'transparent-account-menu-a-color-responsive' ); + $account_menu_resp_bg_color_active = astra_get_option( 'transparent-account-menu-a-bg-color-responsive' ); + + $account_menu_resp_color_desktop = ( isset( $account_menu_resp_color['desktop'] ) ) ? $account_menu_resp_color['desktop'] : ''; + $account_menu_resp_color_tablet = ( isset( $account_menu_resp_color['tablet'] ) ) ? $account_menu_resp_color['tablet'] : ''; + $account_menu_resp_color_mobile = ( isset( $account_menu_resp_color['mobile'] ) ) ? $account_menu_resp_color['mobile'] : ''; + + $account_menu_resp_bg_color_desktop = ( isset( $account_menu_resp_bg_color['desktop'] ) ) ? $account_menu_resp_bg_color['desktop'] : ''; + $account_menu_resp_bg_color_tablet = ( isset( $account_menu_resp_bg_color['tablet'] ) ) ? $account_menu_resp_bg_color['tablet'] : ''; + $account_menu_resp_bg_color_mobile = ( isset( $account_menu_resp_bg_color['mobile'] ) ) ? $account_menu_resp_bg_color['mobile'] : ''; + + $account_menu_resp_color_hover_desktop = ( isset( $account_menu_resp_color_hover['desktop'] ) ) ? $account_menu_resp_color_hover['desktop'] : ''; + $account_menu_resp_color_hover_tablet = ( isset( $account_menu_resp_color_hover['tablet'] ) ) ? $account_menu_resp_color_hover['tablet'] : ''; + $account_menu_resp_color_hover_mobile = ( isset( $account_menu_resp_color_hover['mobile'] ) ) ? $account_menu_resp_color_hover['mobile'] : ''; + + $account_menu_resp_bg_color_hover_desktop = ( isset( $account_menu_resp_bg_color_hover['desktop'] ) ) ? $account_menu_resp_bg_color_hover['desktop'] : ''; + $account_menu_resp_bg_color_hover_tablet = ( isset( $account_menu_resp_bg_color_hover['tablet'] ) ) ? $account_menu_resp_bg_color_hover['tablet'] : ''; + $account_menu_resp_bg_color_hover_mobile = ( isset( $account_menu_resp_bg_color_hover['mobile'] ) ) ? $account_menu_resp_bg_color_hover['mobile'] : ''; + + $account_menu_resp_color_active_desktop = ( isset( $account_menu_resp_color_active['desktop'] ) ) ? $account_menu_resp_color_active['desktop'] : ''; + $account_menu_resp_color_active_tablet = ( isset( $account_menu_resp_color_active['tablet'] ) ) ? $account_menu_resp_color_active['tablet'] : ''; + $account_menu_resp_color_active_mobile = ( isset( $account_menu_resp_color_active['mobile'] ) ) ? $account_menu_resp_color_active['mobile'] : ''; + + $account_menu_resp_bg_color_active_desktop = ( isset( $account_menu_resp_bg_color_active['desktop'] ) ) ? $account_menu_resp_bg_color_active['desktop'] : ''; + $account_menu_resp_bg_color_active_tablet = ( isset( $account_menu_resp_bg_color_active['tablet'] ) ) ? $account_menu_resp_bg_color_active['tablet'] : ''; + $account_menu_resp_bg_color_active_mobile = ( isset( $account_menu_resp_bg_color_active['mobile'] ) ) ? $account_menu_resp_bg_color_active['mobile'] : ''; + + $transparent_header_builder_desktop_css = array( + '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element' => array( + 'color' => esc_attr( $html_text_color ), + ), + '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element a' => array( + 'color' => esc_attr( $html_link_color ), + ), + '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element a:hover' => array( + 'color' => esc_attr( $html_link_h_color ), + ), + '.ast-theme-transparent-header .ast-header-search .astra-search-icon, .ast-theme-transparent-header .ast-header-search .search-field::placeholder' => array( + 'color' => esc_attr( $search_icon_color ), + ), + '.ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field::placeholder' => array( + 'color' => esc_attr( $search_text_color ), + ), + '.ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-form, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-submit' => array( + 'background-color' => esc_attr( $search_box_bg_color ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element' => array( + 'background' => esc_attr( $social_bg_color['desktop'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element svg' => array( + 'fill' => esc_attr( $social_color['desktop'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover' => array( + 'background' => esc_attr( $social_bg_hover_color['desktop'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover svg' => array( + 'fill' => esc_attr( $social_hover_color['desktop'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element .social-item-label' => array( + 'color' => esc_attr( $social_color['desktop'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover .social-item-label' => array( + 'color' => esc_attr( $social_hover_color['desktop'] ), + ), + '.ast-theme-transparent-header .widget-area.header-widget-area .widget-title' => array( + 'color' => esc_attr( $widget_title_color ), + ), + '.ast-theme-transparent-header .widget-area.header-widget-area .header-widget-area-inner' => array( + 'color' => esc_attr( $widget_content_color ), + ), + '.ast-theme-transparent-header .widget-area.header-widget-area .header-widget-area-inner a' => array( + 'color' => esc_attr( $widget_link_color ), + ), + '.ast-theme-transparent-header .widget-area.header-widget-area .header-widget-area-inner a:hover' => array( + 'color' => esc_attr( $widget_link_hover_color ), + ), + '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button' => array( + 'color' => esc_attr( $button_color ), + 'background' => esc_attr( $button_bg_color ), + ), + '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button:hover' => array( + 'color' => esc_attr( $button_h_color ), + 'background' => esc_attr( $button_bg_h_color ), + ), + '.ast-theme-transparent-header .ast-header-divider-element .ast-divider-wrapper' => array( + 'border-color' => esc_attr( $divider_color ), + ), + '.ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-type-icon .ahfb-svg-iconset svg path:not(.ast-hf-account-unfill), .ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-type-icon .ahfb-svg-iconset svg circle' => array( + 'fill' => esc_attr( $account_icon_color ), + ), + '.ast-theme-transparent-header .ast-header-account-wrap .ast-account-nav-menu .menu-item .menu-link' => array( + 'color' => esc_attr( $account_menu_resp_color_desktop ), + ), + '.ast-theme-transparent-header .ast-header-account-wrap .ast-account-nav-menu .menu-item:hover > .menu-link' => array( + 'color' => $account_menu_resp_color_hover_desktop, + 'background' => $account_menu_resp_bg_color_hover_desktop, + ), + '.ast-theme-transparent-header .ast-header-account-wrap .ast-account-nav-menu .menu-item.current-menu-item > .menu-link' => array( + 'color' => $account_menu_resp_color_active_desktop, + 'background' => $account_menu_resp_bg_color_active_desktop, + ), + '.ast-theme-transparent-header .ast-header-account-wrap .account-main-navigation ul' => array( + 'background' => $account_menu_resp_bg_color_desktop, + ), + '.ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-text' => array( + 'color' => $account_loggedout_text_color, + ), + ); + + if ( Astra_Builder_Helper::apply_flex_based_css() ) { + $transparent_header_widget_selector = '.ast-theme-transparent-header .widget-area.header-widget-area.header-widget-area-inner'; + } else { + $transparent_header_widget_selector = '.ast-theme-transparent-header .widget-area.header-widget-area. header-widget-area-inner'; + } + + $transparent_header_builder_desktop_css[ $transparent_header_widget_selector ] = array( + 'color' => esc_attr( $widget_content_color ), + ); + $transparent_header_builder_desktop_css[ $transparent_header_widget_selector . ' a' ] = array( + 'color' => esc_attr( $widget_link_color ), + ); + $transparent_header_builder_desktop_css[ $transparent_header_widget_selector . ' a:hover' ] = array( + 'color' => esc_attr( $widget_link_hover_color ), + ); + + if ( Astra_Builder_Helper::is_component_loaded( 'mobile-trigger', 'header', 'mobile' ) ) { + + $transparent_toggle_selector = '.ast-theme-transparent-header [data-section="section-header-mobile-trigger"]'; + + $trigger_bg = astra_get_option( 'transparent-header-toggle-btn-bg-color' ); + $trigger_border_color = astra_get_option( 'transparent-header-toggle-border-color', $trigger_bg ); + $style = astra_get_option( 'mobile-header-toggle-btn-style' ); + $default = '#ffffff'; + + if ( 'fill' !== $style ) { + $default = $theme_color; + } + + $icon_color = astra_get_option( 'transparent-header-toggle-btn-color' ); + + /** + * Off-Canvas CSS. + */ + $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg' ] = array( + 'fill' => $icon_color, + ); + + $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .mobile-menu-wrap .mobile-menu' ] = array( + // Color. + 'color' => $icon_color, + ); + + if ( 'fill' === $style ) { + $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .ast-mobile-menu-trigger-fill' ] = array( + 'background' => esc_attr( $trigger_bg ), + ); + $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .ast-mobile-menu-trigger-fill, ' . $transparent_toggle_selector . ' .ast-button-wrap .ast-mobile-menu-trigger-minimal' ] = array( + // Color & Border. + 'color' => esc_attr( $icon_color ), + 'border' => 'none', + ); + } elseif ( 'outline' === $style ) { + $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .ast-mobile-menu-trigger-outline' ] = array( + // Background. + 'background' => 'transparent', + 'color' => esc_attr( $icon_color ), + 'border-color' => $trigger_border_color, + ); + } else { + $transparent_header_builder_desktop_css[ $transparent_toggle_selector . ' .ast-button-wrap .ast-mobile-menu-trigger-minimal' ] = array( + 'background' => 'transparent', + ); + } + } + + $parse_css .= astra_parse_css( $transparent_header_builder_desktop_css ); + + /** + * Max-width: Tablet Breakpoint CSS. + */ + $transparent_header_builder_tablet_css = array( + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element' => array( + 'background' => esc_attr( $social_bg_color['tablet'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element svg' => array( + 'fill' => esc_attr( $social_color['tablet'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover' => array( + 'background' => esc_attr( $social_bg_hover_color['tablet'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover svg' => array( + 'fill' => esc_attr( $social_hover_color['tablet'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element .social-item-label' => array( + 'color' => esc_attr( $social_color['tablet'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover .social-item-label' => array( + 'color' => esc_attr( $social_hover_color['tablet'] ), + ), + '.ast-theme-transparent-header .ast-account-nav-menu .menu-item .menu-link' => array( + 'color' => esc_attr( $account_menu_resp_color_tablet ), + ), + '.ast-theme-transparent-header .ast-account-nav-menu .menu-item:hover > .menu-link' => array( + 'color' => $account_menu_resp_color_hover_tablet, + 'background' => $account_menu_resp_bg_color_hover_tablet, + ), + '.ast-theme-transparent-header .ast-account-nav-menu .menu-item.current-menu-item > .menu-link' => array( + 'color' => $account_menu_resp_color_active_tablet, + 'background' => $account_menu_resp_bg_color_active_tablet, + ), + '.ast-theme-transparent-header .account-main-navigation ul' => array( + 'background' => $account_menu_resp_bg_color_tablet, + ), + ); + + $parse_css .= astra_parse_css( $transparent_header_builder_tablet_css, '', astra_get_tablet_breakpoint() ); + + /** + * Max-width: Mobile Breakpoint CSS. + */ + $transparent_header_builder_mobile_css = array( + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element' => array( + 'background' => esc_attr( $social_bg_color['mobile'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element svg' => array( + 'fill' => esc_attr( $social_color['mobile'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover' => array( + 'background' => esc_attr( $social_bg_hover_color['mobile'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover svg' => array( + 'fill' => esc_attr( $social_hover_color['mobile'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element .social-item-label' => array( + 'color' => esc_attr( $social_color['mobile'] ), + ), + '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover .social-item-label' => array( + 'color' => esc_attr( $social_hover_color['mobile'] ), + ), + '.ast-theme-transparent-header .ast-account-nav-menu .menu-item .menu-link' => array( + 'color' => esc_attr( $account_menu_resp_color_mobile ), + ), + '.ast-theme-transparent-header .ast-account-nav-menu .menu-item:hover > .menu-link' => array( + 'color' => $account_menu_resp_color_hover_mobile, + 'background' => $account_menu_resp_bg_color_hover_mobile, + ), + '.ast-theme-transparent-header .ast-account-nav-menu .menu-item.current-menu-item > .menu-link' => array( + 'color' => $account_menu_resp_color_active_mobile, + 'background' => $account_menu_resp_bg_color_active_mobile, + ), + '.ast-theme-transparent-header .account-main-navigation ul' => array( + 'background' => $account_menu_resp_bg_color_mobile, + ), + ); + + $parse_css .= astra_parse_css( $transparent_header_builder_mobile_css, '', astra_get_mobile_breakpoint() ); + } + + $parse_css .= $dynamic_css; + $custom_css = astra_get_option( 'custom-css' ); + + if ( '' != $custom_css ) { + $parse_css .= $custom_css; + } + + // trim white space for faster page loading. + $parse_css = Astra_Enqueue_Scripts::trim_css( $parse_css ); + + return apply_filters( 'astra_theme_dynamic_css', $parse_css ); + + } + + /** + * Return post meta CSS + * + * @param string $dynamic_css Astra Dynamic CSS. + * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. + * @return mixed Return the CSS. + */ + public static function return_meta_output( $dynamic_css, $dynamic_css_filtered = '' ) { + + /** + * - Page Layout + * + * - Sidebar Positions CSS + */ + $secondary_width = astra_get_option( 'site-sidebar-width' ); + $primary_width = absint( 100 - $secondary_width ); + $meta_style = ''; + + // Header Separator. + $header_separator = astra_get_option( 'header-main-sep' ); + $header_separator_color = astra_get_option( 'header-main-sep-color' ); + + $meta_style = array( + '.ast-header-break-point .main-header-bar' => array( + 'border-bottom-width' => astra_get_css_value( $header_separator, 'px' ), + 'border-bottom-color' => esc_attr( $header_separator_color ), + ), + ); + + $parse_css = astra_parse_css( $meta_style ); + + $meta_style = array( + '.main-header-bar' => array( + 'border-bottom-width' => astra_get_css_value( $header_separator, 'px' ), + 'border-bottom-color' => esc_attr( $header_separator_color ), + ), + ); + + $parse_css .= astra_parse_css( $meta_style, astra_get_tablet_breakpoint( '', 1 ) ); + + if ( 'no-sidebar' !== astra_page_layout() ) : + + $meta_style = array( + '#primary' => array( + 'width' => astra_get_css_value( $primary_width, '%' ), + ), + '#secondary' => array( + 'width' => astra_get_css_value( $secondary_width, '%' ), + ), + ); + + $parse_css .= astra_parse_css( $meta_style, astra_get_tablet_breakpoint( '', 1 ) ); + + endif; + + if ( false === self::astra_submenu_below_header_fix() ) : + // If submenu below header fix is not to be loaded then add removed flex properties from class `ast-flex`. + // Also restore the padding to class `main-header-bar`. + $submenu_below_header = array( + '.ast-flex' => array( + '-webkit-align-content' => 'center', + '-ms-flex-line-pack' => 'center', + 'align-content' => 'center', + '-webkit-box-align' => 'center', + '-webkit-align-items' => 'center', + '-moz-box-align' => 'center', + '-ms-flex-align' => 'center', + 'align-items' => 'center', + ), + '.main-header-bar' => array( + 'padding' => '1em 0', + ), + '.ast-site-identity' => array( + 'padding' => '0', + ), + // CSS to open submenu just below menu. + '.header-main-layout-1 .ast-flex.main-header-container, .header-main-layout-3 .ast-flex.main-header-container' => array( + '-webkit-align-content' => 'center', + '-ms-flex-line-pack' => 'center', + 'align-content' => 'center', + '-webkit-box-align' => 'center', + '-webkit-align-items' => 'center', + '-moz-box-align' => 'center', + '-ms-flex-align' => 'center', + 'align-items' => 'center', + ), + ); + + $parse_css .= astra_parse_css( $submenu_below_header ); + + else : + // `.menu-item` required display:flex, although weight of this css increases because of which custom CSS added from child themes to be not working. + // Hence this is added to dynamic CSS which will be applied only if this filter `astra_submenu_below_header_fix` is enabled. + // @see https://github.com/brainstormforce/astra/pull/828 + $submenu_below_header = array( + '.ast-safari-browser-less-than-11 .main-header-menu .menu-item, .ast-safari-browser-less-than-11 .main-header-bar .ast-masthead-custom-menu-items' => array( + 'display' => 'block', + ), + '.main-header-menu .menu-item, #astra-footer-menu .menu-item, .main-header-bar .ast-masthead-custom-menu-items' => array( + '-js-display' => 'flex', + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + '-webkit-box-pack' => 'center', + '-webkit-justify-content' => 'center', + '-moz-box-pack' => 'center', + '-ms-flex-pack' => 'center', + 'justify-content' => 'center', + '-webkit-box-orient' => 'vertical', + '-webkit-box-direction' => 'normal', + '-webkit-flex-direction' => 'column', + '-moz-box-orient' => 'vertical', + '-moz-box-direction' => 'normal', + '-ms-flex-direction' => 'column', + 'flex-direction' => 'column', + ), + '.main-header-menu > .menu-item > .menu-link, #astra-footer-menu > .menu-item > .menu-link,' => array( + 'height' => '100%', + '-webkit-box-align' => 'center', + '-webkit-align-items' => 'center', + '-moz-box-align' => 'center', + '-ms-flex-align' => 'center', + 'align-items' => 'center', + '-js-display' => 'flex', + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + ), + ); + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { + $submenu_below_header['.ast-primary-menu-disabled .main-header-bar .ast-masthead-custom-menu-items'] = array( + 'flex' => 'unset', + ); + } + + $parse_css .= astra_parse_css( $submenu_below_header ); + + endif; + + if ( false === self::astra_submenu_open_below_header_fix() ) { + // If submenu below header fix is not to be loaded then add removed flex properties from class `ast-flex`. + // Also restore the padding to class `main-header-bar`. + $submenu_below_header = array( + // CSS to open submenu just below menu. + '.header-main-layout-1 .ast-flex.main-header-container, .header-main-layout-3 .ast-flex.main-header-container' => array( + '-webkit-align-content' => 'center', + '-ms-flex-line-pack' => 'center', + 'align-content' => 'center', + '-webkit-box-align' => 'center', + '-webkit-align-items' => 'center', + '-moz-box-align' => 'center', + '-ms-flex-align' => 'center', + 'align-items' => 'center', + ), + ); + + $parse_css .= astra_parse_css( $submenu_below_header ); + } + + $submenu_toggle = ''; + + if ( false === Astra_Icons::is_svg_icons() ) { + $submenu_toggle = array( + // HFB / Old Header Footer - CSS compatibility when SVGs are disabled. + '.main-header-menu .sub-menu .menu-item.menu-item-has-children > .menu-link:after' => array( + 'position' => 'absolute', + 'right' => '1em', + 'top' => '50%', + 'transform' => 'translate(0,-50%) rotate(270deg)', + ), + '.ast-header-break-point .main-header-bar .main-header-bar-navigation .page_item_has_children > .ast-menu-toggle::before, .ast-header-break-point .main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before, .ast-mobile-popup-drawer .main-header-bar-navigation .menu-item-has-children>.ast-menu-toggle::before, .ast-header-break-point .ast-mobile-header-wrap .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before' => array( + 'font-weight' => 'bold', + 'content' => '"\e900"', + 'font-family' => 'Astra', + 'text-decoration' => 'inherit', + 'display' => 'inline-block', + ), + '.ast-header-break-point .main-navigation ul.sub-menu .menu-item .menu-link:before' => array( + 'content' => '"\e900"', + 'font-family' => 'Astra', + 'font-size' => '.65em', + 'text-decoration' => 'inherit', + 'display' => 'inline-block', + 'transform' => 'translate(0, -2px) rotateZ(270deg)', + 'margin-right' => '5px', + ), + '.widget_search .search-form:after' => array( + 'font-family' => 'Astra', + 'font-size' => '1.2em', + 'font-weight' => 'normal', + 'content' => '"\e8b6"', + 'position' => 'absolute', + 'top' => '50%', + 'right' => '15px', + 'transform' => 'translate(0, -50%)', + ), + '.astra-search-icon::before' => array( + 'content' => '"\e8b6"', + 'font-family' => 'Astra', + 'font-style' => 'normal', + 'font-weight' => 'normal', + 'text-decoration' => 'inherit', + 'text-align' => 'center', + '-webkit-font-smoothing' => 'antialiased', + '-moz-osx-font-smoothing' => 'grayscale', + ), + '.main-header-bar .main-header-bar-navigation .page_item_has_children > a:after, .main-header-bar .main-header-bar-navigation .menu-item-has-children > a:after, .site-header-focus-item .main-header-bar-navigation .menu-item-has-children > .menu-link:after' => array( + 'content' => '"\e900"', + 'display' => 'inline-block', + 'font-family' => 'Astra', + 'font-size' => '9px', + 'font-size' => '.6rem', + 'font-weight' => 'bold', + 'text-rendering' => 'auto', + '-webkit-font-smoothing' => 'antialiased', + '-moz-osx-font-smoothing' => 'grayscale', + 'margin-left' => '10px', + 'line-height' => 'normal', + ), + '.ast-mobile-popup-drawer .main-header-bar-navigation .ast-submenu-expanded>.ast-menu-toggle::before' => array( + 'transform' => 'rotateX(180deg)', + ), + '.ast-header-break-point .main-header-bar-navigation .menu-item-has-children > .menu-link:after' => array( + 'display' => 'none', + ), + ); + } else { + if ( ! Astra_Builder_Helper::$is_header_footer_builder_active ) { + $submenu_toggle = array( + // Old Header Footer - SVG Support. + '.ast-desktop .main-header-menu .sub-menu .menu-item.menu-item-has-children>.menu-link .icon-arrow svg' => array( + 'position' => 'absolute', + 'right' => '.6em', + 'top' => '50%', + 'transform' => 'translate(0,-50%) rotate(270deg)', + ), + '.ast-header-break-point .main-navigation ul .menu-item .menu-link .icon-arrow:first-of-type svg' => array( + 'left' => '.1em', + 'top' => '.1em', + 'transform' => 'translate(0, -2px) rotateZ(270deg)', + ), + ); + } else { + $submenu_toggle = array( + // New Header Footer - SVG Support. + '.ast-header-break-point .main-navigation ul .menu-item .menu-link .icon-arrow:first-of-type svg' => array( + 'top' => '.2em', + 'margin-top' => '0px', + 'margin-left' => '0px', + 'width' => '.65em', + 'transform' => 'translate(0, -2px) rotateZ(270deg)', + ), + '.ast-mobile-popup-content .ast-submenu-expanded > .ast-menu-toggle' => array( + 'transform' => 'rotateX(180deg)', + ), + ); + } + } + + $parse_css .= astra_parse_css( $submenu_toggle ); + + $dynamic_css .= $parse_css; + + return $dynamic_css; + } + + /** + * Conditionally iclude CSS Selectors with anchors in the typography settings. + * + * Historically Astra adds Colors/Typography CSS for headings and anchors for headings but this causes irregularities with the expected output. + * For eg Link color does not work for the links inside headings. + * + * If filter `astra_include_achors_in_headings_typography` is set to true or Astra Option `include-headings-in-typography` is set to true, This will return selectors with anchors. Else This will return selectors without anchors. + * + * @access Private. + * + * @since 1.4.9 + * @param String $selectors_with_achors CSS Selectors with anchors. + * @param String $selectors_without_achors CSS Selectors withour annchors. + * + * @return String CSS Selectors based on the condition of filters. + */ + private static function conditional_headings_css_selectors( $selectors_with_achors, $selectors_without_achors ) { + + if ( true === self::anchors_in_css_selectors_heading() ) { + return $selectors_with_achors; + } else { + return $selectors_without_achors; + } + + } + + /** + * Check if CSS selectors in Headings should use anchors. + * + * @since 1.4.9 + * @return boolean true if it should include anchors, False if not. + */ + public static function anchors_in_css_selectors_heading() { + + if ( true === astra_get_option( 'include-headings-in-typography' ) && + true === apply_filters( + 'astra_include_achors_in_headings_typography', + true + ) ) { + + return true; + } + + return false; + } + + /** + * Check backwards compatibility CSS for loading submenu below the header needs to be added. + * + * @since 1.5.0 + * @return boolean true if CSS should be included, False if not. + */ + public static function astra_submenu_below_header_fix() { + + if ( false === astra_get_option( 'submenu-below-header', true ) && + false === apply_filters( + 'astra_submenu_below_header_fix', + false + ) ) { + + return false; + } + return true; + } + + /** + * Check backwards compatibility CSS for loading submenu below the header needs to be added. + * + * @since 2.1.3 + * @return boolean true if submenu below header fix is to be loaded, False if not. + */ + public static function astra_submenu_open_below_header_fix() { + + if ( false === astra_get_option( 'submenu-open-below-header', true ) && + false === apply_filters( + 'astra_submenu_open_below_header_fix', + false + ) ) { + + return false; + } + return true; + } + + /** + * Check backwards compatibility to not load default CSS for the button styling of Page Builders. + * + * @since 2.2.0 + * @return boolean true if button style CSS should be loaded, False if not. + */ + public static function page_builder_button_style_css() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['pb-button-color-compatibility'] = ( isset( $astra_settings['pb-button-color-compatibility'] ) && false === $astra_settings['pb-button-color-compatibility'] ) ? false : true; + return apply_filters( 'astra_page_builder_button_style_css', $astra_settings['pb-button-color-compatibility'] ); + } + + /** + * Elementor Theme Style - Button Text Color compatibility. This should be looked in the future for proper solution. + * + * Reference: https://github.com/elementor/elementor/issues/10733 + * Reference: https://github.com/elementor/elementor/issues/10739 + * + * @since 2.3.3 + * + * @return mixed + */ + public static function is_elementor_kit_button_color_set() { + $ele_btn_global_text_color = false; + $ele_kit_id = get_option( 'elementor_active_kit', false ); + if ( false !== $ele_kit_id ) { + $ele_global_btn_data = get_post_meta( $ele_kit_id, '_elementor_page_settings' ); + // Elementor Global theme style button text color fetch value from database. + $ele_btn_global_text_color = isset( $ele_global_btn_data[0]['button_text_color'] ) ? $ele_global_btn_data[0]['button_text_color'] : $ele_btn_global_text_color; + } + return $ele_btn_global_text_color; + } + + /** + * Check if Elementor - Disable Default Colors or Disable Default Fonts checked or unchecked. + * + * @since 2.3.3 + * + * @return mixed String if any of the settings are enabled. False if no settings are enabled. + */ + public static function elementor_default_color_font_setting() { + $ele_default_color_setting = get_option( 'elementor_disable_color_schemes' ); + $ele_default_typo_setting = get_option( 'elementor_disable_typography_schemes' ); + + if ( ( 'yes' === $ele_default_color_setting && 'yes' === $ele_default_typo_setting ) || ( false === self::is_elementor_default_color_font_comp() ) ) { + return 'color-typo'; + } + + if ( 'yes' === $ele_default_color_setting ) { + return 'color'; + } + + if ( 'yes' === $ele_default_typo_setting ) { + return 'typo'; + } + + return false; + + } + + /** + * For existing users, do not reflect direct change. + * + * @since 3.6.5 + * @return boolean true if WordPress-5.8 compatibility enabled, False if not. + */ + public static function is_block_editor_support_enabled() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['support-block-editor'] = ( isset( $astra_settings['support-block-editor'] ) && false === $astra_settings['support-block-editor'] ) ? false : true; + return apply_filters( 'astra_has_block_editor_support', $astra_settings['support-block-editor'] ); + } + + /** + * For existing users, do not provide Elementor Default Color Typo settings compatibility by default. + * + * @since 2.3.3 + * @return boolean true if elementor default color and typo setting should work with theme, False if not. + */ + public static function is_elementor_default_color_font_comp() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['ele-default-color-typo-setting-comp'] = ( isset( $astra_settings['ele-default-color-typo-setting-comp'] ) && false === $astra_settings['ele-default-color-typo-setting-comp'] ) ? false : true; + return apply_filters( 'astra_elementor_default_color_font_comp', $astra_settings['ele-default-color-typo-setting-comp'] ); + } + + /** + * For existing users, do not load the wide/full width image CSS by default. + * + * @since 2.4.4 + * @return boolean false if it is an existing user , true if not. + */ + public static function gtn_image_group_css_comp() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['gtn-full-wide-image-grp-css'] = isset( $astra_settings['gtn-full-wide-image-grp-css'] ) ? false : true; + return apply_filters( 'gtn_image_group_css_comp', $astra_settings['gtn-full-wide-image-grp-css'] ); + } + + /** + * Do not apply new wide/full Group and Cover block CSS for existing users. + * + * @since 2.5.0 + * @return boolean false if it is an existing user , true if not. + */ + public static function gtn_group_cover_css_comp() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['gtn-full-wide-grp-cover-css'] = isset( $astra_settings['gtn-full-wide-grp-cover-css'] ) ? false : true; + return apply_filters( 'astra_gtn_group_cover_css_comp', $astra_settings['gtn-full-wide-grp-cover-css'] ); + } + + /** + * Do not apply new Group, Column and Media & Text block CSS for existing users. + * + * @since 2.6.0 + * @return boolean false if it is an existing user , true if not. + */ + public static function gutenberg_core_blocks_css_comp() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['guntenberg-core-blocks-comp-css'] = isset( $astra_settings['guntenberg-core-blocks-comp-css'] ) ? false : true; + return apply_filters( 'astra_gutenberg_core_blocks_design_compatibility', $astra_settings['guntenberg-core-blocks-comp-css'] ); + } + + /** + * Do not apply new Group, Column and Media & Text block CSS for existing users. + * + * CSS for adding spacing|padding support to Gutenberg Media-&-Text Block + * + * @since 2.6.1 + * @return boolean false if it is an existing user , true if not. + */ + public static function gutenberg_media_text_block_css_compat() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['guntenberg-media-text-block-padding-css'] = isset( $astra_settings['guntenberg-media-text-block-padding-css'] ) ? false : true; + return apply_filters( 'astra_gutenberg_media_text_block_spacing_compatibility', $astra_settings['guntenberg-media-text-block-padding-css'] ); + } + + /** + * Gutenberg pattern compatibility changes. + * + * @since 3.3.0 + * @return boolean false if it is an existing user , true if not. + */ + public static function gutenberg_core_patterns_compat() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['guntenberg-button-pattern-compat-css'] = isset( $astra_settings['guntenberg-button-pattern-compat-css'] ) ? false : true; + return apply_filters( 'astra_gutenberg_patterns_compatibility', $astra_settings['guntenberg-button-pattern-compat-css'] ); + } + + /** + * Font CSS support for widget-title heading fonts & fonts which are not working in editor. + * + * 1. Adding Font-weight support to widget titles. + * 2. Customizer font CSS not supporting in editor. + * + * @since 3.6.0 + * @return boolean false if it is an existing user, true if not. + */ + public static function support_font_css_to_widget_and_in_editor() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['can-support-widget-and-editor-fonts'] = isset( $astra_settings['can-support-widget-and-editor-fonts'] ) ? false : true; + return apply_filters( 'astra_heading_fonts_typo_support', $astra_settings['can-support-widget-and-editor-fonts'] ); + } + + /** + * Whether to remove or not following CSS which restricts logo size on responsive devices. + * + * @see https://github.com/brainstormforce/astra/commit/d09f63336b73d58c8f8951726edbc90671d7f419 + * + * @since 3.6.0 + * @return boolean false if it is an existing user, true if not. + */ + public static function remove_logo_max_width_mobile_static_css() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['can-remove-logo-max-width-css'] = isset( $astra_settings['can-remove-logo-max-width-css'] ) ? false : true; + return apply_filters( 'astra_remove_logo_max_width_css', $astra_settings['can-remove-logo-max-width-css'] ); + } + + /** + * Load sidebar static CSS when it is enabled. + * + * @since 3.0.0 + */ + public static function load_sidebar_static_css() { + + $sidebar_static_css = ' + #secondary { + margin: 4em 0 2.5em; + word-break: break-word; + line-height: 2; + } + + #secondary li { + margin-bottom: 0.25em; + } + + #secondary li:last-child { + margin-bottom: 0; + } + @media (max-width: 768px) { + .js_active .ast-plain-container.ast-single-post #secondary { + margin-top: 1.5em; + } + } + .ast-separate-container.ast-two-container #secondary .widget { + background-color: #fff; + padding: 2em; + margin-bottom: 2em; + } + '; + if ( is_rtl() ) { + $sidebar_static_css .= ' + @media (min-width: 993px) { + .ast-left-sidebar #secondary { + padding-left: 60px; + } + + .ast-right-sidebar #secondary { + padding-right: 60px; + } + } + @media (max-width: 993px) { + .ast-right-sidebar #secondary { + padding-right: 30px; + } + .ast-left-sidebar #secondary { + padding-left: 30px; + } + + }'; + } else { + $sidebar_static_css .= ' + @media (min-width: 993px) { + .ast-left-sidebar #secondary { + padding-right: 60px; + } + + .ast-right-sidebar #secondary { + padding-left: 60px; + } + } + @media (max-width: 993px) { + .ast-right-sidebar #secondary { + padding-left: 30px; + } + .ast-left-sidebar #secondary { + padding-right: 30px; + } + + }'; + } + return $sidebar_static_css; + + } + + /** + * Load static card(EDD/Woo) CSS. + * + * @since 3.0.0 + * @return string static css for Woocommerce and EDD card. + */ + public static function load_cart_static_css() { + + $cart_static_css = ' + .ast-site-header-cart .cart-container, + .ast-edd-site-header-cart .ast-edd-cart-container { + transition: all 0.2s linear; + } + + .ast-site-header-cart .ast-woo-header-cart-info-wrap, + .ast-edd-site-header-cart .ast-edd-header-cart-info-wrap { + padding: 0 2px; + font-weight: 600; + line-height: 2.7; + display: inline-block; + } + + .ast-site-header-cart i.astra-icon { + font-size: 20px; + font-size: 1.3em; + font-style: normal; + font-weight: normal; + position: relative; + padding: 0 2px; + } + + .ast-site-header-cart i.astra-icon.no-cart-total:after, + .ast-header-break-point.ast-header-custom-item-outside .ast-edd-header-cart-info-wrap, + .ast-header-break-point.ast-header-custom-item-outside .ast-woo-header-cart-info-wrap { + display: none; + } + .ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap, + ast-edd-site-header-cart.ast-edd-menu-cart-outline .ast-edd-cart-menu-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .ast-edd-cart-menu-wrap { + line-height: 1.8; + } + + .ast-site-header-cart.ast-menu-cart-fill i.astra-icon, + .ast-edd-site-header-cart.ast-edd-menu-cart-fill span.astra-icon { + font-size: 1.1em; + } + + .astra-cart-drawer { + position: fixed; + display: block; + visibility: hidden; + overflow: hidden; + -webkit-overflow-scrolling: touch; + z-index: 9999; + background-color: #fff; + transition: all 0.5s ease; + transform: translate3d(0, 0, 0); + } + + .astra-cart-drawer.open-right { + width: 80%; + height: 100%; + left: 100%; + top: 0px; + transform: translate3d(0%, 0, 0); + } + + .astra-cart-drawer.active { + transform: translate3d(-100%, 0, 0); + visibility: visible; + } + + .astra-cart-drawer .astra-cart-drawer-header { + text-align: center; + text-transform: uppercase; + font-weight: 400; + border-bottom: 1px solid #f0f0f0; + padding: 0 0 0.675rem; + } + + .astra-cart-drawer .astra-cart-drawer-close .ast-close-svg { + width: 22px; + height: 22px; + } + + .astra-cart-drawer .astra-cart-drawer-title { + padding-top: 5px; + } + + .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart { + padding: 1em 1.5em; + } + + .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart a.remove { + width: 20px; + height: 20px; + line-height: 16px; + } + + .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__total { + padding: 1em 1.5em; + margin: 0; + text-align: center; + } + + .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__buttons { + padding: 10px; + text-align: center; + } + + .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__buttons .button.checkout { + margin-right: 0; + } + + .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item { + padding: .5em 2.6em .5em 1.5em; + } + + .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item .edd-remove-from-cart::after { + width: 20px; + height: 20px; + line-height: 16px; + } + + .astra-cart-drawer .astra-cart-drawer-content .edd-cart-number-of-items { + padding: 1em 1.5em 1em 1.5em; + margin-bottom: 0; + text-align: center; + } + + .astra-cart-drawer .astra-cart-drawer-content .edd_total { + padding: .5em 1.5em; + margin: 0; + text-align: center; + } + + .astra-cart-drawer .astra-cart-drawer-content .cart_item.edd_checkout { + padding: 1em 1.5em 0; + text-align: center; + margin-top: 0; + } + .astra-cart-drawer .woocommerce-mini-cart__empty-message, + .astra-cart-drawer .cart_item.empty { + text-align: center; + margin-top: 10px; + } + + body.admin-bar .astra-cart-drawer { + top: 46px; + } + + .ast-mobile-cart-active body.ast-hfb-header { + overflow: hidden; + } + + .ast-mobile-cart-active .astra-mobile-cart-overlay { + opacity: 1; + cursor: pointer; + visibility: visible; + z-index: 999; + } + + @media (max-width: 545px) { + .astra-cart-drawer.active { + width: 100%; + } + } + '; + if ( is_rtl() ) { + $cart_static_css .= ' + .ast-site-header-cart i.astra-icon:after { + content: attr(data-cart-total); + position: absolute; + font-style: normal; + top: -10px; + left: -12px; + font-weight: bold; + box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, 0.3); + font-size: 11px; + padding-right: 0px; + padding-left: 2px; + line-height: 17px; + letter-spacing: -.5px; + height: 18px; + min-width: 18px; + border-radius: 99px; + text-align: center; + z-index: 4; + } + li.woocommerce-custom-menu-item .ast-site-header-cart i.astra-icon:after, + li.edd-custom-menu-item .ast-edd-site-header-cart span.astra-icon:after { + padding-right: 2px; + } + .astra-cart-drawer .astra-cart-drawer-close { + position: absolute; + top: 0; + left: 0; + margin: 0; + padding: .6em 1em .4em; + color: #ababab; + background-color: transparent; + } + .astra-mobile-cart-overlay { + background-color: rgba(0, 0, 0, 0.4); + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + visibility: hidden; + opacity: 0; + transition: opacity 0.2s ease-in-out; + } + .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item .edd-remove-from-cart { + left: 1.2em; + } + .ast-header-break-point.ast-woocommerce-cart-menu.ast-hfb-header .ast-cart-menu-wrap, .ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, + .ast-header-break-point .ast-edd-site-header-cart-wrap .ast-edd-cart-menu-wrap { + width: 2em; + height: 2em; + font-size: 1.4em; + line-height: 2; + vertical-align: middle; + text-align: left; + }'; + } else { + $cart_static_css .= ' + .ast-site-header-cart i.astra-icon:after { + content: attr(data-cart-total); + position: absolute; + font-style: normal; + top: -10px; + right: -12px; + font-weight: bold; + box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, 0.3); + font-size: 11px; + padding-left: 0px; + padding-right: 2px; + line-height: 17px; + letter-spacing: -.5px; + height: 18px; + min-width: 18px; + border-radius: 99px; + text-align: center; + z-index: 4; + } + li.woocommerce-custom-menu-item .ast-site-header-cart i.astra-icon:after, + li.edd-custom-menu-item .ast-edd-site-header-cart span.astra-icon:after { + padding-left: 2px; + } + .astra-cart-drawer .astra-cart-drawer-close { + position: absolute; + top: 0; + right: 0; + margin: 0; + padding: .6em 1em .4em; + color: #ababab; + background-color: transparent; + } + .astra-mobile-cart-overlay { + background-color: rgba(0, 0, 0, 0.4); + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + visibility: hidden; + opacity: 0; + transition: opacity 0.2s ease-in-out; + } + .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item .edd-remove-from-cart { + right: 1.2em; + } + .ast-header-break-point.ast-woocommerce-cart-menu.ast-hfb-header .ast-cart-menu-wrap, .ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, + .ast-header-break-point .ast-edd-site-header-cart-wrap .ast-edd-cart-menu-wrap { + width: 2em; + height: 2em; + font-size: 1.4em; + line-height: 2; + vertical-align: middle; + text-align: right; + }'; + } + // This CSS requires in case of :before Astra icons. But in case of SVGs this loads twice that's why removed this from static & loading conditionally. + if ( false === Astra_Icons::is_svg_icons() ) { + $cart_static_css .= ' + .ast-site-header-cart .cart-container *, + .ast-edd-site-header-cart .ast-edd-cart-container * { + transition: all 0s linear; + } + '; + } + return $cart_static_css; + } + } +} diff --git a/inc/class-astra-loop.php b/inc/class-astra-loop.php index 7460ae2..0eb8cc0 100644 --- a/inc/class-astra-loop.php +++ b/inc/class-astra-loop.php @@ -1,267 +1,267 @@ -loop_markup( true ); - } - - /** - * Template part loop - * - * @param boolean $is_page Loop outputs different content action for content page and default content. - * if is_page is set to true - do_action( 'astra_page_template_parts_content' ); is added - * if is_page is false - do_action( 'astra_template_parts_content' ); is added. - * @since 1.2.7 - * @return void - */ - public function loop_markup( $is_page = false ) { - ?> -
    - -
    - '; - } - } - - /** - * Add closing wrapper div for 'ast-row' after Astra template part. - * - * @since 1.2.7 - * @return void - */ - public function astra_templat_part_wrap_close() { - if ( is_archive() || is_search() || is_home() ) { - echo ''; - } - } - - } - - /** - * Initialize class object with 'get_instance()' method - */ - Astra_Loop::get_instance(); - -endif; +loop_markup( true ); + } + + /** + * Template part loop + * + * @param boolean $is_page Loop outputs different content action for content page and default content. + * if is_page is set to true - do_action( 'astra_page_template_parts_content' ); is added + * if is_page is false - do_action( 'astra_template_parts_content' ); is added. + * @since 1.2.7 + * @return void + */ + public function loop_markup( $is_page = false ) { + ?> +
    + +
    + '; + } + } + + /** + * Add closing wrapper div for 'ast-row' after Astra template part. + * + * @since 1.2.7 + * @return void + */ + public function astra_templat_part_wrap_close() { + if ( is_archive() || is_search() || is_home() ) { + echo ''; + } + } + + } + + /** + * Initialize class object with 'get_instance()' method + */ + Astra_Loop::get_instance(); + +endif; diff --git a/inc/class-astra-mobile-header.php b/inc/class-astra-mobile-header.php index 8ab0d61..438be40 100644 --- a/inc/class-astra-mobile-header.php +++ b/inc/class-astra-mobile-header.php @@ -1,229 +1,229 @@ -theme_location ) && in_array( $args->theme_location, $menu_locations ) ) { - if ( isset( $item->classes ) && in_array( 'menu-item-has-children', $item->classes ) ) { - $item_output = $this->menu_arrow_button_markup( $item_output, $item ); - } - } - } else { - if ( isset( $item->post_parent ) && 0 === $item->post_parent ) { - $item_output = $this->menu_arrow_button_markup( $item_output, $item ); - } - } - - return $item_output; - } - - /** - * Get Menu Arrow Button Mark up - * - * @param string $item_output The menu item's starting HTML output. - * @param WP_Post $item Menu item data object. - * - * @since 1.7.2 - * @return string Menu item arrow button markup. - */ - public function menu_arrow_button_markup( $item_output, $item ) { - $item_output = apply_filters( 'astra_toggle_button_markup', $item_output, $item ); - $item_output .= ''; - - return $item_output; - } - - /** - * Header Cart Icon Class - * - * @param array $classes Default argument array. - * - * @since 1.4.0 - * @return array; - */ - public function menu_toggle_classes( $classes ) { - return ' ast-mobile-menu-buttons-' . astra_get_option( 'mobile-header-toggle-btn-style' ) . ' '; - } - - /** - * Mobile Header Markup - * - * @return void - */ - public function mobile_header_markup() { - $mobile_header_logo = astra_get_option( 'mobile-header-logo' ); - $different_logo = astra_get_option( 'different-mobile-logo' ); - - if ( '' !== $mobile_header_logo && '1' == $different_logo ) { - add_filter( 'astra_has_custom_logo', '__return_true' ); - add_filter( 'get_custom_logo', array( $this, 'astra_mobile_header_custom_logo' ), 10, 2 ); - add_filter( 'astra_is_logo_attachment', array( $this, 'add_mobile_logo_svg_class' ), 10, 2 ); - } - } - - /** - * Replace logo with Mobile Header logo. - * - * @param sting $html Size name. - * @param int $blog_id Icon. - * @since 1.4.0 - * @return string html markup of logo. - */ - public function astra_mobile_header_custom_logo( $html, $blog_id ) { - - $mobile_header_logo = astra_get_option( 'mobile-header-logo' ); - - $custom_logo_id = attachment_url_to_postid( $mobile_header_logo ); - - $size = 'ast-mobile-header-logo-size'; - - if ( is_customize_preview() ) { - $size = 'full'; - } - - $logo = sprintf( - '', - esc_url( home_url( '/' ) ), - wp_get_attachment_image( - $custom_logo_id, - $size, - false, - array( - 'class' => 'ast-mobile-header-logo', - ) - ) - ); - - return $html . $logo; - - } - - /** - * Add svg class to mobile logo. - * - * @param bool $is_logo_attachment is attachment is logo image?. - * @param array $attachment attachment data. - * @since 2.1.0 - * @return bool return if attachment is mobile logo image. - */ - public function add_mobile_logo_svg_class( $is_logo_attachment, $attachment ) { - - $mobile_header_logo = astra_get_option( 'mobile-header-logo' ); - $custom_logo_id = attachment_url_to_postid( $mobile_header_logo ); - - if ( $custom_logo_id === $attachment->ID ) { - return true; - } - - return $is_logo_attachment; - } - - /** - * Add Body Classes - * - * @param array $classes Body Class Array. - * @return array - */ - public function add_body_class( $classes ) { - - /** - * Add class for header width - */ - $header_content_layout = astra_get_option( 'different-mobile-logo' ); - - if ( '0' == $header_content_layout ) { - $classes[] = 'ast-mobile-inherit-site-logo'; - } - - return $classes; - } - - } - - /** - * Initialize class object with 'get_instance()' method - */ - Astra_Mobile_Header::get_instance(); - -endif; +theme_location ) && in_array( $args->theme_location, $menu_locations ) ) { + if ( isset( $item->classes ) && in_array( 'menu-item-has-children', $item->classes ) ) { + $item_output = $this->menu_arrow_button_markup( $item_output, $item ); + } + } + } else { + if ( isset( $item->post_parent ) && 0 === $item->post_parent ) { + $item_output = $this->menu_arrow_button_markup( $item_output, $item ); + } + } + + return $item_output; + } + + /** + * Get Menu Arrow Button Mark up + * + * @param string $item_output The menu item's starting HTML output. + * @param WP_Post $item Menu item data object. + * + * @since 1.7.2 + * @return string Menu item arrow button markup. + */ + public function menu_arrow_button_markup( $item_output, $item ) { + $item_output = apply_filters( 'astra_toggle_button_markup', $item_output, $item ); + $item_output .= ''; + + return $item_output; + } + + /** + * Header Cart Icon Class + * + * @param array $classes Default argument array. + * + * @since 1.4.0 + * @return array; + */ + public function menu_toggle_classes( $classes ) { + return ' ast-mobile-menu-buttons-' . astra_get_option( 'mobile-header-toggle-btn-style' ) . ' '; + } + + /** + * Mobile Header Markup + * + * @return void + */ + public function mobile_header_markup() { + $mobile_header_logo = astra_get_option( 'mobile-header-logo' ); + $different_logo = astra_get_option( 'different-mobile-logo' ); + + if ( '' !== $mobile_header_logo && '1' == $different_logo ) { + add_filter( 'astra_has_custom_logo', '__return_true' ); + add_filter( 'get_custom_logo', array( $this, 'astra_mobile_header_custom_logo' ), 10, 2 ); + add_filter( 'astra_is_logo_attachment', array( $this, 'add_mobile_logo_svg_class' ), 10, 2 ); + } + } + + /** + * Replace logo with Mobile Header logo. + * + * @param sting $html Size name. + * @param int $blog_id Icon. + * @since 1.4.0 + * @return string html markup of logo. + */ + public function astra_mobile_header_custom_logo( $html, $blog_id ) { + + $mobile_header_logo = astra_get_option( 'mobile-header-logo' ); + + $custom_logo_id = attachment_url_to_postid( $mobile_header_logo ); + + $size = 'ast-mobile-header-logo-size'; + + if ( is_customize_preview() ) { + $size = 'full'; + } + + $logo = sprintf( + '', + esc_url( home_url( '/' ) ), + wp_get_attachment_image( + $custom_logo_id, + $size, + false, + array( + 'class' => 'ast-mobile-header-logo', + ) + ) + ); + + return $html . $logo; + + } + + /** + * Add svg class to mobile logo. + * + * @param bool $is_logo_attachment is attachment is logo image?. + * @param array $attachment attachment data. + * @since 2.1.0 + * @return bool return if attachment is mobile logo image. + */ + public function add_mobile_logo_svg_class( $is_logo_attachment, $attachment ) { + + $mobile_header_logo = astra_get_option( 'mobile-header-logo' ); + $custom_logo_id = attachment_url_to_postid( $mobile_header_logo ); + + if ( $custom_logo_id === $attachment->ID ) { + return true; + } + + return $is_logo_attachment; + } + + /** + * Add Body Classes + * + * @param array $classes Body Class Array. + * @return array + */ + public function add_body_class( $classes ) { + + /** + * Add class for header width + */ + $header_content_layout = astra_get_option( 'different-mobile-logo' ); + + if ( '0' == $header_content_layout ) { + $classes[] = 'ast-mobile-inherit-site-logo'; + } + + return $classes; + } + + } + + /** + * Initialize class object with 'get_instance()' method + */ + Astra_Mobile_Header::get_instance(); + +endif; diff --git a/inc/compatibility/class-astra-amp.php b/inc/compatibility/class-astra-amp.php index f8c1468..d7f8539 100644 --- a/inc/compatibility/class-astra-amp.php +++ b/inc/compatibility/class-astra-amp.php @@ -1,1209 +1,1209 @@ - array( - 'display' => 'none', - ), - - '#ast-mobile-header' => array( - 'display' => 'block', - ), - - '.ast-amp.ast-main-header-nav-open .ast-mobile-header-content' => array( - 'display' => 'block', - ), - - '.ast-mobile-header-content .ast-main-header-bar-alignment.toggle-on .main-header-bar-navigation' => array( - 'display' => 'block', - ), - - '.ast-amp .ast-mobile-header-content .main-navigation ul .menu-item .menu-link' => array( - 'padding' => '0 20px', - 'display' => 'inline-block', - 'width' => '100%', - 'border' => '0', - 'border-bottom-width' => '1px', - 'border-style' => 'solid', - 'border-color' => '#eaeaea', - ), - - '.ast-amp .ast-mobile-header-content .toggled-on .main-header-bar-navigation' => array( - 'line-height' => '3', - 'display' => 'none', - ), - '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .sub-menu' => array( - 'line-height' => '3', - ), - '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children .sub-menu' => array( - 'display' => 'none', - ), - '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children .dropdown-open+ul.sub-menu' => array( - 'display' => 'block', - ), - '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle' => array( - 'display' => 'inline-block', - 'position' => 'absolute', - 'font-size' => 'inherit', - 'top' => '-1px', - 'right' => '20px', - 'cursor' => 'pointer', - 'webkit-font-smoothing' => 'antialiased', - 'moz-osx-font-smoothing' => 'grayscale', - 'padding' => '0 0.907em', - 'font-weight' => 'normal', - 'line-height' => 'inherit', - 'transition' => 'all 0.2s', - ), - '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .ast-submenu-expanded > .ast-menu-toggle::before' => array( - '-webkit-transform' => 'rotateX(180deg)', - 'transform' => 'rotateX(180deg)', - ), - '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .main-header-menu' => array( - 'border-top-width' => '1px', - 'border-style' => 'solid', - 'border-color' => '#eaeaea', - ), - '.ast-amp .ast-below-header-bar, .ast-amp .main-header-bar, .ast-amp .ast-above-header-bar' => array( - 'display' => 'grid', - ), - ); - if ( false === Astra_Icons::is_svg_icons() ) { - $css['.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before'] = array( - 'font-weight' => 'bold', - 'content' => '"\e900"', - 'font-family' => '"Astra"', - 'text-decoration' => 'inherit', - 'display' => 'inline-block', - ); - } - } else { - $css = array( - '.ast-mobile-menu-buttons' => array( - 'text-align' => 'right', - '-js-display' => 'flex', - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - '-webkit-box-pack' => 'end', - '-webkit-justify-content' => 'flex-end', - '-moz-box-pack' => 'end', - '-ms-flex-pack' => 'end', - 'justify-content' => 'flex-end', - '-webkit-align-self' => 'center', - '-ms-flex-item-align' => 'center', - 'align-self' => 'center', - ), - '.header-main-layout-1 .main-navigation' => array( - 'padding' => '0', - ), - ); - } - - $parse_css = $compiled_css . astra_parse_css( $css, '', astra_header_break_point() ); - - $css = array( - - '.site-header .main-header-bar-wrap .site-branding' => array( - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - '-webkit-box-flex' => '1', - '-webkit-flex' => '1', - '-moz-box-flex' => '1', - '-ms-flex' => '1', - 'flex' => '1', - '-webkit-align-self' => 'center', - '-ms-flex-item-align' => 'center', - 'align-self' => 'center', - ), - - '.ast-main-header-bar-alignment.toggle-on .main-header-bar-navigation' => array( - 'display' => 'block', - ), - - '.main-navigation' => array( - 'display' => 'block', - 'width' => '100%', - ), - - '.main-header-menu > .menu-item > .menu-link' => array( - 'padding' => '0 20px', - 'display' => 'inline-block', - 'width' => '100%', - 'border-bottom-width' => '1px', - 'border-style' => 'solid', - 'border-color' => '#eaeaea', - ), - - '.ast-main-header-bar-alignment.toggle-on' => array( - 'display' => 'block', - 'width' => '100%', - '-webkit-box-flex' => '1', - '-webkit-flex' => 'auto', - '-moz-box-flex' => '1', - '-ms-flex' => 'auto', - 'flex' => 'auto', - '-webkit-box-ordinal-group' => '5', - '-webkit-order' => '4', - '-moz-box-ordinal-group' => '5', - '-ms-flex-order' => '4', - 'order' => '4', - ), - - '.main-header-menu .menu-item' => array( - 'width' => '100%', - 'text-align' => 'left', - 'border-top' => '0', - ), - - '.main-header-bar-navigation' => array( - 'width' => '-webkit-calc( 100% + 40px)', - 'width' => 'calc( 100% + 40px)', - 'margin' => '0 -20px', - ), - - '.main-header-bar .main-header-bar-navigation .main-header-menu' => array( - 'border-top-width' => '1px', - 'border-style' => 'solid', - 'border-color' => '#eaeaea', - ), - - '.main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle' => array( - 'display' => 'inline-block', - 'position' => 'absolute', - 'font-size' => 'inherit', - 'top' => '-1px', - 'right' => '20px', - 'cursor' => 'pointer', - '-webkit-font-smoothing' => 'antialiased', - '-moz-osx-font-smoothing' => 'grayscale', - 'padding' => '0 0.907em', - 'font-weight' => 'normal', - 'line-height' => 'inherit', - '-webkit-transition' => 'all .2s', - 'transition' => 'all .2s', - ), - ); - - if ( false === Astra_Icons::is_svg_icons() ) { - $css['.main-header-bar-navigation .menu-item-has-children > .menu-link:after'] = array( - 'content' => 'none', - ); - $css['.ast-button-wrap .menu-toggle.toggled .menu-toggle-icon:before'] = array( - 'content' => "\e5cd", - ); - $css['.main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before'] = array( - 'font-weight' => 'bold', - 'content' => '"\e900"', - 'font-family' => 'Astra', - 'text-decoration' => 'inherit', - 'display' => 'inline-block', - ); - } - - $parse_css .= astra_parse_css( $css, '', astra_header_break_point() ); - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - $astra_break_point_navigation = array( - '.ast-amp .main-header-bar-navigation' => array( - 'margin' => '0', - ), - ); - - } else { - $astra_break_point_navigation = array( - '.ast-amp .main-header-bar-navigation' => array( - 'margin' => '0 -20px', - ), - '.ast-amp .ast-mobile-menu-buttons' => array( - 'text-align' => 'right', - '-js-display' => 'flex', - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - '-webkit-box-pack' => 'end', - '-webkit-justify-content' => 'flex-end', - '-moz-box-pack' => 'end', - '-ms-flex-pack' => 'end', - 'justify-content' => 'flex-end', - '-webkit-align-self' => 'center', - '-ms-flex-item-align' => 'center', - 'align-self' => 'center', - ), - '.ast-theme.ast-header-custom-item-outside .main-header-bar .ast-search-icon' => array( - 'margin-right' => '1em', - ), - '.ast-theme.ast-header-custom-item-inside .main-header-bar .main-header-bar-navigation .ast-search-icon' => array( - 'display' => 'none', - ), - '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-field, .ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon.ast-inline-search .search-field' => array( - 'width' => '100%', - 'padding-right' => '5.5em', - ), - '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-submit' => array( - 'display' => 'block', - 'position' => 'absolute', - 'height' => '100%', - 'top' => '0', - 'right' => '0', - 'padding' => '0 1em', - 'border-radius' => '0', - ), - '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-form' => array( - 'padding' => '0', - 'display' => 'block', - 'overflow' => 'hidden', - ), - '.ast-amp .ast-header-custom-item' => array( - 'background-color' => '#f9f9f9', - ), - '.ast-amp .ast-mobile-header-stack .site-description' => array( - 'text-align' => 'center', - ), - '.ast-amp .ast-mobile-header-stack.ast-logo-title-inline .site-description' => array( - 'text-align' => 'left', - ), - '.ast-theme.ast-header-custom-item-outside .ast-primary-menu-disabled .ast-mobile-menu-buttons' => array( - 'display' => 'none', - ), - '.ast-amp .ast-hide-custom-menu-mobile .ast-masthead-custom-menu-items' => array( - 'display' => 'none', - ), - '.ast-amp .ast-mobile-header-inline .site-branding' => array( - 'text-align' => 'left', - 'padding-bottom' => '0', - ), - '.ast-amp .ast-mobile-header-inline.header-main-layout-3 .site-branding' => array( - 'text-align' => 'right', - ), - '.ast-amp ul li.ast-masthead-custom-menu-items a' => array( - 'padding' => '0', - 'width' => 'auto', - 'display' => 'initial', - ), - '.ast-amp li.ast-masthead-custom-menu-items' => array( - 'padding-left' => '20px', - 'padding-right' => '20px', - 'margin-bottom' => '1em', - 'margin-top' => '1em', - ), - '.ast-theme.ast-header-custom-item-inside .ast-search-menu-icon' => array( - 'position' => 'relative', - 'display' => 'block', - 'right' => 'auto', - 'visibility' => 'visible', - 'opacity' => '1', - '-webkit-transform' => 'none', - '-ms-transform' => 'none', - 'transform' => 'none', - ), - '.ast-theme.ast-header-custom-item-outside .ast-mobile-menu-buttons' => array( - '-webkit-box-ordinal-group' => '3', - '-webkit-order' => '2', - '-moz-box-ordinal-group' => '3', - '-ms-flex-order' => '2', - 'order' => '2', - ), - '.ast-theme.ast-header-custom-item-outside .main-header-bar-navigation' => array( - '-webkit-box-ordinal-group' => '4', - '-webkit-order' => '3', - '-moz-box-ordinal-group' => '4', - '-ms-flex-order' => '3', - 'order' => '3', - ), - '.ast-theme.ast-header-custom-item-outside .ast-masthead-custom-menu-items' => array( - '-webkit-box-ordinal-group' => '2', - '-webkit-order' => '1', - '-moz-box-ordinal-group' => '2', - '-ms-flex-order' => '1', - 'order' => '1', - ), - '.ast-theme.ast-header-custom-item-outside .header-main-layout-2 .ast-masthead-custom-menu-items' => array( - 'text-align' => 'center', - ), - '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .site-branding, .ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .ast-mobile-menu-buttons' => array( - '-js-display' => 'flex', - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - ), - '.ast-theme.ast-header-custom-item-outside.ast-header-custom-item-outside .header-main-layout-2 .ast-mobile-menu-buttons' => array( - 'padding-bottom' => '0', - ), - '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .ast-site-identity' => array( - 'width' => '100%', - ), - '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline.header-main-layout-3 .ast-site-identity' => array( - 'width' => 'auto', - ), - '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline.header-main-layout-2 .site-branding' => array( - '-webkit-box-flex' => '1', - '-webkit-flex' => '1 1 auto', - '-moz-box-flex' => '1', - '-ms-flex' => '1 1 auto', - 'flex' => '1 1 auto', - ), - '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .site-branding' => array( - 'text-align' => 'left', - ), - '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .site-title' => array( - '-webkit-box-pack' => 'left', - '-webkit-justify-content' => 'left', - '-moz-box-pack' => 'left', - '-ms-flex-pack' => 'left', - 'justify-content' => 'left', - ), - '.ast-theme.ast-header-custom-item-outside .header-main-layout-2 .ast-mobile-menu-buttons' => array( - 'padding-bottom' => '1em', - ), - '.ast-amp .ast-mobile-header-stack .main-header-container, .ast-amp .ast-mobile-header-inline .main-header-container' => array( - '-js-display' => 'flex', - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - ), - '.ast-amp .header-main-layout-1 .site-branding' => array( - 'padding-right' => '1em', - ), - '.ast-amp .header-main-layout-1 .main-header-bar-navigation' => array( - 'text-align' => 'left', - ), - '.ast-amp .header-main-layout-1 .main-navigation' => array( - 'padding-left' => '0', - ), - '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items' => array( - '-webkit-box-flex' => '1', - '-webkit-flex' => '1 1 100%', - '-moz-box-flex' => '1', - '-ms-flex' => '1 1 100%', - 'flex' => '1 1 100%', - ), - '.ast-amp .ast-mobile-header-stack .site-branding' => array( - 'padding-left' => '0', - 'padding-right' => '0', - 'padding-bottom' => '1em', - '-webkit-box-flex' => '1', - '-webkit-flex' => '1 1 100%', - '-moz-box-flex' => '1', - '-ms-flex' => '1 1 100%', - 'flex' => '1 1 100%', - ), - '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items, .ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .site-title, .ast-amp .ast-mobile-header-stack .ast-site-identity' => array( - '-webkit-box-pack' => 'center', - '-webkit-justify-content' => 'center', - '-moz-box-pack' => 'center', - '-ms-flex-pack' => 'center', - 'justify-content' => 'center', - 'text-align' => 'center', - ), - '.ast-amp .ast-mobile-header-stack.ast-logo-title-inline .site-title' => array( - 'text-align' => 'left', - ), - '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( - '-webkit-box-flex' => '1', - '-webkit-flex' => '1 1 100%', - '-moz-box-flex' => '1', - '-ms-flex' => '1 1 100%', - 'flex' => '1 1 100%', - 'text-align' => 'center', - '-webkit-box-pack' => 'center', - '-webkit-justify-content' => 'center', - '-moz-box-pack' => 'center', - '-ms-flex-pack' => 'center', - 'justify-content' => 'center', - ), - '.ast-amp .ast-mobile-header-stack.header-main-layout-3 .main-header-container' => array( - 'flex-direction' => 'initial', - ), - '.ast-amp .header-main-layout-2 .ast-mobile-menu-buttons' => array( - '-js-display' => 'flex', - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - '-webkit-box-pack' => 'center', - '-webkit-justify-content' => 'center', - '-moz-box-pack' => 'center', - '-ms-flex-pack' => 'center', - 'justify-content' => 'center', - ), - '.ast-amp .header-main-layout-2 .main-header-bar-navigation, .ast-amp .header-main-layout-2 .widget' => array( - 'text-align' => 'left', - ), - '.ast-theme.ast-header-custom-item-outside .header-main-layout-3 .main-header-bar .ast-search-icon' => array( - 'margin-right' => 'auto', - 'margin-left' => '1em', - ), - '.ast-amp .header-main-layout-3 .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array( - 'right' => 'auto', - 'left' => '0', - ), - '.ast-amp .header-main-layout-3.ast-mobile-header-inline .ast-mobile-menu-buttons' => array( - '-webkit-box-pack' => 'start', - '-webkit-justify-content' => 'flex-start', - '-moz-box-pack' => 'start', - '-ms-flex-pack' => 'start', - 'justify-content' => 'flex-start', - ), - '.ast-amp .header-main-layout-3 li .ast-search-menu-icon' => array( - 'left' => '0', - ), - '.ast-amp .header-main-layout-3 .site-branding' => array( - 'padding-left' => '1em', - '-webkit-box-pack' => 'end', - '-webkit-justify-content' => 'flex-end', - '-moz-box-pack' => 'end', - '-ms-flex-pack' => 'end', - 'justify-content' => 'flex-end', - ), - '.ast-amp .header-main-layout-3 .main-navigation' => array( - 'padding-right' => '0', - ), - '.ast-amp .header-main-layout-1 .site-branding' => array( - 'padding-right' => '1em', - ), - '.ast-amp .header-main-layout-1 .main-header-bar-navigation' => array( - 'text-align' => 'left', - ), - '.ast-amp .header-main-layout-1 .main-navigation' => array( - 'padding-left' => '0', - ), - '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items' => array( - '-webkit-box-flex' => '1', - '-webkit-flex' => '1 1 100%', - '-moz-box-flex' => '1', - '-ms-flex' => '1 1 100%', - 'flex' => '1 1 100%', - ), - '.ast-amp .ast-mobile-header-stack .site-branding' => array( - 'padding-left' => '0', - 'padding-right' => '0', - 'padding-bottom' => '1em', - '-webkit-box-flex' => '1', - '-webkit-flex' => '1 1 100%', - '-moz-box-flex' => '1', - '-ms-flex' => '1 1 100%', - 'flex' => '1 1 100%', - ), - '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items, .ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .site-title, .ast-amp .ast-mobile-header-stack .ast-site-identity' => array( - '-webkit-box-pack' => 'center', - '-webkit-justify-content' => 'center', - '-moz-box-pack' => 'center', - '-ms-flex-pack' => 'center', - 'justify-content' => 'center', - 'text-align' => 'center', - ), - '.ast-amp .ast-mobile-header-stack.ast-logo-title-inline .site-title' => array( - 'text-align' => 'left', - ), - '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( - 'flex' => '1 1 100%', - 'text-align' => 'center', - '-webkit-box-pack' => 'center', - '-webkit-justify-content' => 'center', - '-moz-box-pack' => 'center', - '-ms-flex-pack' => 'center', - 'justify-content' => 'center', - ), - '.ast-amp .ast-mobile-header-stack.header-main-layout-3 .main-header-container' => array( - 'flex-direction' => 'initial', - ), - '.ast-amp .header-main-layout-2 .ast-mobile-menu-buttons' => array( - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - '-webkit-box-pack' => 'center', - '-webkit-justify-content' => 'center', - '-moz-box-pack' => 'center', - '-ms-flex-pack' => 'center', - 'justify-content' => 'center', - ), - '.ast-amp .header-main-layout-2 .main-header-bar-navigation, .ast-amp .header-main-layout-2 .widget' => array( - 'text-align' => 'left', - ), - '.ast-theme.ast-header-custom-item-outside .header-main-layout-3 .main-header-bar .ast-search-icon' => array( - 'margin-right' => 'auto', - 'margin-left' => '1em', - ), - '.ast-amp .header-main-layout-3 .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array( - 'right' => 'auto', - 'left' => '0', - ), - '.ast-amp .header-main-layout-3.ast-mobile-header-inline .ast-mobile-menu-buttons' => array( - '-webkit-box-pack' => 'start', - '-webkit-justify-content' => 'flex-start', - '-moz-box-pack' => 'start', - '-ms-flex-pack' => 'start', - 'justify-content' => 'flex-start', - ), - '.ast-amp .header-main-layout-3 li .ast-search-menu-icon' => array( - 'left' => '0', - ), - '.ast-amp .header-main-layout-3 .site-branding' => array( - 'padding-left' => '1em', - '-webkit-box-pack' => 'end', - '-webkit-justify-content' => 'flex-end', - '-moz-box-pack' => 'end', - '-ms-flex-pack' => 'end', - 'justify-content' => 'flex-end', - ), - '.ast-amp .header-main-layout-3 .main-navigation' => array( - 'padding-right' => '0', - ), - '.ast-amp .ast-header-custom-item' => array( - 'border-top' => '1px solid #eaeaea', - ), - '.ast-amp .ast-header-custom-item .ast-masthead-custom-menu-items' => array( - 'padding-left' => '20px', - 'padding-right' => '20px', - 'margin-bottom' => '1em', - 'margin-top' => '1em', - ), - '.ast-amp .ast-header-custom-item .widget:last-child' => array( - 'margin-bottom' => '1em', - ), - '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item .menu-link' => array( - 'display' => 'block', - ), - '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item' => array( - 'padding-left' => '0', - 'padding-right' => '0', - 'margin-top' => '0', - 'margin-bottom' => '0', - ), - '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item .ast-custom-button-link' => array( - 'display' => 'none', - ), - '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item .menu-link' => array( - 'display' => 'block', - ), - '.ast-amp .woocommerce-custom-menu-item .ast-cart-menu-wrap' => array( - 'width' => '2em', - 'height' => '2em', - 'font-size' => '1.4em', - 'line-height' => '2', - 'vertical-align' => 'middle', - 'text-align' => 'right', - ), - '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-3 .ast-site-header-cart' => array( - 'padding' => '0 0 1em 1em', - ), - '.ast-theme.ast-woocommerce-cart-menu.ast-header-custom-item-outside .ast-site-header-cart' => array( - 'padding' => '0', - ), - '.ast-amp .ast-masthead-custom-menu-items.woocommerce-custom-menu-item' => array( - 'margin-bottom' => '0', - 'margin-top' => '0', - ), - '.ast-amp .ast-masthead-custom-menu-items.woocommerce-custom-menu-item .ast-site-header-cart' => array( - 'padding' => '0', - ), - '.ast-amp .ast-masthead-custom-menu-items.woocommerce-custom-menu-item .ast-site-header-cart a' => array( - 'border' => 'none', - 'display' => 'inline-block', - ), - '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-form' => array( - 'visibility' => 'visible', - 'opacity' => '1', - 'position' => 'relative', - 'right' => 'auto', - 'top' => 'auto', - 'transform' => 'none', - ), - '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-stack .main-header-bar .ast-search-icon' => array( - 'margin' => '0', - ), - '.ast-amp .ast-mobile-header-stack .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array( - 'right' => '-1em', - ), - '.ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( - '-webkit-box-pack' => 'center', - '-webkit-justify-content' => 'center', - '-moz-box-pack' => 'center', - '-ms-flex-pack' => 'center', - 'justify-content' => 'center', - 'text-align' => 'center', - 'padding-bottom' => '0', - ), - '.ast-safari-browser-less-than-11.ast-woocommerce-cart-menu.ast-header-break-point .header-main-layout-2 .main-header-container' => array( - 'display' => 'flex', - ), - ); - - // Tablet CSS. - $astra_medium_break_point_navigation = array( - '.ast-amp .footer-sml-layout-2 .ast-small-footer-section-2' => array( - 'margin-top' => '1em', - ), - ); - - $parse_css .= astra_parse_css( $astra_medium_break_point_navigation, astra_get_tablet_breakpoint() ); - - // Mobile CSS. - $astra_small_break_point_navigation = array( - '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart' => array( - 'padding-right' => '0', - 'padding-left' => '0', - ), - '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .main-header-bar, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .main-header-bar' => array( - 'text-align' => 'center', - ), - '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-site-header-cart, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .ast-site-header-cart' => array( - 'display' => 'inline-block', - ), - '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-mobile-menu-buttons, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .ast-mobile-menu-buttons' => array( - 'display' => 'inline-block', - ), - '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-2.ast-mobile-header-inline .site-branding' => array( - 'flex' => 'auto', - ), - '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .site-branding' => array( - 'flex' => '0 0 100%', - ), - '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .main-header-container' => array( - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - '-webkit-box-pack' => 'center', - '-webkit-justify-content' => 'center', - '-moz-box-pack' => 'center', - '-ms-flex-pack' => 'center', - 'justify-content' => 'center', - ), - '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( - 'width' => '100%', - ), - '.ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( - '-webkit-box-pack' => 'center', - '-webkit-justify-content' => 'center', - '-moz-box-pack' => 'center', - '-ms-flex-pack' => 'center', - 'justify-content' => 'center', - ), - '.ast-amp .ast-mobile-header-stack .main-header-bar-wrap .site-branding' => array( - '-webkit-box-flex' => '1', - '-webkit-flex' => '1 1 auto', - '-moz-box-flex' => '1', - '-ms-flex' => '1 1 auto', - '-webkit-box-flex' => '1', - '-webkit-flex' => '1 1 auto', - '-moz-box-flex' => '1', - '-ms-flex' => '1 1 auto', - 'flex' => '1 1 auto', - ), - '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( - 'padding-top' => '0.8em', - ), - '.ast-amp .ast-mobile-header-stack.header-main-layout-2 .ast-mobile-menu-buttons' => array( - 'padding-top' => '0.8em', - ), - '.ast-amp .ast-mobile-header-stack.header-main-layout-1 .site-branding' => array( - 'padding-bottom' => '0', - ), - '.ast-header-custom-item-outside.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items' => array( - 'padding' => '0.8em 1em 0 1em', - 'text-align' => 'center', - 'width' => '100%', - ), - '.ast-header-custom-item-outside.ast-amp .ast-mobile-header-stack.header-main-layout-3 .ast-mobile-menu-buttons, .ast-header-custom-item-outside.ast-amp .ast-mobile-header-stack.header-main-layout-3 .ast-masthead-custom-menu-items' => array( - 'padding-top' => '0.8em', - ), - // Tablet CSS. - '.ast-amp .footer-sml-layout-2 .ast-small-footer-section-2' => array( - 'margin-top' => '1em', - ), - ); - - $parse_css .= astra_parse_css( $astra_small_break_point_navigation, astra_get_mobile_breakpoint() ); - } - - $parse_css .= astra_parse_css( $astra_break_point_navigation, '', astra_header_break_point() ); - - // Move all header-break-point css from class based css to media query based CSS. - $astra_break_point_navigation = array( - - '.ast-amp .entry-content .alignwide' => array( - 'margin-left' => 'auto', - 'margin-right' => 'auto', - ), - '.ast-amp .main-navigation' => array( - 'padding-left' => '0', - ), - '.ast-amp .main-navigation ul .menu-item .menu-link, .ast-amp .main-navigation ul .button-custom-menu-item a' => array( - 'padding' => '0 20px', - 'display' => 'inline-block', - 'width' => '100%', - 'border-bottom-width' => '1px', - 'border-style' => 'solid', - 'border-color' => '#eaeaea', - ), - '.ast-amp .main-navigation .sub-menu .menu-item .menu-link' => array( - 'padding-left' => '30px', - ), - '.ast-amp .main-navigation .sub-menu .menu-item .menu-item .menu-link' => array( - 'padding-left' => '40px', - ), - '.ast-amp .main-navigation .sub-menu .menu-item .menu-item .menu-item .menu-link' => array(), - '.ast-amp .main-navigation .sub-menu .menu-item .menu-item .menu-item .menu-item .menu-link' => array( - 'padding-left' => '60px', - ), - '.ast-amp .main-header-menu' => array( - 'background-color' => '#f9f9f9', - ), - '.ast-amp .main-header-menu ul' => array( - 'background-color' => '#f9f9f9', - 'position' => 'static', - 'opacity' => '1', - 'visibility' => 'visible', - 'border' => '0', - 'width' => 'auto', - ), - '.ast-amp .main-header-menu ul li.ast-left-align-sub-menu:hover > ul, .ast-amp .main-header-menu ul li.ast-left-align-sub-menu.focus > ul' => array( - 'left' => '0', - ), - '.ast-amp .main-header-menu li.ast-sub-menu-goes-outside:hover > ul, .ast-amp .main-header-menu li.ast-sub-menu-goes-outside.focus > ul' => array( - 'left' => '0', - ), - '.ast-amp .submenu-with-border .sub-menu' => array( - 'border' => '0', - ), - '.ast-amp .user-select' => array( - 'clear' => 'both', - ), - '.ast-amp .ast-mobile-menu-buttons' => array( - 'display' => 'block', - '-webkit-align-self' => 'center', - '-ms-flex-item-align' => 'center', - 'align-self' => 'center', - ), - '.ast-amp .main-header-bar-navigation' => array( - '-webkit-box-flex' => '1', - '-webkit-flex' => 'auto', - '-moz-box-flex' => '1', - '-ms-flex' => 'auto', - 'flex' => 'auto', - 'width' => '-webkit-calc( 100% + 40px)', - 'width' => 'calc(100% + 40px )', - ), - '.ast-amp .ast-main-header-bar-alignment' => array( - 'display' => 'block', - 'width' => '100%', - '-webkit-box-flex' => '1', - '-webkit-flex' => 'auto', - '-moz-box-flex' => '1', - '-ms-flex' => 'auto', - 'flex' => 'auto', - '-webkit-box-ordinal-group' => '5', - '-webkit-order' => '4', - '-moz-box-ordinal-group' => '5', - '-ms-flex-order' => '4', - 'order' => '4', - ), - '.ast-amp .ast-mobile-menu-buttons' => array( - 'text-align' => 'right', - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - '-webkit-box-pack' => 'end', - '-webkit-justify-content' => 'flex-end', - '-moz-box-pack' => 'end', - '-ms-flex-pack' => 'end', - 'justify-content' => 'flex-end', - ), - '.ast-amp .site-header .main-header-bar-wrap .site-branding' => array( - '-js-display' => 'flex', - 'display' => '-webkit-box', - 'display' => '-webkit-flex', - 'display' => '-moz-box', - 'display' => '-ms-flexbox', - 'display' => 'flex', - '-webkit-box-flex' => '1', - '-webkit-flex' => '1', - '-moz-box-flex' => '1', - '-ms-flex' => '1', - 'flex' => '1', - '-webkit-align-self' => 'center', - '-ms-flex-item-align' => 'center', - 'align-self' => 'center', - ), - '.ast-amp .ast-site-identity' => array( - 'width' => '100%', - ), - '.ast-amp .main-header-bar-navigation .menu-item-has-children > .menu-link .sub-arrow:after' => array( - 'display' => 'none', - ), - '.ast-amp .main-header-bar' => array( - 'display' => 'block', - 'line-height' => '3', - ), - '.ast-main-header-bar-alignment .main-header-bar-navigation' => array( - 'line-height' => '3', - 'display' => 'none', - ), - '.ast-amp .main-header-bar .toggled-on .main-header-bar-navigation' => array( - 'line-height' => '3', - 'display' => 'none', - ), - '.ast-amp .main-header-bar .main-header-bar-navigation .sub-menu' => array( - 'line-height' => '3', - ), - '.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children .sub-menu' => array( - 'display' => 'none', - ), - '.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children .dropdown-open+ul.sub-menu' => array( - 'display' => 'block', - ), - '.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle' => array( - 'display' => 'inline-block', - 'position' => 'absolute', - 'font-size' => 'inherit', - 'top' => '-1px', - 'right' => '20px', - 'cursor' => 'pointer', - 'webkit-font-smoothing' => 'antialiased', - 'moz-osx-font-smoothing' => 'grayscale', - 'padding' => '0 0.907em', - 'font-weight' => 'normal', - 'line-height' => 'inherit', - 'transition' => 'all 0.2s', - ), - '.ast-amp .main-header-bar .main-header-bar-navigation .ast-submenu-expanded > .ast-menu-toggle::before' => array( - '-webkit-transform' => 'rotateX(180deg)', - 'transform' => 'rotateX(180deg)', - ), - '.ast-amp .main-header-bar .main-header-bar-navigation .main-header-menu' => array( - 'border-top-width' => '1px', - 'border-style' => 'solid', - 'border-color' => '#eaeaea', - ), - '.ast-amp .main-navigation' => array( - 'display' => 'block', - 'width' => '100%', - ), - '.ast-amp .main-navigation ul > li:first-child' => array( - 'border-top' => '0', - ), - '.ast-amp .main-navigation ul ul' => array( - 'left' => 'auto', - 'right' => 'auto', - ), - '.ast-amp .main-navigation li' => array( - 'width' => '100%', - ), - '.ast-amp .main-navigation .widget' => array( - 'margin-bottom' => '1em', - ), - '.ast-amp .main-navigation .widget li' => array( - 'width' => 'auto', - ), - '.ast-amp .main-navigation .widget:last-child' => array( - 'margin-bottom' => '0', - ), - '.ast-amp .main-header-menu ul ul' => array( - 'top' => '0', - ), - '.ast-amp .ast-has-mobile-header-logo .custom-logo-link, .ast-amp .ast-has-mobile-header-logo .astra-logo-svg' => array( - 'display' => 'none', - ), - '.ast-amp .ast-has-mobile-header-logo .custom-mobile-logo-link' => array( - 'display' => 'inline-block', - ), - '.ast-theme.ast-mobile-inherit-site-logo .ast-has-mobile-header-logo .custom-logo-link, .ast-theme.ast-mobile-inherit-site-logo .ast-has-mobile-header-logo .astra-logo-svg' => array( - 'display' => 'block', - ), - '.ast-amp .ast-header-widget-area .widget' => array( - 'margin' => '0.5em 0', - 'display' => 'block', - ), - '.ast-amp .main-header-bar' => array( - 'border' => '0', - 'border-bottom-color' => '#eaeaea', - 'border-bottom-style' => 'solid', - ), - '.ast-amp .nav-fallback-text' => array( - 'float' => 'none', - ), - '.ast-amp .main-header-menu .woocommerce-custom-menu-item .ast-cart-menu-wrap' => array( - 'height' => '3em', - 'line-height' => '3', - 'text-align' => 'left', - ), - '.ast-amp #ast-site-header-cart .widget_shopping_cart' => array( - 'display' => 'none', - ), - '.ast-theme.ast-woocommerce-cart-menu .ast-site-header-cart' => array( - 'order' => 'initial', - 'line-height' => '3', - 'padding' => '0 1em 1em 0', - ), - '.ast-amp .ast-edd-site-header-cart .widget_edd_cart_widget, .ast-amp .ast-edd-site-header-cart .ast-edd-header-cart-info-wrap' => array( - 'display' => 'none', - ), - '.ast-amp div.ast-masthead-custom-menu-items.edd-custom-menu-item' => array( - 'padding' => '0', - ), - '.ast-amp .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array( - 'right' => '0', - ), - '.ast-amp .main-header-menu .sub-menu' => array( - 'box-shadow' => 'none', - ), - '.ast-amp .submenu-with-border .sub-menu a' => array( - 'border-width' => '1px', - ), - '.ast-amp .submenu-with-border .sub-menu > li:last-child > a' => array( - 'border-width' => '1px', - ), - ); - - if ( false === Astra_Icons::is_svg_icons() ) { - $astra_break_point_navigation['.ast-amp .main-navigation ul.children li a:before, .ast-amp .main-navigation ul.sub-menu li a:before'] = array( - 'content' => '"\e900"', - 'font-family' => '"Astra"', - 'font-size' => '0.65em', - 'text-decoration' => 'inherit', - 'display' => 'inline-block', - 'transform' => 'translate(0, -2px) rotateZ(270deg)', - 'margin-right' => '5px', - ); - $astra_break_point_navigation['.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before'] = array( - 'font-weight' => 'bold', - 'content' => '"\e900"', - 'font-family' => '"Astra"', - 'text-decoration' => 'inherit', - 'display' => 'inline-block', - ); - } else { - $astra_break_point_navigation['[data-section="section-header-mobile-trigger"] .ast-button-wrap .ast-mobile-menu-buttons-minimal'] = array( - 'background' => 'transparent', - 'border' => 'none', - ); - } - - $parse_css .= astra_parse_css( $astra_break_point_navigation, '', astra_header_break_point() ); - - return $parse_css; - } - - /** - * Add AMP attributes to the nav menu wrapper. - * - * @since 1.7.0 - * @param Array $attr HTML attributes to be added to the nav menu wrapper. - * - * @return Array updated HTML attributes. - */ - public function nav_menu_wrapper( $attr ) { - $attr['[class]'] = '( astraAmpMenuExpanded ? \'ast-main-header-bar-alignment toggle-on\' : \'ast-main-header-bar-alignment\' )'; - $attr['aria-expanded'] = 'false'; - $attr['[aria-expanded]'] = '(astraAmpMenuExpanded ? \'true\' : \'false\')'; - - return $attr; - } - - /** - * Set AMP State for eeach sub menu toggle. - * - * @since 1.7.0 - * @param String $item_output HTML markup for the menu item. - * @param WP_Post $item Post object for the navigation menu. - * - * @return String HTML MArkup for the menu including the AML State. - */ - public function toggle_button_markup( $item_output, $item ) { - $item_output .= ''; - - return $item_output; - } - - /** - * Add AMP attribites to the toggle button to add `.ast-submenu-expanded` class to parent li. - * - * @since 1.7.0 - * @param array $attr Optional. Extra attributes to merge with defaults. - * @param string $context The context, to build filter name. - * @param array $args Optional. Custom data to pass to filter. - * - * @return Array updated HTML attributes. - */ - public function menu_toggle_button( $attr, $context, $args ) { - $attr['[class]'] = '( astraNavMenuItemExpanded' . $args->ID . ' ? \' ast-menu-toggle dropdown-open\' : \'ast-menu-toggle\')'; - $attr['on'] = 'tap:AMP.setState( { astraNavMenuItemExpanded' . $args->ID . ': ! astraNavMenuItemExpanded' . $args->ID . ' } )'; - - return $attr; - } - - /** - * Add amp states to the dom. - */ - public function render_amp_states() { - echo ''; - echo ''; - echo ''; - } - - /** - * Add search slide data attributes. - * - * @param string $input the data attrs already existing in the nav. - * - * @return string - */ - public function add_search_slide_toggle_attrs( $input ) { - $input .= ' on="tap:AMP.setState( { astraAmpSlideSearchMenuExpanded: ! astraAmpSlideSearchMenuExpanded } )" '; - $input .= ' [class]="( astraAmpSlideSearchMenuExpanded ? \'ast-search-menu-icon slide-search ast-dropdown-active\' : \'ast-search-menu-icon slide-search\' )" '; - $input .= ' aria-expanded="false" [aria-expanded]="astraAmpSlideSearchMenuExpanded ? \'true\' : \'false\'" '; - - return $input; - } - - /** - * Add search slide data attributes. - * - * @param string $input the data attrs already existing in the nav. - * - * @return string - */ - public function add_search_field_toggle_attrs( $input ) { - $input .= ' on="tap:AMP.setState( { astraAmpSlideSearchMenuExpanded: astraAmpSlideSearchMenuExpanded } )" '; - - return $input; - } - - /** - * Add the nav toggle data attributes. - * - * @param string $input the data attrs already existing in nav toggle. - * - * @return string - */ - public function add_nav_toggle_attrs( $input ) { - $input .= ' on="tap:AMP.setState( { astraAmpMenuExpanded: ! astraAmpMenuExpanded } ),astra-body.toggleClass(class=ast-main-header-nav-open)" '; - $input .= ' [class]="\'menu-toggle main-header-menu-toggle ast-mobile-menu-buttons-minimal\' + ( astraAmpMenuExpanded ? \' toggled\' : \'\' )" '; - $input .= ' aria-expanded="false" '; - $input .= ' [aria-expanded]="astraAmpMenuExpanded ? \'true\' : \'false\'" '; - - return $input; - } - - } -endif; - -/** -* Kicking this off by calling 'get_instance()' method -*/ -Astra_AMP::get_instance(); + array( + 'display' => 'none', + ), + + '#ast-mobile-header' => array( + 'display' => 'block', + ), + + '.ast-amp.ast-main-header-nav-open .ast-mobile-header-content' => array( + 'display' => 'block', + ), + + '.ast-mobile-header-content .ast-main-header-bar-alignment.toggle-on .main-header-bar-navigation' => array( + 'display' => 'block', + ), + + '.ast-amp .ast-mobile-header-content .main-navigation ul .menu-item .menu-link' => array( + 'padding' => '0 20px', + 'display' => 'inline-block', + 'width' => '100%', + 'border' => '0', + 'border-bottom-width' => '1px', + 'border-style' => 'solid', + 'border-color' => '#eaeaea', + ), + + '.ast-amp .ast-mobile-header-content .toggled-on .main-header-bar-navigation' => array( + 'line-height' => '3', + 'display' => 'none', + ), + '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .sub-menu' => array( + 'line-height' => '3', + ), + '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children .sub-menu' => array( + 'display' => 'none', + ), + '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children .dropdown-open+ul.sub-menu' => array( + 'display' => 'block', + ), + '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle' => array( + 'display' => 'inline-block', + 'position' => 'absolute', + 'font-size' => 'inherit', + 'top' => '-1px', + 'right' => '20px', + 'cursor' => 'pointer', + 'webkit-font-smoothing' => 'antialiased', + 'moz-osx-font-smoothing' => 'grayscale', + 'padding' => '0 0.907em', + 'font-weight' => 'normal', + 'line-height' => 'inherit', + 'transition' => 'all 0.2s', + ), + '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .ast-submenu-expanded > .ast-menu-toggle::before' => array( + '-webkit-transform' => 'rotateX(180deg)', + 'transform' => 'rotateX(180deg)', + ), + '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .main-header-menu' => array( + 'border-top-width' => '1px', + 'border-style' => 'solid', + 'border-color' => '#eaeaea', + ), + '.ast-amp .ast-below-header-bar, .ast-amp .main-header-bar, .ast-amp .ast-above-header-bar' => array( + 'display' => 'grid', + ), + ); + if ( false === Astra_Icons::is_svg_icons() ) { + $css['.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before'] = array( + 'font-weight' => 'bold', + 'content' => '"\e900"', + 'font-family' => '"Astra"', + 'text-decoration' => 'inherit', + 'display' => 'inline-block', + ); + } + } else { + $css = array( + '.ast-mobile-menu-buttons' => array( + 'text-align' => 'right', + '-js-display' => 'flex', + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + '-webkit-box-pack' => 'end', + '-webkit-justify-content' => 'flex-end', + '-moz-box-pack' => 'end', + '-ms-flex-pack' => 'end', + 'justify-content' => 'flex-end', + '-webkit-align-self' => 'center', + '-ms-flex-item-align' => 'center', + 'align-self' => 'center', + ), + '.header-main-layout-1 .main-navigation' => array( + 'padding' => '0', + ), + ); + } + + $parse_css = $compiled_css . astra_parse_css( $css, '', astra_header_break_point() ); + + $css = array( + + '.site-header .main-header-bar-wrap .site-branding' => array( + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + '-webkit-box-flex' => '1', + '-webkit-flex' => '1', + '-moz-box-flex' => '1', + '-ms-flex' => '1', + 'flex' => '1', + '-webkit-align-self' => 'center', + '-ms-flex-item-align' => 'center', + 'align-self' => 'center', + ), + + '.ast-main-header-bar-alignment.toggle-on .main-header-bar-navigation' => array( + 'display' => 'block', + ), + + '.main-navigation' => array( + 'display' => 'block', + 'width' => '100%', + ), + + '.main-header-menu > .menu-item > .menu-link' => array( + 'padding' => '0 20px', + 'display' => 'inline-block', + 'width' => '100%', + 'border-bottom-width' => '1px', + 'border-style' => 'solid', + 'border-color' => '#eaeaea', + ), + + '.ast-main-header-bar-alignment.toggle-on' => array( + 'display' => 'block', + 'width' => '100%', + '-webkit-box-flex' => '1', + '-webkit-flex' => 'auto', + '-moz-box-flex' => '1', + '-ms-flex' => 'auto', + 'flex' => 'auto', + '-webkit-box-ordinal-group' => '5', + '-webkit-order' => '4', + '-moz-box-ordinal-group' => '5', + '-ms-flex-order' => '4', + 'order' => '4', + ), + + '.main-header-menu .menu-item' => array( + 'width' => '100%', + 'text-align' => 'left', + 'border-top' => '0', + ), + + '.main-header-bar-navigation' => array( + 'width' => '-webkit-calc( 100% + 40px)', + 'width' => 'calc( 100% + 40px)', + 'margin' => '0 -20px', + ), + + '.main-header-bar .main-header-bar-navigation .main-header-menu' => array( + 'border-top-width' => '1px', + 'border-style' => 'solid', + 'border-color' => '#eaeaea', + ), + + '.main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle' => array( + 'display' => 'inline-block', + 'position' => 'absolute', + 'font-size' => 'inherit', + 'top' => '-1px', + 'right' => '20px', + 'cursor' => 'pointer', + '-webkit-font-smoothing' => 'antialiased', + '-moz-osx-font-smoothing' => 'grayscale', + 'padding' => '0 0.907em', + 'font-weight' => 'normal', + 'line-height' => 'inherit', + '-webkit-transition' => 'all .2s', + 'transition' => 'all .2s', + ), + ); + + if ( false === Astra_Icons::is_svg_icons() ) { + $css['.main-header-bar-navigation .menu-item-has-children > .menu-link:after'] = array( + 'content' => 'none', + ); + $css['.ast-button-wrap .menu-toggle.toggled .menu-toggle-icon:before'] = array( + 'content' => "\e5cd", + ); + $css['.main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before'] = array( + 'font-weight' => 'bold', + 'content' => '"\e900"', + 'font-family' => 'Astra', + 'text-decoration' => 'inherit', + 'display' => 'inline-block', + ); + } + + $parse_css .= astra_parse_css( $css, '', astra_header_break_point() ); + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + $astra_break_point_navigation = array( + '.ast-amp .main-header-bar-navigation' => array( + 'margin' => '0', + ), + ); + + } else { + $astra_break_point_navigation = array( + '.ast-amp .main-header-bar-navigation' => array( + 'margin' => '0 -20px', + ), + '.ast-amp .ast-mobile-menu-buttons' => array( + 'text-align' => 'right', + '-js-display' => 'flex', + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + '-webkit-box-pack' => 'end', + '-webkit-justify-content' => 'flex-end', + '-moz-box-pack' => 'end', + '-ms-flex-pack' => 'end', + 'justify-content' => 'flex-end', + '-webkit-align-self' => 'center', + '-ms-flex-item-align' => 'center', + 'align-self' => 'center', + ), + '.ast-theme.ast-header-custom-item-outside .main-header-bar .ast-search-icon' => array( + 'margin-right' => '1em', + ), + '.ast-theme.ast-header-custom-item-inside .main-header-bar .main-header-bar-navigation .ast-search-icon' => array( + 'display' => 'none', + ), + '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-field, .ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon.ast-inline-search .search-field' => array( + 'width' => '100%', + 'padding-right' => '5.5em', + ), + '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-submit' => array( + 'display' => 'block', + 'position' => 'absolute', + 'height' => '100%', + 'top' => '0', + 'right' => '0', + 'padding' => '0 1em', + 'border-radius' => '0', + ), + '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-form' => array( + 'padding' => '0', + 'display' => 'block', + 'overflow' => 'hidden', + ), + '.ast-amp .ast-header-custom-item' => array( + 'background-color' => '#f9f9f9', + ), + '.ast-amp .ast-mobile-header-stack .site-description' => array( + 'text-align' => 'center', + ), + '.ast-amp .ast-mobile-header-stack.ast-logo-title-inline .site-description' => array( + 'text-align' => 'left', + ), + '.ast-theme.ast-header-custom-item-outside .ast-primary-menu-disabled .ast-mobile-menu-buttons' => array( + 'display' => 'none', + ), + '.ast-amp .ast-hide-custom-menu-mobile .ast-masthead-custom-menu-items' => array( + 'display' => 'none', + ), + '.ast-amp .ast-mobile-header-inline .site-branding' => array( + 'text-align' => 'left', + 'padding-bottom' => '0', + ), + '.ast-amp .ast-mobile-header-inline.header-main-layout-3 .site-branding' => array( + 'text-align' => 'right', + ), + '.ast-amp ul li.ast-masthead-custom-menu-items a' => array( + 'padding' => '0', + 'width' => 'auto', + 'display' => 'initial', + ), + '.ast-amp li.ast-masthead-custom-menu-items' => array( + 'padding-left' => '20px', + 'padding-right' => '20px', + 'margin-bottom' => '1em', + 'margin-top' => '1em', + ), + '.ast-theme.ast-header-custom-item-inside .ast-search-menu-icon' => array( + 'position' => 'relative', + 'display' => 'block', + 'right' => 'auto', + 'visibility' => 'visible', + 'opacity' => '1', + '-webkit-transform' => 'none', + '-ms-transform' => 'none', + 'transform' => 'none', + ), + '.ast-theme.ast-header-custom-item-outside .ast-mobile-menu-buttons' => array( + '-webkit-box-ordinal-group' => '3', + '-webkit-order' => '2', + '-moz-box-ordinal-group' => '3', + '-ms-flex-order' => '2', + 'order' => '2', + ), + '.ast-theme.ast-header-custom-item-outside .main-header-bar-navigation' => array( + '-webkit-box-ordinal-group' => '4', + '-webkit-order' => '3', + '-moz-box-ordinal-group' => '4', + '-ms-flex-order' => '3', + 'order' => '3', + ), + '.ast-theme.ast-header-custom-item-outside .ast-masthead-custom-menu-items' => array( + '-webkit-box-ordinal-group' => '2', + '-webkit-order' => '1', + '-moz-box-ordinal-group' => '2', + '-ms-flex-order' => '1', + 'order' => '1', + ), + '.ast-theme.ast-header-custom-item-outside .header-main-layout-2 .ast-masthead-custom-menu-items' => array( + 'text-align' => 'center', + ), + '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .site-branding, .ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .ast-mobile-menu-buttons' => array( + '-js-display' => 'flex', + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + ), + '.ast-theme.ast-header-custom-item-outside.ast-header-custom-item-outside .header-main-layout-2 .ast-mobile-menu-buttons' => array( + 'padding-bottom' => '0', + ), + '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .ast-site-identity' => array( + 'width' => '100%', + ), + '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline.header-main-layout-3 .ast-site-identity' => array( + 'width' => 'auto', + ), + '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline.header-main-layout-2 .site-branding' => array( + '-webkit-box-flex' => '1', + '-webkit-flex' => '1 1 auto', + '-moz-box-flex' => '1', + '-ms-flex' => '1 1 auto', + 'flex' => '1 1 auto', + ), + '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .site-branding' => array( + 'text-align' => 'left', + ), + '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .site-title' => array( + '-webkit-box-pack' => 'left', + '-webkit-justify-content' => 'left', + '-moz-box-pack' => 'left', + '-ms-flex-pack' => 'left', + 'justify-content' => 'left', + ), + '.ast-theme.ast-header-custom-item-outside .header-main-layout-2 .ast-mobile-menu-buttons' => array( + 'padding-bottom' => '1em', + ), + '.ast-amp .ast-mobile-header-stack .main-header-container, .ast-amp .ast-mobile-header-inline .main-header-container' => array( + '-js-display' => 'flex', + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + ), + '.ast-amp .header-main-layout-1 .site-branding' => array( + 'padding-right' => '1em', + ), + '.ast-amp .header-main-layout-1 .main-header-bar-navigation' => array( + 'text-align' => 'left', + ), + '.ast-amp .header-main-layout-1 .main-navigation' => array( + 'padding-left' => '0', + ), + '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items' => array( + '-webkit-box-flex' => '1', + '-webkit-flex' => '1 1 100%', + '-moz-box-flex' => '1', + '-ms-flex' => '1 1 100%', + 'flex' => '1 1 100%', + ), + '.ast-amp .ast-mobile-header-stack .site-branding' => array( + 'padding-left' => '0', + 'padding-right' => '0', + 'padding-bottom' => '1em', + '-webkit-box-flex' => '1', + '-webkit-flex' => '1 1 100%', + '-moz-box-flex' => '1', + '-ms-flex' => '1 1 100%', + 'flex' => '1 1 100%', + ), + '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items, .ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .site-title, .ast-amp .ast-mobile-header-stack .ast-site-identity' => array( + '-webkit-box-pack' => 'center', + '-webkit-justify-content' => 'center', + '-moz-box-pack' => 'center', + '-ms-flex-pack' => 'center', + 'justify-content' => 'center', + 'text-align' => 'center', + ), + '.ast-amp .ast-mobile-header-stack.ast-logo-title-inline .site-title' => array( + 'text-align' => 'left', + ), + '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( + '-webkit-box-flex' => '1', + '-webkit-flex' => '1 1 100%', + '-moz-box-flex' => '1', + '-ms-flex' => '1 1 100%', + 'flex' => '1 1 100%', + 'text-align' => 'center', + '-webkit-box-pack' => 'center', + '-webkit-justify-content' => 'center', + '-moz-box-pack' => 'center', + '-ms-flex-pack' => 'center', + 'justify-content' => 'center', + ), + '.ast-amp .ast-mobile-header-stack.header-main-layout-3 .main-header-container' => array( + 'flex-direction' => 'initial', + ), + '.ast-amp .header-main-layout-2 .ast-mobile-menu-buttons' => array( + '-js-display' => 'flex', + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + '-webkit-box-pack' => 'center', + '-webkit-justify-content' => 'center', + '-moz-box-pack' => 'center', + '-ms-flex-pack' => 'center', + 'justify-content' => 'center', + ), + '.ast-amp .header-main-layout-2 .main-header-bar-navigation, .ast-amp .header-main-layout-2 .widget' => array( + 'text-align' => 'left', + ), + '.ast-theme.ast-header-custom-item-outside .header-main-layout-3 .main-header-bar .ast-search-icon' => array( + 'margin-right' => 'auto', + 'margin-left' => '1em', + ), + '.ast-amp .header-main-layout-3 .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array( + 'right' => 'auto', + 'left' => '0', + ), + '.ast-amp .header-main-layout-3.ast-mobile-header-inline .ast-mobile-menu-buttons' => array( + '-webkit-box-pack' => 'start', + '-webkit-justify-content' => 'flex-start', + '-moz-box-pack' => 'start', + '-ms-flex-pack' => 'start', + 'justify-content' => 'flex-start', + ), + '.ast-amp .header-main-layout-3 li .ast-search-menu-icon' => array( + 'left' => '0', + ), + '.ast-amp .header-main-layout-3 .site-branding' => array( + 'padding-left' => '1em', + '-webkit-box-pack' => 'end', + '-webkit-justify-content' => 'flex-end', + '-moz-box-pack' => 'end', + '-ms-flex-pack' => 'end', + 'justify-content' => 'flex-end', + ), + '.ast-amp .header-main-layout-3 .main-navigation' => array( + 'padding-right' => '0', + ), + '.ast-amp .header-main-layout-1 .site-branding' => array( + 'padding-right' => '1em', + ), + '.ast-amp .header-main-layout-1 .main-header-bar-navigation' => array( + 'text-align' => 'left', + ), + '.ast-amp .header-main-layout-1 .main-navigation' => array( + 'padding-left' => '0', + ), + '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items' => array( + '-webkit-box-flex' => '1', + '-webkit-flex' => '1 1 100%', + '-moz-box-flex' => '1', + '-ms-flex' => '1 1 100%', + 'flex' => '1 1 100%', + ), + '.ast-amp .ast-mobile-header-stack .site-branding' => array( + 'padding-left' => '0', + 'padding-right' => '0', + 'padding-bottom' => '1em', + '-webkit-box-flex' => '1', + '-webkit-flex' => '1 1 100%', + '-moz-box-flex' => '1', + '-ms-flex' => '1 1 100%', + 'flex' => '1 1 100%', + ), + '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items, .ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .site-title, .ast-amp .ast-mobile-header-stack .ast-site-identity' => array( + '-webkit-box-pack' => 'center', + '-webkit-justify-content' => 'center', + '-moz-box-pack' => 'center', + '-ms-flex-pack' => 'center', + 'justify-content' => 'center', + 'text-align' => 'center', + ), + '.ast-amp .ast-mobile-header-stack.ast-logo-title-inline .site-title' => array( + 'text-align' => 'left', + ), + '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( + 'flex' => '1 1 100%', + 'text-align' => 'center', + '-webkit-box-pack' => 'center', + '-webkit-justify-content' => 'center', + '-moz-box-pack' => 'center', + '-ms-flex-pack' => 'center', + 'justify-content' => 'center', + ), + '.ast-amp .ast-mobile-header-stack.header-main-layout-3 .main-header-container' => array( + 'flex-direction' => 'initial', + ), + '.ast-amp .header-main-layout-2 .ast-mobile-menu-buttons' => array( + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + '-webkit-box-pack' => 'center', + '-webkit-justify-content' => 'center', + '-moz-box-pack' => 'center', + '-ms-flex-pack' => 'center', + 'justify-content' => 'center', + ), + '.ast-amp .header-main-layout-2 .main-header-bar-navigation, .ast-amp .header-main-layout-2 .widget' => array( + 'text-align' => 'left', + ), + '.ast-theme.ast-header-custom-item-outside .header-main-layout-3 .main-header-bar .ast-search-icon' => array( + 'margin-right' => 'auto', + 'margin-left' => '1em', + ), + '.ast-amp .header-main-layout-3 .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array( + 'right' => 'auto', + 'left' => '0', + ), + '.ast-amp .header-main-layout-3.ast-mobile-header-inline .ast-mobile-menu-buttons' => array( + '-webkit-box-pack' => 'start', + '-webkit-justify-content' => 'flex-start', + '-moz-box-pack' => 'start', + '-ms-flex-pack' => 'start', + 'justify-content' => 'flex-start', + ), + '.ast-amp .header-main-layout-3 li .ast-search-menu-icon' => array( + 'left' => '0', + ), + '.ast-amp .header-main-layout-3 .site-branding' => array( + 'padding-left' => '1em', + '-webkit-box-pack' => 'end', + '-webkit-justify-content' => 'flex-end', + '-moz-box-pack' => 'end', + '-ms-flex-pack' => 'end', + 'justify-content' => 'flex-end', + ), + '.ast-amp .header-main-layout-3 .main-navigation' => array( + 'padding-right' => '0', + ), + '.ast-amp .ast-header-custom-item' => array( + 'border-top' => '1px solid #eaeaea', + ), + '.ast-amp .ast-header-custom-item .ast-masthead-custom-menu-items' => array( + 'padding-left' => '20px', + 'padding-right' => '20px', + 'margin-bottom' => '1em', + 'margin-top' => '1em', + ), + '.ast-amp .ast-header-custom-item .widget:last-child' => array( + 'margin-bottom' => '1em', + ), + '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item .menu-link' => array( + 'display' => 'block', + ), + '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item' => array( + 'padding-left' => '0', + 'padding-right' => '0', + 'margin-top' => '0', + 'margin-bottom' => '0', + ), + '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item .ast-custom-button-link' => array( + 'display' => 'none', + ), + '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item .menu-link' => array( + 'display' => 'block', + ), + '.ast-amp .woocommerce-custom-menu-item .ast-cart-menu-wrap' => array( + 'width' => '2em', + 'height' => '2em', + 'font-size' => '1.4em', + 'line-height' => '2', + 'vertical-align' => 'middle', + 'text-align' => 'right', + ), + '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-3 .ast-site-header-cart' => array( + 'padding' => '0 0 1em 1em', + ), + '.ast-theme.ast-woocommerce-cart-menu.ast-header-custom-item-outside .ast-site-header-cart' => array( + 'padding' => '0', + ), + '.ast-amp .ast-masthead-custom-menu-items.woocommerce-custom-menu-item' => array( + 'margin-bottom' => '0', + 'margin-top' => '0', + ), + '.ast-amp .ast-masthead-custom-menu-items.woocommerce-custom-menu-item .ast-site-header-cart' => array( + 'padding' => '0', + ), + '.ast-amp .ast-masthead-custom-menu-items.woocommerce-custom-menu-item .ast-site-header-cart a' => array( + 'border' => 'none', + 'display' => 'inline-block', + ), + '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-form' => array( + 'visibility' => 'visible', + 'opacity' => '1', + 'position' => 'relative', + 'right' => 'auto', + 'top' => 'auto', + 'transform' => 'none', + ), + '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-stack .main-header-bar .ast-search-icon' => array( + 'margin' => '0', + ), + '.ast-amp .ast-mobile-header-stack .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array( + 'right' => '-1em', + ), + '.ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( + '-webkit-box-pack' => 'center', + '-webkit-justify-content' => 'center', + '-moz-box-pack' => 'center', + '-ms-flex-pack' => 'center', + 'justify-content' => 'center', + 'text-align' => 'center', + 'padding-bottom' => '0', + ), + '.ast-safari-browser-less-than-11.ast-woocommerce-cart-menu.ast-header-break-point .header-main-layout-2 .main-header-container' => array( + 'display' => 'flex', + ), + ); + + // Tablet CSS. + $astra_medium_break_point_navigation = array( + '.ast-amp .footer-sml-layout-2 .ast-small-footer-section-2' => array( + 'margin-top' => '1em', + ), + ); + + $parse_css .= astra_parse_css( $astra_medium_break_point_navigation, astra_get_tablet_breakpoint() ); + + // Mobile CSS. + $astra_small_break_point_navigation = array( + '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart' => array( + 'padding-right' => '0', + 'padding-left' => '0', + ), + '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .main-header-bar, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .main-header-bar' => array( + 'text-align' => 'center', + ), + '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-site-header-cart, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .ast-site-header-cart' => array( + 'display' => 'inline-block', + ), + '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-mobile-menu-buttons, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .ast-mobile-menu-buttons' => array( + 'display' => 'inline-block', + ), + '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-2.ast-mobile-header-inline .site-branding' => array( + 'flex' => 'auto', + ), + '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .site-branding' => array( + 'flex' => '0 0 100%', + ), + '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .main-header-container' => array( + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + '-webkit-box-pack' => 'center', + '-webkit-justify-content' => 'center', + '-moz-box-pack' => 'center', + '-ms-flex-pack' => 'center', + 'justify-content' => 'center', + ), + '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( + 'width' => '100%', + ), + '.ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( + '-webkit-box-pack' => 'center', + '-webkit-justify-content' => 'center', + '-moz-box-pack' => 'center', + '-ms-flex-pack' => 'center', + 'justify-content' => 'center', + ), + '.ast-amp .ast-mobile-header-stack .main-header-bar-wrap .site-branding' => array( + '-webkit-box-flex' => '1', + '-webkit-flex' => '1 1 auto', + '-moz-box-flex' => '1', + '-ms-flex' => '1 1 auto', + '-webkit-box-flex' => '1', + '-webkit-flex' => '1 1 auto', + '-moz-box-flex' => '1', + '-ms-flex' => '1 1 auto', + 'flex' => '1 1 auto', + ), + '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array( + 'padding-top' => '0.8em', + ), + '.ast-amp .ast-mobile-header-stack.header-main-layout-2 .ast-mobile-menu-buttons' => array( + 'padding-top' => '0.8em', + ), + '.ast-amp .ast-mobile-header-stack.header-main-layout-1 .site-branding' => array( + 'padding-bottom' => '0', + ), + '.ast-header-custom-item-outside.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items' => array( + 'padding' => '0.8em 1em 0 1em', + 'text-align' => 'center', + 'width' => '100%', + ), + '.ast-header-custom-item-outside.ast-amp .ast-mobile-header-stack.header-main-layout-3 .ast-mobile-menu-buttons, .ast-header-custom-item-outside.ast-amp .ast-mobile-header-stack.header-main-layout-3 .ast-masthead-custom-menu-items' => array( + 'padding-top' => '0.8em', + ), + // Tablet CSS. + '.ast-amp .footer-sml-layout-2 .ast-small-footer-section-2' => array( + 'margin-top' => '1em', + ), + ); + + $parse_css .= astra_parse_css( $astra_small_break_point_navigation, astra_get_mobile_breakpoint() ); + } + + $parse_css .= astra_parse_css( $astra_break_point_navigation, '', astra_header_break_point() ); + + // Move all header-break-point css from class based css to media query based CSS. + $astra_break_point_navigation = array( + + '.ast-amp .entry-content .alignwide' => array( + 'margin-left' => 'auto', + 'margin-right' => 'auto', + ), + '.ast-amp .main-navigation' => array( + 'padding-left' => '0', + ), + '.ast-amp .main-navigation ul .menu-item .menu-link, .ast-amp .main-navigation ul .button-custom-menu-item a' => array( + 'padding' => '0 20px', + 'display' => 'inline-block', + 'width' => '100%', + 'border-bottom-width' => '1px', + 'border-style' => 'solid', + 'border-color' => '#eaeaea', + ), + '.ast-amp .main-navigation .sub-menu .menu-item .menu-link' => array( + 'padding-left' => '30px', + ), + '.ast-amp .main-navigation .sub-menu .menu-item .menu-item .menu-link' => array( + 'padding-left' => '40px', + ), + '.ast-amp .main-navigation .sub-menu .menu-item .menu-item .menu-item .menu-link' => array(), + '.ast-amp .main-navigation .sub-menu .menu-item .menu-item .menu-item .menu-item .menu-link' => array( + 'padding-left' => '60px', + ), + '.ast-amp .main-header-menu' => array( + 'background-color' => '#f9f9f9', + ), + '.ast-amp .main-header-menu ul' => array( + 'background-color' => '#f9f9f9', + 'position' => 'static', + 'opacity' => '1', + 'visibility' => 'visible', + 'border' => '0', + 'width' => 'auto', + ), + '.ast-amp .main-header-menu ul li.ast-left-align-sub-menu:hover > ul, .ast-amp .main-header-menu ul li.ast-left-align-sub-menu.focus > ul' => array( + 'left' => '0', + ), + '.ast-amp .main-header-menu li.ast-sub-menu-goes-outside:hover > ul, .ast-amp .main-header-menu li.ast-sub-menu-goes-outside.focus > ul' => array( + 'left' => '0', + ), + '.ast-amp .submenu-with-border .sub-menu' => array( + 'border' => '0', + ), + '.ast-amp .user-select' => array( + 'clear' => 'both', + ), + '.ast-amp .ast-mobile-menu-buttons' => array( + 'display' => 'block', + '-webkit-align-self' => 'center', + '-ms-flex-item-align' => 'center', + 'align-self' => 'center', + ), + '.ast-amp .main-header-bar-navigation' => array( + '-webkit-box-flex' => '1', + '-webkit-flex' => 'auto', + '-moz-box-flex' => '1', + '-ms-flex' => 'auto', + 'flex' => 'auto', + 'width' => '-webkit-calc( 100% + 40px)', + 'width' => 'calc(100% + 40px )', + ), + '.ast-amp .ast-main-header-bar-alignment' => array( + 'display' => 'block', + 'width' => '100%', + '-webkit-box-flex' => '1', + '-webkit-flex' => 'auto', + '-moz-box-flex' => '1', + '-ms-flex' => 'auto', + 'flex' => 'auto', + '-webkit-box-ordinal-group' => '5', + '-webkit-order' => '4', + '-moz-box-ordinal-group' => '5', + '-ms-flex-order' => '4', + 'order' => '4', + ), + '.ast-amp .ast-mobile-menu-buttons' => array( + 'text-align' => 'right', + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + '-webkit-box-pack' => 'end', + '-webkit-justify-content' => 'flex-end', + '-moz-box-pack' => 'end', + '-ms-flex-pack' => 'end', + 'justify-content' => 'flex-end', + ), + '.ast-amp .site-header .main-header-bar-wrap .site-branding' => array( + '-js-display' => 'flex', + 'display' => '-webkit-box', + 'display' => '-webkit-flex', + 'display' => '-moz-box', + 'display' => '-ms-flexbox', + 'display' => 'flex', + '-webkit-box-flex' => '1', + '-webkit-flex' => '1', + '-moz-box-flex' => '1', + '-ms-flex' => '1', + 'flex' => '1', + '-webkit-align-self' => 'center', + '-ms-flex-item-align' => 'center', + 'align-self' => 'center', + ), + '.ast-amp .ast-site-identity' => array( + 'width' => '100%', + ), + '.ast-amp .main-header-bar-navigation .menu-item-has-children > .menu-link .sub-arrow:after' => array( + 'display' => 'none', + ), + '.ast-amp .main-header-bar' => array( + 'display' => 'block', + 'line-height' => '3', + ), + '.ast-main-header-bar-alignment .main-header-bar-navigation' => array( + 'line-height' => '3', + 'display' => 'none', + ), + '.ast-amp .main-header-bar .toggled-on .main-header-bar-navigation' => array( + 'line-height' => '3', + 'display' => 'none', + ), + '.ast-amp .main-header-bar .main-header-bar-navigation .sub-menu' => array( + 'line-height' => '3', + ), + '.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children .sub-menu' => array( + 'display' => 'none', + ), + '.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children .dropdown-open+ul.sub-menu' => array( + 'display' => 'block', + ), + '.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle' => array( + 'display' => 'inline-block', + 'position' => 'absolute', + 'font-size' => 'inherit', + 'top' => '-1px', + 'right' => '20px', + 'cursor' => 'pointer', + 'webkit-font-smoothing' => 'antialiased', + 'moz-osx-font-smoothing' => 'grayscale', + 'padding' => '0 0.907em', + 'font-weight' => 'normal', + 'line-height' => 'inherit', + 'transition' => 'all 0.2s', + ), + '.ast-amp .main-header-bar .main-header-bar-navigation .ast-submenu-expanded > .ast-menu-toggle::before' => array( + '-webkit-transform' => 'rotateX(180deg)', + 'transform' => 'rotateX(180deg)', + ), + '.ast-amp .main-header-bar .main-header-bar-navigation .main-header-menu' => array( + 'border-top-width' => '1px', + 'border-style' => 'solid', + 'border-color' => '#eaeaea', + ), + '.ast-amp .main-navigation' => array( + 'display' => 'block', + 'width' => '100%', + ), + '.ast-amp .main-navigation ul > li:first-child' => array( + 'border-top' => '0', + ), + '.ast-amp .main-navigation ul ul' => array( + 'left' => 'auto', + 'right' => 'auto', + ), + '.ast-amp .main-navigation li' => array( + 'width' => '100%', + ), + '.ast-amp .main-navigation .widget' => array( + 'margin-bottom' => '1em', + ), + '.ast-amp .main-navigation .widget li' => array( + 'width' => 'auto', + ), + '.ast-amp .main-navigation .widget:last-child' => array( + 'margin-bottom' => '0', + ), + '.ast-amp .main-header-menu ul ul' => array( + 'top' => '0', + ), + '.ast-amp .ast-has-mobile-header-logo .custom-logo-link, .ast-amp .ast-has-mobile-header-logo .astra-logo-svg' => array( + 'display' => 'none', + ), + '.ast-amp .ast-has-mobile-header-logo .custom-mobile-logo-link' => array( + 'display' => 'inline-block', + ), + '.ast-theme.ast-mobile-inherit-site-logo .ast-has-mobile-header-logo .custom-logo-link, .ast-theme.ast-mobile-inherit-site-logo .ast-has-mobile-header-logo .astra-logo-svg' => array( + 'display' => 'block', + ), + '.ast-amp .ast-header-widget-area .widget' => array( + 'margin' => '0.5em 0', + 'display' => 'block', + ), + '.ast-amp .main-header-bar' => array( + 'border' => '0', + 'border-bottom-color' => '#eaeaea', + 'border-bottom-style' => 'solid', + ), + '.ast-amp .nav-fallback-text' => array( + 'float' => 'none', + ), + '.ast-amp .main-header-menu .woocommerce-custom-menu-item .ast-cart-menu-wrap' => array( + 'height' => '3em', + 'line-height' => '3', + 'text-align' => 'left', + ), + '.ast-amp #ast-site-header-cart .widget_shopping_cart' => array( + 'display' => 'none', + ), + '.ast-theme.ast-woocommerce-cart-menu .ast-site-header-cart' => array( + 'order' => 'initial', + 'line-height' => '3', + 'padding' => '0 1em 1em 0', + ), + '.ast-amp .ast-edd-site-header-cart .widget_edd_cart_widget, .ast-amp .ast-edd-site-header-cart .ast-edd-header-cart-info-wrap' => array( + 'display' => 'none', + ), + '.ast-amp div.ast-masthead-custom-menu-items.edd-custom-menu-item' => array( + 'padding' => '0', + ), + '.ast-amp .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array( + 'right' => '0', + ), + '.ast-amp .main-header-menu .sub-menu' => array( + 'box-shadow' => 'none', + ), + '.ast-amp .submenu-with-border .sub-menu a' => array( + 'border-width' => '1px', + ), + '.ast-amp .submenu-with-border .sub-menu > li:last-child > a' => array( + 'border-width' => '1px', + ), + ); + + if ( false === Astra_Icons::is_svg_icons() ) { + $astra_break_point_navigation['.ast-amp .main-navigation ul.children li a:before, .ast-amp .main-navigation ul.sub-menu li a:before'] = array( + 'content' => '"\e900"', + 'font-family' => '"Astra"', + 'font-size' => '0.65em', + 'text-decoration' => 'inherit', + 'display' => 'inline-block', + 'transform' => 'translate(0, -2px) rotateZ(270deg)', + 'margin-right' => '5px', + ); + $astra_break_point_navigation['.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before'] = array( + 'font-weight' => 'bold', + 'content' => '"\e900"', + 'font-family' => '"Astra"', + 'text-decoration' => 'inherit', + 'display' => 'inline-block', + ); + } else { + $astra_break_point_navigation['[data-section="section-header-mobile-trigger"] .ast-button-wrap .ast-mobile-menu-buttons-minimal'] = array( + 'background' => 'transparent', + 'border' => 'none', + ); + } + + $parse_css .= astra_parse_css( $astra_break_point_navigation, '', astra_header_break_point() ); + + return $parse_css; + } + + /** + * Add AMP attributes to the nav menu wrapper. + * + * @since 1.7.0 + * @param Array $attr HTML attributes to be added to the nav menu wrapper. + * + * @return Array updated HTML attributes. + */ + public function nav_menu_wrapper( $attr ) { + $attr['[class]'] = '( astraAmpMenuExpanded ? \'ast-main-header-bar-alignment toggle-on\' : \'ast-main-header-bar-alignment\' )'; + $attr['aria-expanded'] = 'false'; + $attr['[aria-expanded]'] = '(astraAmpMenuExpanded ? \'true\' : \'false\')'; + + return $attr; + } + + /** + * Set AMP State for eeach sub menu toggle. + * + * @since 1.7.0 + * @param String $item_output HTML markup for the menu item. + * @param WP_Post $item Post object for the navigation menu. + * + * @return String HTML MArkup for the menu including the AML State. + */ + public function toggle_button_markup( $item_output, $item ) { + $item_output .= ''; + + return $item_output; + } + + /** + * Add AMP attribites to the toggle button to add `.ast-submenu-expanded` class to parent li. + * + * @since 1.7.0 + * @param array $attr Optional. Extra attributes to merge with defaults. + * @param string $context The context, to build filter name. + * @param array $args Optional. Custom data to pass to filter. + * + * @return Array updated HTML attributes. + */ + public function menu_toggle_button( $attr, $context, $args ) { + $attr['[class]'] = '( astraNavMenuItemExpanded' . $args->ID . ' ? \' ast-menu-toggle dropdown-open\' : \'ast-menu-toggle\')'; + $attr['on'] = 'tap:AMP.setState( { astraNavMenuItemExpanded' . $args->ID . ': ! astraNavMenuItemExpanded' . $args->ID . ' } )'; + + return $attr; + } + + /** + * Add amp states to the dom. + */ + public function render_amp_states() { + echo ''; + echo ''; + echo ''; + } + + /** + * Add search slide data attributes. + * + * @param string $input the data attrs already existing in the nav. + * + * @return string + */ + public function add_search_slide_toggle_attrs( $input ) { + $input .= ' on="tap:AMP.setState( { astraAmpSlideSearchMenuExpanded: ! astraAmpSlideSearchMenuExpanded } )" '; + $input .= ' [class]="( astraAmpSlideSearchMenuExpanded ? \'ast-search-menu-icon slide-search ast-dropdown-active\' : \'ast-search-menu-icon slide-search\' )" '; + $input .= ' aria-expanded="false" [aria-expanded]="astraAmpSlideSearchMenuExpanded ? \'true\' : \'false\'" '; + + return $input; + } + + /** + * Add search slide data attributes. + * + * @param string $input the data attrs already existing in the nav. + * + * @return string + */ + public function add_search_field_toggle_attrs( $input ) { + $input .= ' on="tap:AMP.setState( { astraAmpSlideSearchMenuExpanded: astraAmpSlideSearchMenuExpanded } )" '; + + return $input; + } + + /** + * Add the nav toggle data attributes. + * + * @param string $input the data attrs already existing in nav toggle. + * + * @return string + */ + public function add_nav_toggle_attrs( $input ) { + $input .= ' on="tap:AMP.setState( { astraAmpMenuExpanded: ! astraAmpMenuExpanded } ),astra-body.toggleClass(class=ast-main-header-nav-open)" '; + $input .= ' [class]="\'menu-toggle main-header-menu-toggle ast-mobile-menu-buttons-minimal\' + ( astraAmpMenuExpanded ? \' toggled\' : \'\' )" '; + $input .= ' aria-expanded="false" '; + $input .= ' [aria-expanded]="astraAmpMenuExpanded ? \'true\' : \'false\'" '; + + return $input; + } + + } +endif; + +/** +* Kicking this off by calling 'get_instance()' method +*/ +Astra_AMP::get_instance(); diff --git a/inc/compatibility/class-astra-bb-ultimate-addon.php b/inc/compatibility/class-astra-bb-ultimate-addon.php index c77b165..d3129e2 100644 --- a/inc/compatibility/class-astra-bb-ultimate-addon.php +++ b/inc/compatibility/class-astra-bb-ultimate-addon.php @@ -1,428 +1,428 @@ - $font_family[0], - 'weight' => astra_get_option( 'font-weight-button' ), - ); - } - - /** - * Button Font Size - */ - public function button_font_size() { - return ''; - } - - /** - * Button Line Height - */ - public function button_line_height() { - return ''; - } - - /** - * Default type : Button Font Size - * - * @since 2.2.0 - */ - public function default_type_button_font_size() { - $font_size_arr = array(); - $body_font_size = astra_get_option( 'font-size-body' ); - $theme_btn_font_size = astra_get_option( 'font-size-button' ); - - $font_size_arr['desktop'] = astra_responsive_font( $theme_btn_font_size, 'desktop' ); - $font_size_arr['tablet'] = astra_responsive_font( $theme_btn_font_size, 'tablet' ); - $font_size_arr['mobile'] = astra_responsive_font( $theme_btn_font_size, 'mobile' ); - - if ( empty( $font_size_arr['desktop'] ) ) { - $font_size_arr['desktop'] = astra_responsive_font( $body_font_size, 'desktop' ); - } - if ( empty( $font_size_arr['tablet'] ) ) { - $font_size_arr['tablet'] = astra_responsive_font( $body_font_size, 'tablet' ); - } - if ( empty( $font_size_arr['mobile'] ) ) { - $font_size_arr['mobile'] = astra_responsive_font( $body_font_size, 'mobile' ); - } - - return $font_size_arr; - } - - /** - * Default type : Button Line Height - * - * @since 2.2.0 - */ - public function default_type_button_line_height() { - $theme_btn_body_line_height = astra_get_option( 'body-line-height', 1.85714285714286 ); - $theme_btn_line_height = astra_get_option( 'theme-btn-line-height', $theme_btn_body_line_height ); - return $theme_btn_line_height; - } - - /** - * Button Letter Spacing - */ - public function button_letter_spacing() { - return ''; - } - - /** - * Default type : Button Letter Spacing - * - * @since 2.2.0 - */ - public function default_type_button_letter_spacing() { - $theme_btn_letter_spacing = astra_get_option( 'theme-btn-letter-spacing' ); - return $theme_btn_letter_spacing; - } - - /** - * Button Text Transform - */ - public function button_text_transform() { - return ''; - } - - /** - * Default type : Button Text Transform - * - * @since 2.2.0 - */ - public function default_type_button_text_transform() { - $theme_btn_text_transform = astra_get_option( 'text-transform-button' ); - return $theme_btn_text_transform; - } - - /** - * Button Text Color - */ - public function button_text_color() { - $theme_color = astra_get_option( 'theme-color' ); - $link_color = astra_get_option( 'link-color', $theme_color ); - $color = astra_get_option( 'button-color' ); - if ( empty( $color ) ) { - $color = astra_get_foreground_color( $link_color ); - } - return $color; - } - - /** - * Default type : Button Text Color - * - * @since 2.2.0 - */ - public function default_type_button_text_color() { - $theme_color = astra_get_option( 'theme-color' ); - $btn_text_color = astra_get_option( 'button-color' ); - if ( empty( $btn_text_color ) ) { - $btn_text_color = astra_get_foreground_color( $theme_color ); - } - - return $btn_text_color; - } - - /** - * Button Text Hover Color - */ - public function button_text_hover_color() { - $link_hover_color = astra_get_option( 'link-h-color' ); - $btn_text_hover_color = astra_get_option( 'button-h-color' ); - if ( empty( $btn_text_hover_color ) ) { - $btn_text_hover_color = astra_get_foreground_color( $link_hover_color ); - } - - return $btn_text_hover_color; - } - - /** - * Default type : Button Text Hover Color - * - * @since 2.2.0 - */ - public function default_type_button_text_hover_color() { - $link_hover_color = astra_get_option( 'link-h-color' ); - $btn_text_hover_color = astra_get_option( 'button-h-color' ); - if ( empty( $btn_text_hover_color ) ) { - $btn_text_hover_color = astra_get_foreground_color( $link_hover_color ); - } - - return $btn_text_hover_color; - } - - /** - * Button Background Color - */ - public function button_bg_color() { - return astra_get_option( 'button-bg-color' ); - } - - /** - * Default type : Button Background Color - * - * @since 2.2.0 - */ - public function default_type_button_bg_color() { - $theme_color = astra_get_option( 'theme-color' ); - $btn_bg_color = astra_get_option( 'button-bg-color', $theme_color ); - return $btn_bg_color; - } - - /** - * Button Background Color - */ - public function button_bg_hover_color() { - return astra_get_option( 'button-bg-h-color' ); - } - - /** - * Default type : Button Background Color - * - * @since 2.2.0 - */ - public function default_type_button_bg_hover_color() { - $link_hover_color = astra_get_option( 'link-h-color' ); - $btn_bg_hover_color = astra_get_option( 'button-bg-h-color', $link_hover_color ); - return $btn_bg_hover_color; - } - - /** - * Button Border Radius - */ - public function button_border_radius() { - return astra_get_option( 'button-radius' ); - } - - - /** - * Button Padding - */ - public function button_padding() { - $padding = ''; - $v_padding = astra_get_option( 'button-v-padding' ); - $h_padding = astra_get_option( 'button-h-padding' ); - if ( '' != $v_padding && '' != $h_padding ) { - $padding = $v_padding . 'px ' . $h_padding . 'px'; - } - return $padding; - } - - /** - * Default type : Button Padding - * - * @since 2.2.0 - */ - public function default_type_button_padding() { - - $padding = astra_get_option( 'theme-button-padding' ); - - return $padding; - } - - /** - * Button Border Width - */ - public function button_border_width() { - - $btn_width = array(); - $get_btn_width = astra_get_option( 'theme-button-border-group-border-size' ); - - if ( ! empty( $get_btn_width ) ) { - $btn_width = $get_btn_width; - } - - return $btn_width; - } - - /** - * Button Border Color - */ - public function button_border_color() { - - $theme_color = astra_get_option( 'theme-color' ); - $btn_bg_color = astra_get_option( 'button-bg-color', $theme_color ); - $get_btn_border_color = astra_get_option( 'theme-button-border-group-border-color', $btn_bg_color ); - - return $get_btn_border_color; - } - - /** - * Button Border Hover Color - */ - public function button_border_hover_color() { - - $link_hover_color = astra_get_option( 'link-h-color' ); - $btn_bg_hover_color = astra_get_option( 'button-bg-h-color', $link_hover_color ); - $get_btn_border_h_color = astra_get_option( 'theme-button-border-group-border-h-color', $btn_bg_hover_color ); - - return $get_btn_border_h_color; - } - - /** - * Button Vertical Padding. - * - * @deprecated 2.2.0 - */ - public function button_vertical_padding() { - - $padding = ''; - $v_padding = astra_get_option( 'button-v-padding' ); - - if ( '' != $v_padding ) { - $padding = $v_padding; - } - - return $padding; - } - - /** - * Button Horizontal Padding. - * - * @deprecated 2.2.0 - */ - public function button_horizontal_padding() { - - $padding = ''; - $h_padding = astra_get_option( 'button-h-padding' ); - - if ( '' != $h_padding ) { - $padding = $h_padding; - } - - return $padding; - } - - } - -endif; - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_BB_Ultimate_Addon::get_instance(); + $font_family[0], + 'weight' => astra_get_option( 'font-weight-button' ), + ); + } + + /** + * Button Font Size + */ + public function button_font_size() { + return ''; + } + + /** + * Button Line Height + */ + public function button_line_height() { + return ''; + } + + /** + * Default type : Button Font Size + * + * @since 2.2.0 + */ + public function default_type_button_font_size() { + $font_size_arr = array(); + $body_font_size = astra_get_option( 'font-size-body' ); + $theme_btn_font_size = astra_get_option( 'font-size-button' ); + + $font_size_arr['desktop'] = astra_responsive_font( $theme_btn_font_size, 'desktop' ); + $font_size_arr['tablet'] = astra_responsive_font( $theme_btn_font_size, 'tablet' ); + $font_size_arr['mobile'] = astra_responsive_font( $theme_btn_font_size, 'mobile' ); + + if ( empty( $font_size_arr['desktop'] ) ) { + $font_size_arr['desktop'] = astra_responsive_font( $body_font_size, 'desktop' ); + } + if ( empty( $font_size_arr['tablet'] ) ) { + $font_size_arr['tablet'] = astra_responsive_font( $body_font_size, 'tablet' ); + } + if ( empty( $font_size_arr['mobile'] ) ) { + $font_size_arr['mobile'] = astra_responsive_font( $body_font_size, 'mobile' ); + } + + return $font_size_arr; + } + + /** + * Default type : Button Line Height + * + * @since 2.2.0 + */ + public function default_type_button_line_height() { + $theme_btn_body_line_height = astra_get_option( 'body-line-height', 1.85714285714286 ); + $theme_btn_line_height = astra_get_option( 'theme-btn-line-height', $theme_btn_body_line_height ); + return $theme_btn_line_height; + } + + /** + * Button Letter Spacing + */ + public function button_letter_spacing() { + return ''; + } + + /** + * Default type : Button Letter Spacing + * + * @since 2.2.0 + */ + public function default_type_button_letter_spacing() { + $theme_btn_letter_spacing = astra_get_option( 'theme-btn-letter-spacing' ); + return $theme_btn_letter_spacing; + } + + /** + * Button Text Transform + */ + public function button_text_transform() { + return ''; + } + + /** + * Default type : Button Text Transform + * + * @since 2.2.0 + */ + public function default_type_button_text_transform() { + $theme_btn_text_transform = astra_get_option( 'text-transform-button' ); + return $theme_btn_text_transform; + } + + /** + * Button Text Color + */ + public function button_text_color() { + $theme_color = astra_get_option( 'theme-color' ); + $link_color = astra_get_option( 'link-color', $theme_color ); + $color = astra_get_option( 'button-color' ); + if ( empty( $color ) ) { + $color = astra_get_foreground_color( $link_color ); + } + return $color; + } + + /** + * Default type : Button Text Color + * + * @since 2.2.0 + */ + public function default_type_button_text_color() { + $theme_color = astra_get_option( 'theme-color' ); + $btn_text_color = astra_get_option( 'button-color' ); + if ( empty( $btn_text_color ) ) { + $btn_text_color = astra_get_foreground_color( $theme_color ); + } + + return $btn_text_color; + } + + /** + * Button Text Hover Color + */ + public function button_text_hover_color() { + $link_hover_color = astra_get_option( 'link-h-color' ); + $btn_text_hover_color = astra_get_option( 'button-h-color' ); + if ( empty( $btn_text_hover_color ) ) { + $btn_text_hover_color = astra_get_foreground_color( $link_hover_color ); + } + + return $btn_text_hover_color; + } + + /** + * Default type : Button Text Hover Color + * + * @since 2.2.0 + */ + public function default_type_button_text_hover_color() { + $link_hover_color = astra_get_option( 'link-h-color' ); + $btn_text_hover_color = astra_get_option( 'button-h-color' ); + if ( empty( $btn_text_hover_color ) ) { + $btn_text_hover_color = astra_get_foreground_color( $link_hover_color ); + } + + return $btn_text_hover_color; + } + + /** + * Button Background Color + */ + public function button_bg_color() { + return astra_get_option( 'button-bg-color' ); + } + + /** + * Default type : Button Background Color + * + * @since 2.2.0 + */ + public function default_type_button_bg_color() { + $theme_color = astra_get_option( 'theme-color' ); + $btn_bg_color = astra_get_option( 'button-bg-color', $theme_color ); + return $btn_bg_color; + } + + /** + * Button Background Color + */ + public function button_bg_hover_color() { + return astra_get_option( 'button-bg-h-color' ); + } + + /** + * Default type : Button Background Color + * + * @since 2.2.0 + */ + public function default_type_button_bg_hover_color() { + $link_hover_color = astra_get_option( 'link-h-color' ); + $btn_bg_hover_color = astra_get_option( 'button-bg-h-color', $link_hover_color ); + return $btn_bg_hover_color; + } + + /** + * Button Border Radius + */ + public function button_border_radius() { + return astra_get_option( 'button-radius' ); + } + + + /** + * Button Padding + */ + public function button_padding() { + $padding = ''; + $v_padding = astra_get_option( 'button-v-padding' ); + $h_padding = astra_get_option( 'button-h-padding' ); + if ( '' != $v_padding && '' != $h_padding ) { + $padding = $v_padding . 'px ' . $h_padding . 'px'; + } + return $padding; + } + + /** + * Default type : Button Padding + * + * @since 2.2.0 + */ + public function default_type_button_padding() { + + $padding = astra_get_option( 'theme-button-padding' ); + + return $padding; + } + + /** + * Button Border Width + */ + public function button_border_width() { + + $btn_width = array(); + $get_btn_width = astra_get_option( 'theme-button-border-group-border-size' ); + + if ( ! empty( $get_btn_width ) ) { + $btn_width = $get_btn_width; + } + + return $btn_width; + } + + /** + * Button Border Color + */ + public function button_border_color() { + + $theme_color = astra_get_option( 'theme-color' ); + $btn_bg_color = astra_get_option( 'button-bg-color', $theme_color ); + $get_btn_border_color = astra_get_option( 'theme-button-border-group-border-color', $btn_bg_color ); + + return $get_btn_border_color; + } + + /** + * Button Border Hover Color + */ + public function button_border_hover_color() { + + $link_hover_color = astra_get_option( 'link-h-color' ); + $btn_bg_hover_color = astra_get_option( 'button-bg-h-color', $link_hover_color ); + $get_btn_border_h_color = astra_get_option( 'theme-button-border-group-border-h-color', $btn_bg_hover_color ); + + return $get_btn_border_h_color; + } + + /** + * Button Vertical Padding. + * + * @deprecated 2.2.0 + */ + public function button_vertical_padding() { + + $padding = ''; + $v_padding = astra_get_option( 'button-v-padding' ); + + if ( '' != $v_padding ) { + $padding = $v_padding; + } + + return $padding; + } + + /** + * Button Horizontal Padding. + * + * @deprecated 2.2.0 + */ + public function button_horizontal_padding() { + + $padding = ''; + $h_padding = astra_get_option( 'button-h-padding' ); + + if ( '' != $h_padding ) { + $padding = $h_padding; + } + + return $padding; + } + + } + +endif; + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_BB_Ultimate_Addon::get_instance(); diff --git a/inc/compatibility/class-astra-beaver-builder.php b/inc/compatibility/class-astra-beaver-builder.php index c372683..5b8c3d6 100644 --- a/inc/compatibility/class-astra-beaver-builder.php +++ b/inc/compatibility/class-astra-beaver-builder.php @@ -1,113 +1,113 @@ -post_content ) && $do_render && FLBuilderModel::is_builder_enabled() ) { - - update_post_meta( $id, '_astra_content_layout_flag', 'disabled' ); - update_post_meta( $id, 'site-post-title', 'disabled' ); - update_post_meta( $id, 'ast-title-bar-display', 'disabled' ); - update_post_meta( $id, 'ast-featured-img', 'disabled' ); - - $content_layout = get_post_meta( $id, 'site-content-layout', true ); - if ( empty( $content_layout ) || 'default' == $content_layout ) { - update_post_meta( $id, 'site-content-layout', 'page-builder' ); - } - - $sidebar_layout = get_post_meta( $id, 'site-sidebar-layout', true ); - if ( empty( $sidebar_layout ) || 'default' == $sidebar_layout ) { - update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' ); - } - } - } - } - - /** - * Add assets in theme - * - * @param array $assets list of theme assets (JS & CSS). - * @return array List of updated assets. - * @since 3.5.0 - */ - public function add_styles( $assets ) { - - if ( ! empty( $assets['css'] ) ) { - $assets['css'] = array( 'astra-bb-builder' => 'compatibility/page-builder/bb-plugin' ) + $assets['css']; - } - return $assets; - } - - } - -endif; - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_Beaver_Builder::get_instance(); +post_content ) && $do_render && FLBuilderModel::is_builder_enabled() ) { + + update_post_meta( $id, '_astra_content_layout_flag', 'disabled' ); + update_post_meta( $id, 'site-post-title', 'disabled' ); + update_post_meta( $id, 'ast-title-bar-display', 'disabled' ); + update_post_meta( $id, 'ast-featured-img', 'disabled' ); + + $content_layout = get_post_meta( $id, 'site-content-layout', true ); + if ( empty( $content_layout ) || 'default' == $content_layout ) { + update_post_meta( $id, 'site-content-layout', 'page-builder' ); + } + + $sidebar_layout = get_post_meta( $id, 'site-sidebar-layout', true ); + if ( empty( $sidebar_layout ) || 'default' == $sidebar_layout ) { + update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' ); + } + } + } + } + + /** + * Add assets in theme + * + * @param array $assets list of theme assets (JS & CSS). + * @return array List of updated assets. + * @since 3.5.0 + */ + public function add_styles( $assets ) { + + if ( ! empty( $assets['css'] ) ) { + $assets['css'] = array( 'astra-bb-builder' => 'compatibility/page-builder/bb-plugin' ) + $assets['css']; + } + return $assets; + } + + } + +endif; + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_Beaver_Builder::get_instance(); diff --git a/inc/compatibility/class-astra-beaver-themer.php b/inc/compatibility/class-astra-beaver-themer.php index 7be43a9..f7b05a1 100644 --- a/inc/compatibility/class-astra-beaver-themer.php +++ b/inc/compatibility/class-astra-beaver-themer.php @@ -1,410 +1,410 @@ - 0 ) { - $classes = array_diff( - $classes, - array( - // Astra common grid. - 'ast-col-xs-1', - 'ast-col-xs-2', - 'ast-col-xs-3', - 'ast-col-xs-4', - 'ast-col-xs-5', - 'ast-col-xs-6', - 'ast-col-xs-7', - 'ast-col-xs-8', - 'ast-col-xs-9', - 'ast-col-xs-10', - 'ast-col-xs-11', - 'ast-col-xs-12', - 'ast-col-sm-1', - 'ast-col-sm-2', - 'ast-col-sm-3', - 'ast-col-sm-4', - 'ast-col-sm-5', - 'ast-col-sm-6', - 'ast-col-sm-7', - 'ast-col-sm-8', - 'ast-col-sm-9', - 'ast-col-sm-10', - 'ast-col-sm-11', - 'ast-col-sm-12', - 'ast-col-md-1', - 'ast-col-md-2', - 'ast-col-md-3', - 'ast-col-md-4', - 'ast-col-md-5', - 'ast-col-md-6', - 'ast-col-md-7', - 'ast-col-md-8', - 'ast-col-md-9', - 'ast-col-md-10', - 'ast-col-md-11', - 'ast-col-md-12', - 'ast-col-lg-1', - 'ast-col-lg-2', - 'ast-col-lg-3', - 'ast-col-lg-4', - 'ast-col-lg-5', - 'ast-col-lg-6', - 'ast-col-lg-7', - 'ast-col-lg-8', - 'ast-col-lg-9', - 'ast-col-lg-10', - 'ast-col-lg-11', - 'ast-col-lg-12', - 'ast-col-xl-1', - 'ast-col-xl-2', - 'ast-col-xl-3', - 'ast-col-xl-4', - 'ast-col-xl-5', - 'ast-col-xl-6', - 'ast-col-xl-7', - 'ast-col-xl-8', - 'ast-col-xl-9', - 'ast-col-xl-10', - 'ast-col-xl-11', - 'ast-col-xl-12', - - // Astra Blog / Single Post. - 'ast-article-post', - 'ast-article-single', - 'ast-separate-posts', - 'remove-featured-img-padding', - 'ast-featured-post', - - // Astra Woocommerce. - 'ast-product-gallery-layout-vertical', - 'ast-product-gallery-layout-horizontal', - 'ast-product-gallery-with-no-image', - - 'ast-product-tabs-layout-vertical', - 'ast-product-tabs-layout-horizontal', - - 'ast-qv-disabled', - 'ast-qv-on-image', - 'ast-qv-on-image-click', - 'ast-qv-after-summary', - - 'astra-woo-hover-swap', - - 'box-shadow-0', - 'box-shadow-0-hover', - 'box-shadow-1', - 'box-shadow-1-hover', - 'box-shadow-2', - 'box-shadow-2-hover', - 'box-shadow-3', - 'box-shadow-3-hover', - 'box-shadow-4', - 'box-shadow-4-hover', - 'box-shadow-5', - 'box-shadow-5-hover', - ) - ); - - add_filter( 'astra_post_link_enabled', '__return_false' ); - } - - return $classes; - } - - /** - * Function to add Theme Support - * - * @since 1.0.0 - */ - public function header_footer_support() { - - add_theme_support( 'fl-theme-builder-headers' ); - add_theme_support( 'fl-theme-builder-footers' ); - add_theme_support( 'fl-theme-builder-parts' ); - } - - /** - * Function to update Atra header/footer with Beaver template - * - * @since 1.0.0 - */ - public function theme_header_footer_render() { - - // Get the header ID. - $header_ids = FLThemeBuilderLayoutData::get_current_page_header_ids(); - - // If we have a header, remove the theme header and hook in Theme Builder's. - if ( ! empty( $header_ids ) ) { - remove_action( 'astra_header', 'astra_header_markup' ); - add_action( 'astra_header', 'FLThemeBuilderLayoutRenderer::render_header' ); - } - - // Get the footer ID. - $footer_ids = FLThemeBuilderLayoutData::get_current_page_footer_ids(); - - // If we have a footer, remove the theme footer and hook in Theme Builder's. - if ( ! empty( $footer_ids ) ) { - remove_action( 'astra_footer', 'astra_footer_markup' ); - add_action( 'astra_footer', 'FLThemeBuilderLayoutRenderer::render_footer' ); - } - - // BB Themer Support. - $template_ids = FLThemeBuilderLayoutData::get_current_page_content_ids(); - - if ( ! empty( $template_ids ) ) { - - $template_id = $template_ids[0]; - $template_type = get_post_meta( $template_id, '_fl_theme_layout_type', true ); - - if ( 'archive' === $template_type || 'singular' === $template_type || '404' === $template_type ) { - - $sidebar = get_post_meta( $template_id, 'site-sidebar-layout', true ); - - if ( 'default' !== $sidebar ) { - add_filter( - 'astra_page_layout', - function( $page_layout ) use ( $sidebar ) { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found - - return $sidebar; - } - ); - } - - $content_layout = get_post_meta( $template_id, 'site-content-layout', true ); - if ( 'default' !== $content_layout ) { - add_filter( - 'astra_get_content_layout', - function( $layout ) use ( $content_layout ) {// phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found - - return $content_layout; - } - ); - } - - $main_header_display = get_post_meta( $template_id, 'ast-main-header-display', true ); - if ( 'disabled' === $main_header_display ) { - - if ( 'archive' === $template_type ) { - remove_action( 'astra_masthead', 'astra_masthead_primary_template' ); - } else { - add_filter( - 'ast_main_header_display', - function( $display_header ) {// phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found - - return 'disabled'; - } - ); - } - } - - $footer_layout = get_post_meta( $template_id, 'footer-sml-layout', true ); - if ( 'disabled' === $footer_layout ) { - - add_filter( - 'ast_footer_sml_layout', - function( $is_footer ) {// phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found - - return 'disabled'; - } - ); - } - - // Override! Footer Widgets. - $footer_widgets = get_post_meta( $template_id, 'footer-adv-display', true ); - if ( 'disabled' === $footer_widgets ) { - add_filter( 'astra_advanced_footer_disable', '__return_true' ); - } - } - } - } - - /** - * Function to Astra theme parts - * - * @since 1.0.0 - */ - public function register_part_hooks() { - - return array( - array( - 'label' => 'Page', - 'hooks' => array( - 'astra_body_top' => __( 'Before Page', 'astra' ), - 'astra_body_bottom' => __( 'After Page', 'astra' ), - ), - ), - array( - 'label' => 'Header', - 'hooks' => array( - 'astra_header_before' => __( 'Before Header', 'astra' ), - 'astra_header_after' => __( 'After Header', 'astra' ), - ), - ), - array( - 'label' => 'Content', - 'hooks' => array( - 'astra_primary_content_top' => __( 'Before Content', 'astra' ), - 'astra_primary_content_bottom' => __( 'After Content', 'astra' ), - ), - ), - array( - 'label' => 'Footer', - 'hooks' => array( - 'astra_footer_before' => __( 'Before Footer', 'astra' ), - 'astra_footer_after' => __( 'After Footer', 'astra' ), - ), - ), - array( - 'label' => 'Sidebar', - 'hooks' => array( - 'astra_sidebars_before' => __( 'Before Sidebar', 'astra' ), - 'astra_sidebars_after' => __( 'After Sidebar', 'astra' ), - ), - ), - array( - 'label' => 'Posts', - 'hooks' => array( - 'loop_start' => __( 'Loop Start', 'astra' ), - 'astra_entry_top' => __( 'Before Post', 'astra' ), - 'astra_entry_content_before' => __( 'Before Post Content', 'astra' ), - 'astra_entry_content_after' => __( 'After Post Content', 'astra' ), - 'astra_entry_bottom' => __( 'After Post', 'astra' ), - 'astra_comments_before' => __( 'Before Comments', 'astra' ), - 'astra_comments_after' => __( 'After Comments', 'astra' ), - 'loop_end' => __( 'Loop End', 'astra' ), - ), - ), - ); - } - - /** - * Function to theme before render content - * - * @param int $post_id Post ID. - * @since 1.0.28 - */ - public function builder_before_render_content( $post_id ) { - - ?> - - - - - - -
    > - -
    - - - - - - - - 0 ) { + $classes = array_diff( + $classes, + array( + // Astra common grid. + 'ast-col-xs-1', + 'ast-col-xs-2', + 'ast-col-xs-3', + 'ast-col-xs-4', + 'ast-col-xs-5', + 'ast-col-xs-6', + 'ast-col-xs-7', + 'ast-col-xs-8', + 'ast-col-xs-9', + 'ast-col-xs-10', + 'ast-col-xs-11', + 'ast-col-xs-12', + 'ast-col-sm-1', + 'ast-col-sm-2', + 'ast-col-sm-3', + 'ast-col-sm-4', + 'ast-col-sm-5', + 'ast-col-sm-6', + 'ast-col-sm-7', + 'ast-col-sm-8', + 'ast-col-sm-9', + 'ast-col-sm-10', + 'ast-col-sm-11', + 'ast-col-sm-12', + 'ast-col-md-1', + 'ast-col-md-2', + 'ast-col-md-3', + 'ast-col-md-4', + 'ast-col-md-5', + 'ast-col-md-6', + 'ast-col-md-7', + 'ast-col-md-8', + 'ast-col-md-9', + 'ast-col-md-10', + 'ast-col-md-11', + 'ast-col-md-12', + 'ast-col-lg-1', + 'ast-col-lg-2', + 'ast-col-lg-3', + 'ast-col-lg-4', + 'ast-col-lg-5', + 'ast-col-lg-6', + 'ast-col-lg-7', + 'ast-col-lg-8', + 'ast-col-lg-9', + 'ast-col-lg-10', + 'ast-col-lg-11', + 'ast-col-lg-12', + 'ast-col-xl-1', + 'ast-col-xl-2', + 'ast-col-xl-3', + 'ast-col-xl-4', + 'ast-col-xl-5', + 'ast-col-xl-6', + 'ast-col-xl-7', + 'ast-col-xl-8', + 'ast-col-xl-9', + 'ast-col-xl-10', + 'ast-col-xl-11', + 'ast-col-xl-12', + + // Astra Blog / Single Post. + 'ast-article-post', + 'ast-article-single', + 'ast-separate-posts', + 'remove-featured-img-padding', + 'ast-featured-post', + + // Astra Woocommerce. + 'ast-product-gallery-layout-vertical', + 'ast-product-gallery-layout-horizontal', + 'ast-product-gallery-with-no-image', + + 'ast-product-tabs-layout-vertical', + 'ast-product-tabs-layout-horizontal', + + 'ast-qv-disabled', + 'ast-qv-on-image', + 'ast-qv-on-image-click', + 'ast-qv-after-summary', + + 'astra-woo-hover-swap', + + 'box-shadow-0', + 'box-shadow-0-hover', + 'box-shadow-1', + 'box-shadow-1-hover', + 'box-shadow-2', + 'box-shadow-2-hover', + 'box-shadow-3', + 'box-shadow-3-hover', + 'box-shadow-4', + 'box-shadow-4-hover', + 'box-shadow-5', + 'box-shadow-5-hover', + ) + ); + + add_filter( 'astra_post_link_enabled', '__return_false' ); + } + + return $classes; + } + + /** + * Function to add Theme Support + * + * @since 1.0.0 + */ + public function header_footer_support() { + + add_theme_support( 'fl-theme-builder-headers' ); + add_theme_support( 'fl-theme-builder-footers' ); + add_theme_support( 'fl-theme-builder-parts' ); + } + + /** + * Function to update Atra header/footer with Beaver template + * + * @since 1.0.0 + */ + public function theme_header_footer_render() { + + // Get the header ID. + $header_ids = FLThemeBuilderLayoutData::get_current_page_header_ids(); + + // If we have a header, remove the theme header and hook in Theme Builder's. + if ( ! empty( $header_ids ) ) { + remove_action( 'astra_header', 'astra_header_markup' ); + add_action( 'astra_header', 'FLThemeBuilderLayoutRenderer::render_header' ); + } + + // Get the footer ID. + $footer_ids = FLThemeBuilderLayoutData::get_current_page_footer_ids(); + + // If we have a footer, remove the theme footer and hook in Theme Builder's. + if ( ! empty( $footer_ids ) ) { + remove_action( 'astra_footer', 'astra_footer_markup' ); + add_action( 'astra_footer', 'FLThemeBuilderLayoutRenderer::render_footer' ); + } + + // BB Themer Support. + $template_ids = FLThemeBuilderLayoutData::get_current_page_content_ids(); + + if ( ! empty( $template_ids ) ) { + + $template_id = $template_ids[0]; + $template_type = get_post_meta( $template_id, '_fl_theme_layout_type', true ); + + if ( 'archive' === $template_type || 'singular' === $template_type || '404' === $template_type ) { + + $sidebar = get_post_meta( $template_id, 'site-sidebar-layout', true ); + + if ( 'default' !== $sidebar ) { + add_filter( + 'astra_page_layout', + function( $page_layout ) use ( $sidebar ) { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found + + return $sidebar; + } + ); + } + + $content_layout = get_post_meta( $template_id, 'site-content-layout', true ); + if ( 'default' !== $content_layout ) { + add_filter( + 'astra_get_content_layout', + function( $layout ) use ( $content_layout ) {// phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found + + return $content_layout; + } + ); + } + + $main_header_display = get_post_meta( $template_id, 'ast-main-header-display', true ); + if ( 'disabled' === $main_header_display ) { + + if ( 'archive' === $template_type ) { + remove_action( 'astra_masthead', 'astra_masthead_primary_template' ); + } else { + add_filter( + 'ast_main_header_display', + function( $display_header ) {// phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found + + return 'disabled'; + } + ); + } + } + + $footer_layout = get_post_meta( $template_id, 'footer-sml-layout', true ); + if ( 'disabled' === $footer_layout ) { + + add_filter( + 'ast_footer_sml_layout', + function( $is_footer ) {// phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found + + return 'disabled'; + } + ); + } + + // Override! Footer Widgets. + $footer_widgets = get_post_meta( $template_id, 'footer-adv-display', true ); + if ( 'disabled' === $footer_widgets ) { + add_filter( 'astra_advanced_footer_disable', '__return_true' ); + } + } + } + } + + /** + * Function to Astra theme parts + * + * @since 1.0.0 + */ + public function register_part_hooks() { + + return array( + array( + 'label' => 'Page', + 'hooks' => array( + 'astra_body_top' => __( 'Before Page', 'astra' ), + 'astra_body_bottom' => __( 'After Page', 'astra' ), + ), + ), + array( + 'label' => 'Header', + 'hooks' => array( + 'astra_header_before' => __( 'Before Header', 'astra' ), + 'astra_header_after' => __( 'After Header', 'astra' ), + ), + ), + array( + 'label' => 'Content', + 'hooks' => array( + 'astra_primary_content_top' => __( 'Before Content', 'astra' ), + 'astra_primary_content_bottom' => __( 'After Content', 'astra' ), + ), + ), + array( + 'label' => 'Footer', + 'hooks' => array( + 'astra_footer_before' => __( 'Before Footer', 'astra' ), + 'astra_footer_after' => __( 'After Footer', 'astra' ), + ), + ), + array( + 'label' => 'Sidebar', + 'hooks' => array( + 'astra_sidebars_before' => __( 'Before Sidebar', 'astra' ), + 'astra_sidebars_after' => __( 'After Sidebar', 'astra' ), + ), + ), + array( + 'label' => 'Posts', + 'hooks' => array( + 'loop_start' => __( 'Loop Start', 'astra' ), + 'astra_entry_top' => __( 'Before Post', 'astra' ), + 'astra_entry_content_before' => __( 'Before Post Content', 'astra' ), + 'astra_entry_content_after' => __( 'After Post Content', 'astra' ), + 'astra_entry_bottom' => __( 'After Post', 'astra' ), + 'astra_comments_before' => __( 'Before Comments', 'astra' ), + 'astra_comments_after' => __( 'After Comments', 'astra' ), + 'loop_end' => __( 'Loop End', 'astra' ), + ), + ), + ); + } + + /** + * Function to theme before render content + * + * @param int $post_id Post ID. + * @since 1.0.28 + */ + public function builder_before_render_content( $post_id ) { + + ?> + + + + + + +
    > + +
    + + + + + + + + register_all_core_location(); - } - - /** - * Template Parts Support - * - * @since 1.2.7 - * @return void - */ - public function do_template_parts() { - // Is Archive? - $did_location = Module::instance()->get_locations_manager()->do_location( 'archive' ); - if ( $did_location ) { - // Search and default. - remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_search' ) );// phpcs:ignore PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound - remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_default' ) );// phpcs:ignore PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound - - // Remove pagination. - remove_action( 'astra_pagination', 'astra_number_pagination' ); - remove_action( 'astra_entry_after', 'astra_single_post_navigation_markup' ); - - // Content. - remove_action( 'astra_entry_content_single', 'astra_entry_content_single_template' ); - } - - // IS Single? - $did_location = Module::instance()->get_locations_manager()->do_location( 'single' ); - if ( $did_location ) { - - // @codingStandardsIgnoreStart PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound - remove_action( 'astra_page_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_page' ) ); - remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_post' ) ); - remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_comments' ), 15 ); - remove_action( 'astra_page_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_comments' ), 15 ); - // @codingStandardsIgnoreEnd PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound - } - } - - /** - * Override 404 page - * - * @since 1.2.7 - * @return void - */ - public function do_template_part_404() { - if ( is_404() ) { - - // Is Single? - $did_location = Module::instance()->get_locations_manager()->do_location( 'single' ); - if ( $did_location ) { - remove_action( 'astra_entry_content_404_page', 'astra_entry_content_404_page_template' ); - } - } - } - - /** - * Override sidebar, title etc with post meta - * - * @since 1.2.7 - * @return void - */ - public function override_meta() { - - // don't override meta for `elementor_library` post type. - if ( 'elementor_library' == get_post_type() ) { - return; - } - - // Override post meta for single pages. - $documents_single = Module::instance()->get_conditions_manager()->get_documents_for_location( 'single' ); - if ( $documents_single ) { - foreach ( $documents_single as $document ) { - $this->override_with_post_meta( $document->get_post()->ID ); - } - } - - // Override post meta for archive pages. - $documents_archive = Module::instance()->get_conditions_manager()->get_documents_for_location( 'archive' ); - if ( $documents_archive ) { - foreach ( $documents_archive as $document ) { - $this->override_with_post_meta( $document->get_post()->ID ); - } - } - } - - /** - * Override sidebar, title etc with post meta - * - * @since 1.2.7 - * @param integer $post_id Post ID. - * @return void - */ - public function override_with_post_meta( $post_id = 0 ) { - // Override! Page Title. - $title = get_post_meta( $post_id, 'site-post-title', true ); - if ( 'disabled' === $title ) { - - // Archive page. - add_filter( 'astra_the_title_enabled', '__return_false', 99 ); - - // Single page. - add_filter( 'astra_the_title_enabled', '__return_false' ); - remove_action( 'astra_archive_header', 'astra_archive_page_info' ); - } - - // Override! Sidebar. - $sidebar = get_post_meta( $post_id, 'site-sidebar-layout', true ); - if ( '' === $sidebar ) { - $sidebar = 'default'; - } - - // @codingStandardsIgnoreStart PHPCompatibility.FunctionDeclarations.NewClosure.Found - - if ( 'default' !== $sidebar ) { - add_filter( - 'astra_page_layout', - function( $page_layout ) use ( $sidebar ) { - return $sidebar; - } - ); - } - - // Override! Content Layout. - $content_layout = get_post_meta( $post_id, 'site-content-layout', true ); - if ( '' === $content_layout ) { - $content_layout = 'default'; - } - - if ( 'default' !== $content_layout ) { - add_filter( - 'astra_get_content_layout', - function( $layout ) use ( $content_layout ) { - return $content_layout; - } - ); - } - - // Override! Footer Bar. - $footer_layout = get_post_meta( $post_id, 'footer-sml-layout', true ); - if ( '' === $footer_layout ) { - $footer_layout = 'default'; - } - - if ( 'disabled' === $footer_layout ) { - add_filter( - 'ast_footer_sml_layout', - function( $is_footer ) { - return 'disabled'; - } - ); - } - - // Override! Footer Widgets. - $footer_widgets = get_post_meta( $post_id, 'footer-adv-display', true ); - if ( '' === $footer_widgets ) { - $footer_widgets = 'default'; - } - - if ( 'disabled' === $footer_widgets ) { - add_filter( - 'astra_advanced_footer_disable', - function() { - return true; - } - ); - } - - // Override! Header. - $main_header_display = get_post_meta( $post_id, 'ast-main-header-display', true ); - if ( '' === $main_header_display ) { - $main_header_display = 'default'; - } - - if ( 'disabled' === $main_header_display ) { - remove_action( 'astra_masthead', 'astra_masthead_primary_template' ); - add_filter( - 'ast_main_header_display', - function( $display_header ) { - return 'disabled'; - } - ); - } - // @codingStandardsIgnoreEnd PHPCompatibility.FunctionDeclarations.NewClosure.Found - } - - /** - * Header Support - * - * @since 1.2.7 - * @return void - */ - public function do_header() { - $did_location = Module::instance()->get_locations_manager()->do_location( 'header' ); - if ( $did_location ) { - remove_action( 'astra_header', 'astra_header_markup' ); - } - } - - /** - * Footer Support - * - * @since 1.2.7 - * @return void - */ - public function do_footer() { - $did_location = Module::instance()->get_locations_manager()->do_location( 'footer' ); - if ( $did_location ) { - remove_action( 'astra_footer', 'astra_footer_markup' ); - } - } - - /** - * Remove theme post's default classes when Elementor's template builder is activated. - * - * @param array $classes Post Classes. - * @return array - * @since 1.4.9 - */ - public function render_post_class( $classes ) { - $post_class = array( 'elementor-post elementor-grid-item', 'elementor-portfolio-item' ); - $result = array_intersect( $classes, $post_class ); - - if ( count( $result ) > 0 ) { - $classes = array_diff( - $classes, - array( - // Astra common grid. - 'ast-col-xs-1', - 'ast-col-xs-2', - 'ast-col-xs-3', - 'ast-col-xs-4', - 'ast-col-xs-5', - 'ast-col-xs-6', - 'ast-col-xs-7', - 'ast-col-xs-8', - 'ast-col-xs-9', - 'ast-col-xs-10', - 'ast-col-xs-11', - 'ast-col-xs-12', - 'ast-col-sm-1', - 'ast-col-sm-2', - 'ast-col-sm-3', - 'ast-col-sm-4', - 'ast-col-sm-5', - 'ast-col-sm-6', - 'ast-col-sm-7', - 'ast-col-sm-8', - 'ast-col-sm-9', - 'ast-col-sm-10', - 'ast-col-sm-11', - 'ast-col-sm-12', - 'ast-col-md-1', - 'ast-col-md-2', - 'ast-col-md-3', - 'ast-col-md-4', - 'ast-col-md-5', - 'ast-col-md-6', - 'ast-col-md-7', - 'ast-col-md-8', - 'ast-col-md-9', - 'ast-col-md-10', - 'ast-col-md-11', - 'ast-col-md-12', - 'ast-col-lg-1', - 'ast-col-lg-2', - 'ast-col-lg-3', - 'ast-col-lg-4', - 'ast-col-lg-5', - 'ast-col-lg-6', - 'ast-col-lg-7', - 'ast-col-lg-8', - 'ast-col-lg-9', - 'ast-col-lg-10', - 'ast-col-lg-11', - 'ast-col-lg-12', - 'ast-col-xl-1', - 'ast-col-xl-2', - 'ast-col-xl-3', - 'ast-col-xl-4', - 'ast-col-xl-5', - 'ast-col-xl-6', - 'ast-col-xl-7', - 'ast-col-xl-8', - 'ast-col-xl-9', - 'ast-col-xl-10', - 'ast-col-xl-11', - 'ast-col-xl-12', - - // Astra Blog / Single Post. - 'ast-article-post', - 'ast-article-single', - 'ast-separate-posts', - 'remove-featured-img-padding', - 'ast-featured-post', - - // Astra Woocommerce. - 'ast-product-gallery-layout-vertical', - 'ast-product-gallery-layout-horizontal', - 'ast-product-gallery-with-no-image', - - 'ast-product-tabs-layout-vertical', - 'ast-product-tabs-layout-horizontal', - - 'ast-qv-disabled', - 'ast-qv-on-image', - 'ast-qv-on-image-click', - 'ast-qv-after-summary', - - 'astra-woo-hover-swap', - - 'box-shadow-0', - 'box-shadow-0-hover', - 'box-shadow-1', - 'box-shadow-1-hover', - 'box-shadow-2', - 'box-shadow-2-hover', - 'box-shadow-3', - 'box-shadow-3-hover', - 'box-shadow-4', - 'box-shadow-4-hover', - 'box-shadow-5', - 'box-shadow-5-hover', - ) - ); - } - - return $classes; - } - - } - - /** - * Kicking this off by calling 'get_instance()' method - */ - Astra_Elementor_Pro::get_instance(); - -endif; +register_all_core_location(); + } + + /** + * Template Parts Support + * + * @since 1.2.7 + * @return void + */ + public function do_template_parts() { + // Is Archive? + $did_location = Module::instance()->get_locations_manager()->do_location( 'archive' ); + if ( $did_location ) { + // Search and default. + remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_search' ) );// phpcs:ignore PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound + remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_default' ) );// phpcs:ignore PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound + + // Remove pagination. + remove_action( 'astra_pagination', 'astra_number_pagination' ); + remove_action( 'astra_entry_after', 'astra_single_post_navigation_markup' ); + + // Content. + remove_action( 'astra_entry_content_single', 'astra_entry_content_single_template' ); + } + + // IS Single? + $did_location = Module::instance()->get_locations_manager()->do_location( 'single' ); + if ( $did_location ) { + + // @codingStandardsIgnoreStart PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound + remove_action( 'astra_page_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_page' ) ); + remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_post' ) ); + remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_comments' ), 15 ); + remove_action( 'astra_page_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_comments' ), 15 ); + // @codingStandardsIgnoreEnd PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound + } + } + + /** + * Override 404 page + * + * @since 1.2.7 + * @return void + */ + public function do_template_part_404() { + if ( is_404() ) { + + // Is Single? + $did_location = Module::instance()->get_locations_manager()->do_location( 'single' ); + if ( $did_location ) { + remove_action( 'astra_entry_content_404_page', 'astra_entry_content_404_page_template' ); + } + } + } + + /** + * Override sidebar, title etc with post meta + * + * @since 1.2.7 + * @return void + */ + public function override_meta() { + + // don't override meta for `elementor_library` post type. + if ( 'elementor_library' == get_post_type() ) { + return; + } + + // Override post meta for single pages. + $documents_single = Module::instance()->get_conditions_manager()->get_documents_for_location( 'single' ); + if ( $documents_single ) { + foreach ( $documents_single as $document ) { + $this->override_with_post_meta( $document->get_post()->ID ); + } + } + + // Override post meta for archive pages. + $documents_archive = Module::instance()->get_conditions_manager()->get_documents_for_location( 'archive' ); + if ( $documents_archive ) { + foreach ( $documents_archive as $document ) { + $this->override_with_post_meta( $document->get_post()->ID ); + } + } + } + + /** + * Override sidebar, title etc with post meta + * + * @since 1.2.7 + * @param integer $post_id Post ID. + * @return void + */ + public function override_with_post_meta( $post_id = 0 ) { + // Override! Page Title. + $title = get_post_meta( $post_id, 'site-post-title', true ); + if ( 'disabled' === $title ) { + + // Archive page. + add_filter( 'astra_the_title_enabled', '__return_false', 99 ); + + // Single page. + add_filter( 'astra_the_title_enabled', '__return_false' ); + remove_action( 'astra_archive_header', 'astra_archive_page_info' ); + } + + // Override! Sidebar. + $sidebar = get_post_meta( $post_id, 'site-sidebar-layout', true ); + if ( '' === $sidebar ) { + $sidebar = 'default'; + } + + // @codingStandardsIgnoreStart PHPCompatibility.FunctionDeclarations.NewClosure.Found + + if ( 'default' !== $sidebar ) { + add_filter( + 'astra_page_layout', + function( $page_layout ) use ( $sidebar ) { + return $sidebar; + } + ); + } + + // Override! Content Layout. + $content_layout = get_post_meta( $post_id, 'site-content-layout', true ); + if ( '' === $content_layout ) { + $content_layout = 'default'; + } + + if ( 'default' !== $content_layout ) { + add_filter( + 'astra_get_content_layout', + function( $layout ) use ( $content_layout ) { + return $content_layout; + } + ); + } + + // Override! Footer Bar. + $footer_layout = get_post_meta( $post_id, 'footer-sml-layout', true ); + if ( '' === $footer_layout ) { + $footer_layout = 'default'; + } + + if ( 'disabled' === $footer_layout ) { + add_filter( + 'ast_footer_sml_layout', + function( $is_footer ) { + return 'disabled'; + } + ); + } + + // Override! Footer Widgets. + $footer_widgets = get_post_meta( $post_id, 'footer-adv-display', true ); + if ( '' === $footer_widgets ) { + $footer_widgets = 'default'; + } + + if ( 'disabled' === $footer_widgets ) { + add_filter( + 'astra_advanced_footer_disable', + function() { + return true; + } + ); + } + + // Override! Header. + $main_header_display = get_post_meta( $post_id, 'ast-main-header-display', true ); + if ( '' === $main_header_display ) { + $main_header_display = 'default'; + } + + if ( 'disabled' === $main_header_display ) { + remove_action( 'astra_masthead', 'astra_masthead_primary_template' ); + add_filter( + 'ast_main_header_display', + function( $display_header ) { + return 'disabled'; + } + ); + } + // @codingStandardsIgnoreEnd PHPCompatibility.FunctionDeclarations.NewClosure.Found + } + + /** + * Header Support + * + * @since 1.2.7 + * @return void + */ + public function do_header() { + $did_location = Module::instance()->get_locations_manager()->do_location( 'header' ); + if ( $did_location ) { + remove_action( 'astra_header', 'astra_header_markup' ); + } + } + + /** + * Footer Support + * + * @since 1.2.7 + * @return void + */ + public function do_footer() { + $did_location = Module::instance()->get_locations_manager()->do_location( 'footer' ); + if ( $did_location ) { + remove_action( 'astra_footer', 'astra_footer_markup' ); + } + } + + /** + * Remove theme post's default classes when Elementor's template builder is activated. + * + * @param array $classes Post Classes. + * @return array + * @since 1.4.9 + */ + public function render_post_class( $classes ) { + $post_class = array( 'elementor-post elementor-grid-item', 'elementor-portfolio-item' ); + $result = array_intersect( $classes, $post_class ); + + if ( count( $result ) > 0 ) { + $classes = array_diff( + $classes, + array( + // Astra common grid. + 'ast-col-xs-1', + 'ast-col-xs-2', + 'ast-col-xs-3', + 'ast-col-xs-4', + 'ast-col-xs-5', + 'ast-col-xs-6', + 'ast-col-xs-7', + 'ast-col-xs-8', + 'ast-col-xs-9', + 'ast-col-xs-10', + 'ast-col-xs-11', + 'ast-col-xs-12', + 'ast-col-sm-1', + 'ast-col-sm-2', + 'ast-col-sm-3', + 'ast-col-sm-4', + 'ast-col-sm-5', + 'ast-col-sm-6', + 'ast-col-sm-7', + 'ast-col-sm-8', + 'ast-col-sm-9', + 'ast-col-sm-10', + 'ast-col-sm-11', + 'ast-col-sm-12', + 'ast-col-md-1', + 'ast-col-md-2', + 'ast-col-md-3', + 'ast-col-md-4', + 'ast-col-md-5', + 'ast-col-md-6', + 'ast-col-md-7', + 'ast-col-md-8', + 'ast-col-md-9', + 'ast-col-md-10', + 'ast-col-md-11', + 'ast-col-md-12', + 'ast-col-lg-1', + 'ast-col-lg-2', + 'ast-col-lg-3', + 'ast-col-lg-4', + 'ast-col-lg-5', + 'ast-col-lg-6', + 'ast-col-lg-7', + 'ast-col-lg-8', + 'ast-col-lg-9', + 'ast-col-lg-10', + 'ast-col-lg-11', + 'ast-col-lg-12', + 'ast-col-xl-1', + 'ast-col-xl-2', + 'ast-col-xl-3', + 'ast-col-xl-4', + 'ast-col-xl-5', + 'ast-col-xl-6', + 'ast-col-xl-7', + 'ast-col-xl-8', + 'ast-col-xl-9', + 'ast-col-xl-10', + 'ast-col-xl-11', + 'ast-col-xl-12', + + // Astra Blog / Single Post. + 'ast-article-post', + 'ast-article-single', + 'ast-separate-posts', + 'remove-featured-img-padding', + 'ast-featured-post', + + // Astra Woocommerce. + 'ast-product-gallery-layout-vertical', + 'ast-product-gallery-layout-horizontal', + 'ast-product-gallery-with-no-image', + + 'ast-product-tabs-layout-vertical', + 'ast-product-tabs-layout-horizontal', + + 'ast-qv-disabled', + 'ast-qv-on-image', + 'ast-qv-on-image-click', + 'ast-qv-after-summary', + + 'astra-woo-hover-swap', + + 'box-shadow-0', + 'box-shadow-0-hover', + 'box-shadow-1', + 'box-shadow-1-hover', + 'box-shadow-2', + 'box-shadow-2-hover', + 'box-shadow-3', + 'box-shadow-3-hover', + 'box-shadow-4', + 'box-shadow-4-hover', + 'box-shadow-5', + 'box-shadow-5-hover', + ) + ); + } + + return $classes; + } + + } + + /** + * Kicking this off by calling 'get_instance()' method + */ + Astra_Elementor_Pro::get_instance(); + +endif; diff --git a/inc/compatibility/class-astra-elementor.php b/inc/compatibility/class-astra-elementor.php index 9008865..2361eb7 100644 --- a/inc/compatibility/class-astra-elementor.php +++ b/inc/compatibility/class-astra-elementor.php @@ -1,254 +1,254 @@ -is_elementor_activated( $id ) ) { - - $elementor_heading_margin_comp = array( - '.elementor-widget-heading .elementor-heading-title' => array( - 'margin' => '0', - ), - ); - - /* Parse CSS from array() */ - $parse_css = astra_parse_css( $elementor_heading_margin_comp ); - - $elementor_base_css = array( - '.elementor-post.elementor-grid-item.hentry' => array( - 'margin-bottom' => '0', - ), - '.woocommerce div.product .elementor-element.elementor-products-grid .related.products ul.products li.product, .elementor-element .elementor-wc-products .woocommerce[class*=\'columns-\'] ul.products li.product' => array( - 'width' => 'auto', - 'margin' => '0', - 'float' => 'none', - ), - ); - // Load base static CSS when Elmentor is activated. - $parse_css .= astra_parse_css( $elementor_base_css ); - - if ( is_rtl() ) { - $elementor_rtl_support_css = array( - '.ast-left-sidebar .elementor-section.elementor-section-stretched,.ast-right-sidebar .elementor-section.elementor-section-stretched' => array( - 'max-width' => '100%', - 'right' => '0 !important', - ), - ); - } else { - $elementor_rtl_support_css = array( - '.ast-left-sidebar .elementor-section.elementor-section-stretched,.ast-right-sidebar .elementor-section.elementor-section-stretched' => array( - 'max-width' => '100%', - 'left' => '0 !important', - ), - ); - } - $parse_css .= astra_parse_css( $elementor_rtl_support_css ); - - - $dynamic_css .= $parse_css; - } - - $elementor_archive_page_css = array( - '.elementor-template-full-width .ast-container' => array( - 'display' => 'block', - ), - ); - $dynamic_css .= astra_parse_css( $elementor_archive_page_css ); - - return $dynamic_css; - } - - /** - * Elementor Content layout set as Page Builder - * - * @return void - * @since 1.0.2 - */ - public function elementor_default_setting() { - - if ( false === astra_enable_page_builder_compatibility() || 'post' == get_post_type() ) { - return; - } - - // don't modify post meta settings if we are not on Elementor's edit page. - if ( ! $this->is_elementor_editor() ) { - return; - } - - global $post; - $id = astra_get_post_id(); - - $page_builder_flag = get_post_meta( $id, '_astra_content_layout_flag', true ); - if ( isset( $post ) && empty( $page_builder_flag ) && ( is_admin() || is_singular() ) ) { - - if ( empty( $post->post_content ) && $this->is_elementor_activated( $id ) ) { - - update_post_meta( $id, '_astra_content_layout_flag', 'disabled' ); - update_post_meta( $id, 'site-post-title', 'disabled' ); - update_post_meta( $id, 'ast-title-bar-display', 'disabled' ); - update_post_meta( $id, 'ast-featured-img', 'disabled' ); - - $content_layout = get_post_meta( $id, 'site-content-layout', true ); - if ( empty( $content_layout ) || 'default' == $content_layout ) { - update_post_meta( $id, 'site-content-layout', 'page-builder' ); - } - - $sidebar_layout = get_post_meta( $id, 'site-sidebar-layout', true ); - if ( empty( $sidebar_layout ) || 'default' == $sidebar_layout ) { - update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' ); - } - - // In the preview mode, Apply the layouts using filters for Elementor Template Library. - add_filter( - 'astra_page_layout', - function() { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found - return 'no-sidebar'; - } - ); - - add_filter( - 'astra_get_content_layout', - function () { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found - return 'page-builder'; - } - ); - - add_filter( 'astra_the_post_title_enabled', '__return_false' ); - add_filter( 'astra_featured_image_enabled', '__return_false' ); - } - } - } - - /** - * Add z-index CSS for elementor's drag drop - * - * @return void - * @since 1.4.0 - */ - public function elementor_overlay_zindex() { - - // return if we are not on Elementor's edit page. - if ( ! $this->is_elementor_editor() ) { - return; - } - - ?> - - - db->get_edit_mode( $id ) ); - } else { - return Plugin::$instance->db->is_built_with_elementor( $id ); - } - } - - /** - * Check if Elementor Editor is open. - * - * @since 1.2.7 - * - * @return boolean True IF Elementor Editor is loaded, False If Elementor Editor is not loaded. - */ - private function is_elementor_editor() { - if ( ( isset( $_REQUEST['action'] ) && 'elementor' == $_REQUEST['action'] ) || isset( $_REQUEST['elementor-preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended - return true; - } - - return false; - } - - } - -endif; - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_Elementor::get_instance(); +is_elementor_activated( $id ) ) { + + $elementor_heading_margin_comp = array( + '.elementor-widget-heading .elementor-heading-title' => array( + 'margin' => '0', + ), + ); + + /* Parse CSS from array() */ + $parse_css = astra_parse_css( $elementor_heading_margin_comp ); + + $elementor_base_css = array( + '.elementor-post.elementor-grid-item.hentry' => array( + 'margin-bottom' => '0', + ), + '.woocommerce div.product .elementor-element.elementor-products-grid .related.products ul.products li.product, .elementor-element .elementor-wc-products .woocommerce[class*=\'columns-\'] ul.products li.product' => array( + 'width' => 'auto', + 'margin' => '0', + 'float' => 'none', + ), + ); + // Load base static CSS when Elmentor is activated. + $parse_css .= astra_parse_css( $elementor_base_css ); + + if ( is_rtl() ) { + $elementor_rtl_support_css = array( + '.ast-left-sidebar .elementor-section.elementor-section-stretched,.ast-right-sidebar .elementor-section.elementor-section-stretched' => array( + 'max-width' => '100%', + 'right' => '0 !important', + ), + ); + } else { + $elementor_rtl_support_css = array( + '.ast-left-sidebar .elementor-section.elementor-section-stretched,.ast-right-sidebar .elementor-section.elementor-section-stretched' => array( + 'max-width' => '100%', + 'left' => '0 !important', + ), + ); + } + $parse_css .= astra_parse_css( $elementor_rtl_support_css ); + + + $dynamic_css .= $parse_css; + } + + $elementor_archive_page_css = array( + '.elementor-template-full-width .ast-container' => array( + 'display' => 'block', + ), + ); + $dynamic_css .= astra_parse_css( $elementor_archive_page_css ); + + return $dynamic_css; + } + + /** + * Elementor Content layout set as Page Builder + * + * @return void + * @since 1.0.2 + */ + public function elementor_default_setting() { + + if ( false === astra_enable_page_builder_compatibility() || 'post' == get_post_type() ) { + return; + } + + // don't modify post meta settings if we are not on Elementor's edit page. + if ( ! $this->is_elementor_editor() ) { + return; + } + + global $post; + $id = astra_get_post_id(); + + $page_builder_flag = get_post_meta( $id, '_astra_content_layout_flag', true ); + if ( isset( $post ) && empty( $page_builder_flag ) && ( is_admin() || is_singular() ) ) { + + if ( empty( $post->post_content ) && $this->is_elementor_activated( $id ) ) { + + update_post_meta( $id, '_astra_content_layout_flag', 'disabled' ); + update_post_meta( $id, 'site-post-title', 'disabled' ); + update_post_meta( $id, 'ast-title-bar-display', 'disabled' ); + update_post_meta( $id, 'ast-featured-img', 'disabled' ); + + $content_layout = get_post_meta( $id, 'site-content-layout', true ); + if ( empty( $content_layout ) || 'default' == $content_layout ) { + update_post_meta( $id, 'site-content-layout', 'page-builder' ); + } + + $sidebar_layout = get_post_meta( $id, 'site-sidebar-layout', true ); + if ( empty( $sidebar_layout ) || 'default' == $sidebar_layout ) { + update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' ); + } + + // In the preview mode, Apply the layouts using filters for Elementor Template Library. + add_filter( + 'astra_page_layout', + function() { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found + return 'no-sidebar'; + } + ); + + add_filter( + 'astra_get_content_layout', + function () { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found + return 'page-builder'; + } + ); + + add_filter( 'astra_the_post_title_enabled', '__return_false' ); + add_filter( 'astra_featured_image_enabled', '__return_false' ); + } + } + } + + /** + * Add z-index CSS for elementor's drag drop + * + * @return void + * @since 1.4.0 + */ + public function elementor_overlay_zindex() { + + // return if we are not on Elementor's edit page. + if ( ! $this->is_elementor_editor() ) { + return; + } + + ?> + + + db->get_edit_mode( $id ) ); + } else { + return Plugin::$instance->db->is_built_with_elementor( $id ); + } + } + + /** + * Check if Elementor Editor is open. + * + * @since 1.2.7 + * + * @return boolean True IF Elementor Editor is loaded, False If Elementor Editor is not loaded. + */ + private function is_elementor_editor() { + if ( ( isset( $_REQUEST['action'] ) && 'elementor' == $_REQUEST['action'] ) || isset( $_REQUEST['elementor-preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended + return true; + } + + return false; + } + + } + +endif; + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_Elementor::get_instance(); diff --git a/inc/compatibility/class-astra-gravity-forms.php b/inc/compatibility/class-astra-gravity-forms.php index e89c83e..e1b97e1 100644 --- a/inc/compatibility/class-astra-gravity-forms.php +++ b/inc/compatibility/class-astra-gravity-forms.php @@ -1,74 +1,74 @@ - 'main', - 'render' => array( $this, 'infinite_scroll_render' ), - 'footer' => 'page', - ) - ); - } // end function jetpack_setup - - /** - * Custom render function for Infinite Scroll. - */ - public function infinite_scroll_render() { - while ( have_posts() ) { - the_post(); - get_template_part( 'template-parts/content', astra_get_post_format() ); - } - } // end function infinite_scroll_render - - } - -endif; - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_Jetpack::get_instance(); + 'main', + 'render' => array( $this, 'infinite_scroll_render' ), + 'footer' => 'page', + ) + ); + } // end function jetpack_setup + + /** + * Custom render function for Infinite Scroll. + */ + public function infinite_scroll_render() { + while ( have_posts() ) { + the_post(); + get_template_part( 'template-parts/content', astra_get_post_format() ); + } + } // end function infinite_scroll_render + + } + +endif; + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_Jetpack::get_instance(); diff --git a/inc/compatibility/class-astra-site-origin.php b/inc/compatibility/class-astra-site-origin.php index 1edca34..12033bb 100644 --- a/inc/compatibility/class-astra-site-origin.php +++ b/inc/compatibility/class-astra-site-origin.php @@ -1,68 +1,68 @@ - 0 && empty( $post->post_content ) ) { - $this->vc_update_meta_setting( $id ); - } - } - } - - /** - * Set default setting. - * - * @since 1.0.13 - * @return void - */ - public function vc_default_setting() { - - global $post; - $id = astra_get_post_id(); - - $page_builder_flag = get_post_meta( $id, '_astra_content_layout_flag', true ); - - if ( isset( $post ) && empty( $page_builder_flag ) && ( is_admin() || is_singular() ) ) { - $vc_active = get_post_meta( $id, '_wpb_vc_js_status', true ); - if ( 'true' == $vc_active || has_shortcode( $post->post_content, 'vc_row' ) ) { - $this->vc_update_meta_setting( $id ); - } - } - } - - /** - * Add assets in theme - * - * @param array $assets list of theme assets (JS & CSS). - * @return array List of updated assets. - * @since 3.5.0 - */ - public function add_styles( $assets ) { - if ( ! empty( $assets['css'] ) ) { - $assets['css'] = array( 'astra-vc-builder' => 'compatibility/page-builder/vc-plugin' ) + $assets['css']; - } - return $assets; - } - } - -endif; - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_Visual_Composer::get_instance(); + 0 && empty( $post->post_content ) ) { + $this->vc_update_meta_setting( $id ); + } + } + } + + /** + * Set default setting. + * + * @since 1.0.13 + * @return void + */ + public function vc_default_setting() { + + global $post; + $id = astra_get_post_id(); + + $page_builder_flag = get_post_meta( $id, '_astra_content_layout_flag', true ); + + if ( isset( $post ) && empty( $page_builder_flag ) && ( is_admin() || is_singular() ) ) { + $vc_active = get_post_meta( $id, '_wpb_vc_js_status', true ); + if ( 'true' == $vc_active || has_shortcode( $post->post_content, 'vc_row' ) ) { + $this->vc_update_meta_setting( $id ); + } + } + } + + /** + * Add assets in theme + * + * @param array $assets list of theme assets (JS & CSS). + * @return array List of updated assets. + * @since 3.5.0 + */ + public function add_styles( $assets ) { + if ( ! empty( $assets['css'] ) ) { + $assets['css'] = array( 'astra-vc-builder' => 'compatibility/page-builder/vc-plugin' ) + $assets['css']; + } + return $assets; + } + } + +endif; + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_Visual_Composer::get_instance(); diff --git a/inc/compatibility/class-astra-yoast-seo.php b/inc/compatibility/class-astra-yoast-seo.php index 1873f7f..e2bf3e6 100644 --- a/inc/compatibility/class-astra-yoast-seo.php +++ b/inc/compatibility/class-astra-yoast-seo.php @@ -1,40 +1,40 @@ -' . esc_html( $cart_title ) . ''; - - $cart_total_markup = '' . esc_html( edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ) ) . ''; - - // Cart Title & Cart Cart total markup. - $cart_info_markup = sprintf( - ' - %1$s - %2$s - %3$s - ', - ( $cart_title_display ) ? $cart_title_markup : '', - ( $cart_total_display && $cart_title_display ) ? '/' : '', - ( $cart_total_display ) ? $cart_total_markup : '' - ); - - $cart_items = count( edd_get_cart_contents() ); - $cart_contents_count = $cart_items; - - $cart_icon = sprintf( - '%4$s', - ( $icon ) ? $icon : '', - ( $cart_count_display ) ? '' : 'no-cart-total', - ( $cart_count_display ) ? 'data-cart-total="' . $cart_contents_count . '"' : '', - ( $icon ) ? ( ( false !== Astra_Icons::is_svg_icons() ) ? Astra_Icons::get_icons( $icon ) : '' ) : '' - ); - - // Theme's default icon with cart title and cart total. - if ( 'default' == $icon || ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && ! Astra_Ext_Extension::is_active( 'edd' ) ) ) { - // Cart Total or Cart Title enable then only add markup. - if ( $cart_title_display || $cart_total_display ) { - echo $cart_info_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - } else { - - // Remove Default cart icon added by theme. - add_filter( 'astra_edd_default_header_cart_icon', '__return_false' ); - - /* translators: 1: Cart Title Markup, 2: Cart Icon Markup */ - printf( - '
    - %1$s - %2$s -
    ', - ( $cart_title_display || $cart_total_display ) ? $cart_info_markup : '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ( $cart_icon ) ? $cart_icon : '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ); - } - } - - /** - * Header Cart Icon Class - * - * @param array $classes Default argument array. - * - * @return array; - */ - public function header_cart_icon_class( $classes ) { - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && ! defined( 'ASTRA_EXT_VER' ) ) { - return; - } - - $header_cart_icon_style = astra_get_option( 'edd-header-cart-icon-style' ); - - $classes[] = 'ast-edd-menu-cart-' . $header_cart_icon_style; - $header_cart_icon_has_color = astra_get_option( 'edd-header-cart-icon-color' ); - if ( ! empty( $header_cart_icon_has_color ) && ( 'none' !== $header_cart_icon_style ) ) { - $classes[] = 'ast-menu-cart-has-color'; - } - - return $classes; - } - - /** - * Disable EDD style only for the first time - * - * @return void - */ - public function edd_set_defaults_initialization() { - - $astra_theme_options = get_option( 'astra-settings' ); - $edd_settings = get_option( 'edd_settings' ); - - // Set flag to set the EDD style disable only once for the very first time. - if ( ! isset( $astra_theme_options['ast-edd-disable-styles'] ) ) { - $astra_theme_options['ast-edd-disable-styles'] = true; - $edd_settings['disable_styles'] = true; - update_option( 'astra-settings', $astra_theme_options ); - update_option( 'edd_settings', $edd_settings ); - } - - } - - /** - * Single Product Navigation - * - * @param array $args single products navigation arguments. - * - * @return array $args single products navigation arguments. - */ - public function edd_single_post_navigation( $args ) { - $is_edd_single_product_page = astra_is_edd_single_product_page(); - $disable_single_product_navigation = astra_get_option( 'disable-edd-single-product-nav' ); - if ( $is_edd_single_product_page && ! $disable_single_product_navigation ) { - $next_post = get_next_post(); - $prev_post = get_previous_post(); - - $next_text = false; - if ( $next_post ) { - $next_text = sprintf( - '%s ', - $next_post->post_title - ); - } - - $prev_text = false; - if ( $prev_post ) { - $prev_text = sprintf( - ' %s', - $prev_post->post_title - ); - } - - $args['prev_text'] = $prev_text; - $args['next_text'] = $next_text; - } elseif ( $is_edd_single_product_page && $disable_single_product_navigation ) { - $args['prev_text'] = false; - $args['next_text'] = false; - } - - return $args; - } - - /** - * EDD Initialization - * - * @return void - */ - public function edd_initialization() { - $is_edd_archive_page = astra_is_edd_archive_page(); - $is_edd_single_product_page = astra_is_edd_single_product_page(); - - if ( $is_edd_archive_page ) { - add_action( 'astra_template_parts_content', array( $this, 'edd_content_loop' ) ); - remove_action( 'astra_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_default' ) ); - - // Add edd wrapper. - add_action( 'astra_template_parts_content_top', array( $this, 'astra_edd_templat_part_wrap_open' ), 25 ); - add_action( 'astra_template_parts_content_bottom', array( $this, 'astra_edd_templat_part_wrap_close' ), 5 ); - - // Remove closing and ending div 'ast-row'. - remove_action( 'astra_template_parts_content_top', array( Astra_Loop::get_instance(), 'astra_templat_part_wrap_open' ), 25 ); - remove_action( 'astra_template_parts_content_bottom', array( Astra_Loop::get_instance(), 'astra_templat_part_wrap_close' ), 5 ); - } - if ( $is_edd_single_product_page ) { - remove_action( 'astra_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_post' ) ); - - add_action( 'astra_template_parts_content', array( $this, 'edd_single_template' ) ); - - } - } - - - /** - * Add wrapper for edd archive pages - * - * @return void - */ - public function astra_edd_templat_part_wrap_open() { - ?> -
    - -
    - - -
    > - - - - - - - -
    - - -
    > - -
    - 0 ) { - $classes = array_diff( - $classes, - array( - // Astra common grid. - 'ast-col-sm-12', - 'ast-col-md-8', - 'ast-col-md-6', - 'ast-col-md-12', - - // Astra Blog / Single Post. - 'ast-article-post', - 'ast-article-single', - 'ast-separate-posts', - 'remove-featured-img-padding', - 'ast-featured-post', - ) - ); - } - return $classes; - } - - /** - * Add Cart icon markup - * - * @param String $output Markup. - * @param String $section Section name. - * @param String $section_type Section selected option. - * @return Markup String. - * - * @since 1.5.5 - */ - public function astra_header_cart( $output, $section, $section_type ) { - - if ( 'edd' === $section_type && apply_filters( 'astra_edd_header_cart_icon', true ) ) { - - $output = $this->edd_mini_cart_markup(); - } - - return $output; - } - - /** - * Easy Digital DOwnloads mini cart markup markup - * - * @since 1.5.5 - * @return html - */ - public function edd_mini_cart_markup() { - $class = ''; - if ( edd_is_checkout() ) { - $class = 'current-menu-item'; - } - - $cart_menu_classes = apply_filters( 'astra_edd_cart_in_menu_class', array( 'ast-menu-cart-with-border' ) ); - - ob_start(); - if ( is_customize_preview() && ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ) { - Astra_Builder_UI_Controller::render_customizer_edit_button(); - } - ?> -
    -
    - astra_get_edd_cart(); ?> -
    - -
    - -
    - -
    - - - - -
    - - - -
    - -
    - array( - 'width' => '100%', - ), - '.tablet-columns-2 .ast-edd-archive-article' => array( - 'width' => '47.6%', - 'width' => 'calc(50% - 10px)', - ), - '.tablet-columns-3 .ast-edd-archive-article, .edd_downloads_list[class*="edd_download_columns_"] .edd_download' => array( - 'width' => '30.2%', - 'width' => 'calc(33.33% - 14px)', - ), - '.tablet-columns-4 .ast-edd-archive-article' => array( - 'width' => '21.5%', - 'width' => 'calc(25% - 15px)', - ), - '.tablet-columns-5 .ast-edd-archive-article' => array( - 'width' => '16.2%', - 'width' => 'calc(20% - 16px)', - ), - '.tablet-columns-6 .ast-edd-archive-article' => array( - 'width' => '12.7%', - 'width' => 'calc(16.66% - 16.66px)', - ), - ); - } else { - $max_tablet_edd_css = array( - '.tablet-columns-1 .ast-edd-container' => array( - 'grid-template-columns' => 'repeat(1, 1fr)', - ), - '.tablet-columns-2 .ast-edd-container' => array( - 'grid-template-columns' => 'repeat(2, 1fr)', - ), - '.tablet-columns-3 .ast-edd-container, .edd_downloads_list[class*="edd_download_columns_"] .edd_download' => array( - 'grid-template-columns' => 'repeat(3, 1fr)', - ), - '.tablet-columns-4 .ast-edd-container' => array( - 'grid-template-columns' => 'repeat(4, 1fr)', - ), - '.tablet-columns-5 .ast-edd-container' => array( - 'grid-template-columns' => 'repeat(5, 1fr)', - ), - '.tablet-columns-6 .ast-edd-container' => array( - 'grid-template-columns' => 'repeat(6, 1fr)', - ), - ); - } - - /* Parse CSS from array() -> max-width: (tablet-breakpoint) px & min-width: (mobile-breakpoint + 1) px */ - $edd_css_output = astra_parse_css( $max_tablet_edd_css, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() ); - - if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { - if ( $is_site_rtl ) { - $max_tablet_edd_lang_direction_css = array( - '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array( - 'margin-left' => '20px', - 'clear' => 'none', - ), - '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n)' => array( - 'margin-left' => '0', - 'clear' => 'left', - ), - '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n+1), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n+1), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n+1), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n+1), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n+1), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n+1)' => array( - 'clear' => 'right', - ), - ); - } else { - $max_tablet_edd_lang_direction_css = array( - '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array( - 'margin-right' => '20px', - 'clear' => 'none', - ), - '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n)' => array( - 'margin-right' => '0', - 'clear' => 'right', - ), - '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n+1), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n+1), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n+1), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n+1), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n+1), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n+1)' => array( - 'clear' => 'left', - ), - ); - } - /* Parse CSS from array() -> max-width: (tablet-breakpoint) px & min-width: (mobile-breakpoint + 1) px */ - $edd_css_output .= astra_parse_css( $max_tablet_edd_lang_direction_css, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() ); - } - - if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { - $mobile_edd_css = array( - '.mobile-columns-1 .ast-edd-archive-article' => array( - 'width' => '100%', - ), - '.mobile-columns-3 .ast-edd-archive-article' => array( - 'width' => '28.2%', - 'width' => 'calc(33.33% - 14px)', - ), - '.mobile-columns-4 .ast-edd-archive-article' => array( - 'width' => '19%', - 'width' => 'calc(25% - 15px)', - ), - '.mobile-columns-5 .ast-edd-archive-article' => array( - 'width' => '13%', - 'width' => 'calc(20% - 16px)', - ), - '.mobile-columns-6 .ast-edd-archive-article' => array( - 'width' => '10.2%', - 'width' => 'calc(16.66% - 16.66px)', - ), - '.edd_downloads_list[class*="edd_download_columns_"] .edd_download, .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n+1), .mobile-columns-2 .ast-edd-archive-article' => array( - 'width' => '46.1%', - 'width' => 'calc(50% - 10px)', - ), - ); - } else { - $mobile_edd_css = array( - '.mobile-columns-1 .ast-edd-container' => array( - 'grid-template-columns' => 'repeat(1, 1fr)', - ), - '.mobile-columns-3 .ast-edd-container' => array( - 'grid-template-columns' => 'repeat(3, 1fr)', - ), - '.mobile-columns-4 .ast-edd-container' => array( - 'grid-template-columns' => 'repeat(4, 1fr)', - ), - '.mobile-columns-5 .ast-edd-container' => array( - 'grid-template-columns' => 'repeat(5, 1fr)', - ), - '.mobile-columns-6 .ast-edd-container' => array( - 'grid-template-columns' => 'repeat(6, 1fr)', - ), - '.edd_downloads_list[class*="edd_download_columns_"] .edd_download, .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n+1), .mobile-columns-2 .ast-edd-container' => array( - 'grid-template-columns' => 'repeat(2, 1fr)', - ), - ); - } - - /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */ - $edd_css_output .= astra_parse_css( $mobile_edd_css, '', astra_get_mobile_breakpoint() ); - - if ( $is_site_rtl ) { - $mobile_edd_lang_direction_css = array( - '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array( - 'margin-left' => '20px', - 'clear' => 'none', - ), - '.mobile-columns-1 .ast-edd-archive-article:nth-child(n)' => array( - 'margin-left' => '0', - ), - '.edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n), .mobile-columns-2 .ast-edd-archive-article:nth-child(2n), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n)' => array( - 'margin-left' => '0', - 'clear' => 'left', - ), - '.mobile-columns-2 .ast-edd-archive-article:nth-child(2n+1), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n+1), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n+1), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n+1), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n+1)' => array( - 'clear' => 'right', - ), - ); - } else { - $mobile_edd_lang_direction_css = array( - '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array( - 'margin-right' => '20px', - 'clear' => 'none', - ), - '.mobile-columns-1 .ast-edd-archive-article:nth-child(n)' => array( - 'margin-right' => '0', - ), - '.edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n), .mobile-columns-2 .ast-edd-archive-article:nth-child(2n), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n)' => array( - 'margin-right' => '0', - 'clear' => 'right', - ), - '.mobile-columns-2 .ast-edd-archive-article:nth-child(2n+1), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n+1), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n+1), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n+1), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n+1)' => array( - 'clear' => 'left', - ), - ); - } - - /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */ - $edd_css_output .= astra_parse_css( $mobile_edd_lang_direction_css, '', astra_get_mobile_breakpoint() ); - - wp_add_inline_style( 'astra-edd', apply_filters( 'astra_theme_edd_dynamic_css', $edd_css_output ) ); - - // Inline js for EDD Cart updates. - wp_add_inline_script( - 'edd-ajax', - "jQuery( document ).ready( function($) { - /** - * Astra - Easy Digital Downloads Cart Quantity & Total Amount - */ - var cartQuantity = jQuery('.ast-edd-site-header-cart-wrap .count'), - iconQuantity = jQuery('.ast-edd-site-header-cart-wrap .astra-icon'), - cartTotalAmount = jQuery('.ast-edd-site-header-cart-wrap .ast-edd-header-cart-total'); - - jQuery('body').on('edd_cart_item_added', function( event, response ) { - cartQuantity.html( response.cart_quantity ); - iconQuantity.attr('data-cart-total', response.cart_quantity ); - cartTotalAmount.html( response.total ); - }); - - jQuery('body').on('edd_cart_item_removed', function( event, response ) { - cartQuantity.html( response.cart_quantity ); - iconQuantity.attr('data-cart-total', response.cart_quantity ); - cartTotalAmount.html( response.total ); - }); - });" - ); - } - - /** - * Dynamic CSS - * - * @param string $dynamic_css Astra Dynamic CSS. - * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. - * @since 1.5.5 - * @return string $dynamic_css - */ - public function add_inline_styles( $dynamic_css, $dynamic_css_filtered = '' ) { - - /** - * - Variable Declaration - */ - - $site_content_width = astra_get_option( 'site-content-width', 1200 ); - $edd_archive_width = astra_get_option( 'edd-archive-width' ); - $edd_archive_max_width = astra_get_option( 'edd-archive-max-width' ); - $css_output = ''; - - $theme_color = astra_get_option( 'theme-color' ); - $link_color = astra_get_option( 'link-color', $theme_color ); - $text_color = astra_get_option( 'text-color' ); - $link_h_color = astra_get_option( 'link-h-color' ); - - $btn_color = astra_get_option( 'button-color' ); - if ( empty( $btn_color ) ) { - $btn_color = astra_get_foreground_color( $theme_color ); - } - - $btn_h_color = astra_get_option( 'button-h-color' ); - if ( empty( $btn_h_color ) ) { - $btn_h_color = astra_get_foreground_color( $link_h_color ); - } - $btn_bg_h_color = astra_get_option( 'button-bg-h-color', $link_h_color ); - - $btn_border_radius = astra_get_option( 'button-radius' ); - - $cart_h_color = astra_get_foreground_color( $link_h_color ); - - $css_output = array( - // Loading effect color. - 'a.edd-add-to-cart.white .edd-loading, .edd-discount-loader.edd-loading, .edd-loading-ajax.edd-loading' => array( - 'border-left-color' => esc_attr( $cart_h_color ), - ), - ); - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - $compat_css_desktop = array( - /** - * Cart in menu - */ - '.ast-edd-site-header-cart a' => array( - 'color' => esc_attr( $text_color ), - ), - - '.ast-edd-site-header-cart a:focus, .ast-edd-site-header-cart a:hover, .ast-edd-site-header-cart .current-menu-item a' => array( - 'color' => esc_attr( $text_color ), - ), - - '.ast-edd-cart-menu-wrap .count, .ast-edd-cart-menu-wrap .count:after' => array( - 'border-color' => esc_attr( $link_color ), - 'color' => esc_attr( $link_color ), - ), - - '.ast-edd-cart-menu-wrap:hover .count' => array( - 'color' => esc_attr( $cart_h_color ), - 'background-color' => esc_attr( $link_color ), - ), - '.ast-edd-site-header-cart .widget_edd_cart_widget .cart-total' => array( - 'color' => esc_attr( $link_color ), - ), - - '.ast-edd-site-header-cart .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a' => array( - 'color' => $btn_h_color, - 'border-color' => $btn_bg_h_color, - 'background-color' => $btn_bg_h_color, - 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), - ), - '.site-header .ast-edd-site-header-cart .ast-edd-site-header-cart-widget .edd_checkout a, .site-header .ast-edd-site-header-cart .ast-edd-site-header-cart-widget .edd_checkout a:hover' => array( - 'color' => $btn_color, - ), - '.below-header-user-select .ast-edd-site-header-cart .widget, .ast-above-header-section .ast-edd-site-header-cart .widget a, .below-header-user-select .ast-edd-site-header-cart .widget_edd_cart_widget a' => array( - 'color' => $text_color, - ), - '.below-header-user-select .ast-edd-site-header-cart .widget_edd_cart_widget a:hover, .ast-above-header-section .ast-edd-site-header-cart .widget_edd_cart_widget a:hover, .below-header-user-select .ast-edd-site-header-cart .widget_edd_cart_widget a.remove:hover, .ast-above-header-section .ast-edd-site-header-cart .widget_edd_cart_widget a.remove:hover' => array( - 'color' => esc_attr( $link_color ), - ), - '.widget_edd_cart_widget a.edd-remove-from-cart:hover:after' => array( - 'color' => esc_attr( $link_color ), - 'border-color' => esc_attr( $link_color ), - 'background-color' => esc_attr( '#ffffff' ), - ), - ); - - $css_output = array_merge( $css_output, $compat_css_desktop ); - } - - /* Parse CSS from array() */ - $css_output = astra_parse_css( $css_output ); - - /* Easy Digital DOwnloads Shop Archive width */ - if ( 'custom' === $edd_archive_width ) : - // Easy Digital DOwnloads shop archive custom width. - $site_width = array( - '.ast-edd-archive-page .site-content > .ast-container' => array( - 'max-width' => astra_get_css_value( $edd_archive_max_width, 'px' ), - ), - ); - $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) ); - - else : - // Easy Digital DOwnloads shop archive default width. - $site_width = array( - '.ast-edd-archive-page .site-content > .ast-container' => array( - 'max-width' => astra_get_css_value( $site_content_width + 40, 'px' ), - ), - ); - - /* Parse CSS from array()*/ - $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) ); - endif; - - $dynamic_css .= apply_filters( 'astra_theme_edd_dynamic_css', $css_output ); - - return $dynamic_css; - } - - /** - * Theme Defaults. - * - * @param array $defaults Array of options value. - * @return array - */ - public function theme_defaults( $defaults ) { - - // Container. - $defaults['edd-content-layout'] = 'plain-container'; - - // // Sidebar. - $defaults['edd-sidebar-layout'] = 'no-sidebar'; - $defaults['edd-single-product-sidebar-layout'] = 'default'; - - // Edd Archive. - $defaults['edd-archive-grids'] = array( - 'desktop' => 4, - 'tablet' => 3, - 'mobile' => 2, - ); - - $defaults['edd-archive-product-structure'] = array( - 'image', - 'category', - 'title', - 'price', - 'add_cart', - ); - - $defaults['edd-archive-add-to-cart-button-text'] = __( 'Add To Cart', 'astra' ); - $defaults['edd-archive-variable-button'] = 'button'; - $defaults['edd-archive-variable-button-text'] = __( 'View Details', 'astra' ); - - $defaults['edd-archive-width'] = 'default'; - $defaults['edd-archive-max-width'] = 1200; - $defaults['disable-edd-single-product-nav'] = false; - - return $defaults; - } - - - /** - * Add products item class to the body - * - * @param Array $classes product classes. - * - * @return array. - */ - public function edd_products_item_class( $classes = '' ) { - - $is_edd_archive_page = astra_is_edd_archive_page(); - - if ( $is_edd_archive_page ) { - $shop_grid = astra_get_option( 'edd-archive-grids' ); - $classes[] = 'columns-' . $shop_grid['desktop']; - $classes[] = 'tablet-columns-' . $shop_grid['tablet']; - $classes[] = 'mobile-columns-' . $shop_grid['mobile']; - - $classes[] = 'ast-edd-archive-page'; - } - - return $classes; - } - - /** - * Add class on single product page - * - * @param Array $classes product classes. - * - * @return array. - */ - public function edd_single_product_class( $classes ) { - - $is_edd_archive_page = astra_is_edd_archive_page(); - - if ( $is_edd_archive_page ) { - $classes[] = 'ast-edd-archive-article'; - } - - return $classes; - } - - /** - * Store widgets init. - */ - public function store_widgets_init() { - register_sidebar( - apply_filters( - 'astra_edd_sidebar_init', - array( - 'name' => esc_html__( 'Easy Digital Downloads Sidebar', 'astra' ), - 'id' => 'astra-edd-sidebar', - 'description' => __( 'This sidebar will be used on Product archive, Cart, Checkout and My Account pages.', 'astra' ), - 'before_widget' => '
    ', - 'after_widget' => '
    ', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - register_sidebar( - apply_filters( - 'astra_edd_single_product_sidebar_init', - array( - 'name' => esc_html__( 'EDD Single Product Sidebar', 'astra' ), - 'id' => 'astra-edd-single-product-sidebar', - 'description' => __( 'This sidebar will be used on EDD Single Product page.', 'astra' ), - 'before_widget' => '
    ', - 'after_widget' => '
    ', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - } - - /** - * Assign shop sidebar for store page. - * - * @param String $sidebar Sidebar. - * - * @return String $sidebar Sidebar. - */ - public function replace_store_sidebar( $sidebar ) { - - $is_edd_page = astra_is_edd_page(); - $is_edd_single_product_page = astra_is_edd_single_product_page(); - - if ( $is_edd_page && ! $is_edd_single_product_page ) { - $sidebar = 'astra-edd-sidebar'; - } elseif ( $is_edd_single_product_page ) { - $sidebar = 'astra-edd-single-product-sidebar'; - } - - return $sidebar; - } - - /** - * Easy Digital Downloads Container - * - * @param String $sidebar_layout Layout type. - * - * @return String $sidebar_layout Layout type. - */ - public function store_sidebar_layout( $sidebar_layout ) { - - $is_edd_page = astra_is_edd_page(); - $is_edd_single_product_page = astra_is_edd_single_product_page(); - $is_edd_archive_page = astra_is_edd_archive_page(); - - if ( $is_edd_page ) { - - $edd_sidebar = astra_get_option( 'edd-sidebar-layout' ); - - if ( 'default' !== $edd_sidebar ) { - - $sidebar_layout = $edd_sidebar; - } - - if ( $is_edd_single_product_page ) { - $edd_single_product_sidebar = astra_get_option( 'edd-single-product-sidebar-layout' ); - - if ( 'default' !== $edd_single_product_sidebar ) { - $sidebar_layout = $edd_single_product_sidebar; - } else { - $sidebar_layout = astra_get_option( 'site-sidebar-layout' ); - } - - $page_id = get_the_ID(); - $edd_sidebar_layout = get_post_meta( $page_id, 'site-sidebar-layout', true ); - } elseif ( $is_edd_archive_page ) { - $edd_sidebar_layout = astra_get_option( 'edd-sidebar-layout' ); - } else { - $edd_sidebar_layout = astra_get_option_meta( 'site-sidebar-layout', '', true ); - } - - if ( 'default' !== $edd_sidebar_layout && ! empty( $edd_sidebar_layout ) ) { - $sidebar_layout = $edd_sidebar_layout; - } - } - - return $sidebar_layout; - } - /** - * Easy Digital Downloads Container - * - * @param String $layout Layout type. - * - * @return String $layout Layout type. - */ - public function store_content_layout( $layout ) { - - $is_edd_page = astra_is_edd_page(); - $is_edd_single_page = astra_is_edd_single_page(); - $is_edd_archive_page = astra_is_edd_archive_page(); - - if ( $is_edd_page ) { - - $edd_layout = astra_get_option( 'edd-content-layout' ); - - if ( 'default' !== $edd_layout ) { - - $layout = $edd_layout; - } - - if ( $is_edd_single_page ) { - $page_id = get_the_ID(); - $edd_page_layout = get_post_meta( $page_id, 'site-content-layout', true ); - } elseif ( $is_edd_archive_page ) { - $edd_page_layout = astra_get_option( 'edd-content-layout' ); - } else { - $edd_page_layout = astra_get_option_meta( 'site-content-layout', '', true ); - } - - if ( 'default' !== $edd_page_layout && ! empty( $edd_page_layout ) ) { - $layout = $edd_page_layout; - } - } - - return $layout; - } - - /** - * Register Customizer sections and panel for Easy Digital Downloads. - * - * @since 1.5.5 - * @param WP_Customize_Manager $wp_customize Theme Customizer object. - */ - public function customize_register( $wp_customize ) { - - // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - /** - * Register Sections & Panels - */ - require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/class-astra-customizer-register-edd-section.php'; - - /** - * Sections - */ - require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/class-astra-edd-container-configs.php'; - require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/class-astra-edd-sidebar-configs.php'; - require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php'; - require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php'; - // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - - } - - } - -endif; - -if ( apply_filters( 'astra_enable_edd_integration', true ) ) { - Astra_Edd::get_instance(); -} +' . esc_html( $cart_title ) . ''; + + $cart_total_markup = '' . esc_html( edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ) ) . ''; + + // Cart Title & Cart Cart total markup. + $cart_info_markup = sprintf( + ' + %1$s + %2$s + %3$s + ', + ( $cart_title_display ) ? $cart_title_markup : '', + ( $cart_total_display && $cart_title_display ) ? '/' : '', + ( $cart_total_display ) ? $cart_total_markup : '' + ); + + $cart_items = count( edd_get_cart_contents() ); + $cart_contents_count = $cart_items; + + $cart_icon = sprintf( + '%4$s', + ( $icon ) ? $icon : '', + ( $cart_count_display ) ? '' : 'no-cart-total', + ( $cart_count_display ) ? 'data-cart-total="' . $cart_contents_count . '"' : '', + ( $icon ) ? ( ( false !== Astra_Icons::is_svg_icons() ) ? Astra_Icons::get_icons( $icon ) : '' ) : '' + ); + + // Theme's default icon with cart title and cart total. + if ( 'default' == $icon || ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && ! Astra_Ext_Extension::is_active( 'edd' ) ) ) { + // Cart Total or Cart Title enable then only add markup. + if ( $cart_title_display || $cart_total_display ) { + echo $cart_info_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } + } else { + + // Remove Default cart icon added by theme. + add_filter( 'astra_edd_default_header_cart_icon', '__return_false' ); + + /* translators: 1: Cart Title Markup, 2: Cart Icon Markup */ + printf( + '
    + %1$s + %2$s +
    ', + ( $cart_title_display || $cart_total_display ) ? $cart_info_markup : '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + ( $cart_icon ) ? $cart_icon : '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + ); + } + } + + /** + * Header Cart Icon Class + * + * @param array $classes Default argument array. + * + * @return array; + */ + public function header_cart_icon_class( $classes ) { + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && ! defined( 'ASTRA_EXT_VER' ) ) { + return; + } + + $header_cart_icon_style = astra_get_option( 'edd-header-cart-icon-style' ); + + $classes[] = 'ast-edd-menu-cart-' . $header_cart_icon_style; + $header_cart_icon_has_color = astra_get_option( 'edd-header-cart-icon-color' ); + if ( ! empty( $header_cart_icon_has_color ) && ( 'none' !== $header_cart_icon_style ) ) { + $classes[] = 'ast-menu-cart-has-color'; + } + + return $classes; + } + + /** + * Disable EDD style only for the first time + * + * @return void + */ + public function edd_set_defaults_initialization() { + + $astra_theme_options = get_option( 'astra-settings' ); + $edd_settings = get_option( 'edd_settings' ); + + // Set flag to set the EDD style disable only once for the very first time. + if ( ! isset( $astra_theme_options['ast-edd-disable-styles'] ) ) { + $astra_theme_options['ast-edd-disable-styles'] = true; + $edd_settings['disable_styles'] = true; + update_option( 'astra-settings', $astra_theme_options ); + update_option( 'edd_settings', $edd_settings ); + } + + } + + /** + * Single Product Navigation + * + * @param array $args single products navigation arguments. + * + * @return array $args single products navigation arguments. + */ + public function edd_single_post_navigation( $args ) { + $is_edd_single_product_page = astra_is_edd_single_product_page(); + $disable_single_product_navigation = astra_get_option( 'disable-edd-single-product-nav' ); + if ( $is_edd_single_product_page && ! $disable_single_product_navigation ) { + $next_post = get_next_post(); + $prev_post = get_previous_post(); + + $next_text = false; + if ( $next_post ) { + $next_text = sprintf( + '%s ', + $next_post->post_title + ); + } + + $prev_text = false; + if ( $prev_post ) { + $prev_text = sprintf( + ' %s', + $prev_post->post_title + ); + } + + $args['prev_text'] = $prev_text; + $args['next_text'] = $next_text; + } elseif ( $is_edd_single_product_page && $disable_single_product_navigation ) { + $args['prev_text'] = false; + $args['next_text'] = false; + } + + return $args; + } + + /** + * EDD Initialization + * + * @return void + */ + public function edd_initialization() { + $is_edd_archive_page = astra_is_edd_archive_page(); + $is_edd_single_product_page = astra_is_edd_single_product_page(); + + if ( $is_edd_archive_page ) { + add_action( 'astra_template_parts_content', array( $this, 'edd_content_loop' ) ); + remove_action( 'astra_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_default' ) ); + + // Add edd wrapper. + add_action( 'astra_template_parts_content_top', array( $this, 'astra_edd_templat_part_wrap_open' ), 25 ); + add_action( 'astra_template_parts_content_bottom', array( $this, 'astra_edd_templat_part_wrap_close' ), 5 ); + + // Remove closing and ending div 'ast-row'. + remove_action( 'astra_template_parts_content_top', array( Astra_Loop::get_instance(), 'astra_templat_part_wrap_open' ), 25 ); + remove_action( 'astra_template_parts_content_bottom', array( Astra_Loop::get_instance(), 'astra_templat_part_wrap_close' ), 5 ); + } + if ( $is_edd_single_product_page ) { + remove_action( 'astra_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_post' ) ); + + add_action( 'astra_template_parts_content', array( $this, 'edd_single_template' ) ); + + } + } + + + /** + * Add wrapper for edd archive pages + * + * @return void + */ + public function astra_edd_templat_part_wrap_open() { + ?> +
    + +
    + + +
    > + + + + + + + +
    + + +
    > + +
    + 0 ) { + $classes = array_diff( + $classes, + array( + // Astra common grid. + 'ast-col-sm-12', + 'ast-col-md-8', + 'ast-col-md-6', + 'ast-col-md-12', + + // Astra Blog / Single Post. + 'ast-article-post', + 'ast-article-single', + 'ast-separate-posts', + 'remove-featured-img-padding', + 'ast-featured-post', + ) + ); + } + return $classes; + } + + /** + * Add Cart icon markup + * + * @param String $output Markup. + * @param String $section Section name. + * @param String $section_type Section selected option. + * @return Markup String. + * + * @since 1.5.5 + */ + public function astra_header_cart( $output, $section, $section_type ) { + + if ( 'edd' === $section_type && apply_filters( 'astra_edd_header_cart_icon', true ) ) { + + $output = $this->edd_mini_cart_markup(); + } + + return $output; + } + + /** + * Easy Digital DOwnloads mini cart markup markup + * + * @since 1.5.5 + * @return html + */ + public function edd_mini_cart_markup() { + $class = ''; + if ( edd_is_checkout() ) { + $class = 'current-menu-item'; + } + + $cart_menu_classes = apply_filters( 'astra_edd_cart_in_menu_class', array( 'ast-menu-cart-with-border' ) ); + + ob_start(); + if ( is_customize_preview() && ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ) { + Astra_Builder_UI_Controller::render_customizer_edit_button(); + } + ?> +
    +
    + astra_get_edd_cart(); ?> +
    + +
    + +
    + +
    + + + + +
    + + + +
    + +
    + array( + 'width' => '100%', + ), + '.tablet-columns-2 .ast-edd-archive-article' => array( + 'width' => '47.6%', + 'width' => 'calc(50% - 10px)', + ), + '.tablet-columns-3 .ast-edd-archive-article, .edd_downloads_list[class*="edd_download_columns_"] .edd_download' => array( + 'width' => '30.2%', + 'width' => 'calc(33.33% - 14px)', + ), + '.tablet-columns-4 .ast-edd-archive-article' => array( + 'width' => '21.5%', + 'width' => 'calc(25% - 15px)', + ), + '.tablet-columns-5 .ast-edd-archive-article' => array( + 'width' => '16.2%', + 'width' => 'calc(20% - 16px)', + ), + '.tablet-columns-6 .ast-edd-archive-article' => array( + 'width' => '12.7%', + 'width' => 'calc(16.66% - 16.66px)', + ), + ); + } else { + $max_tablet_edd_css = array( + '.tablet-columns-1 .ast-edd-container' => array( + 'grid-template-columns' => 'repeat(1, 1fr)', + ), + '.tablet-columns-2 .ast-edd-container' => array( + 'grid-template-columns' => 'repeat(2, 1fr)', + ), + '.tablet-columns-3 .ast-edd-container, .edd_downloads_list[class*="edd_download_columns_"] .edd_download' => array( + 'grid-template-columns' => 'repeat(3, 1fr)', + ), + '.tablet-columns-4 .ast-edd-container' => array( + 'grid-template-columns' => 'repeat(4, 1fr)', + ), + '.tablet-columns-5 .ast-edd-container' => array( + 'grid-template-columns' => 'repeat(5, 1fr)', + ), + '.tablet-columns-6 .ast-edd-container' => array( + 'grid-template-columns' => 'repeat(6, 1fr)', + ), + ); + } + + /* Parse CSS from array() -> max-width: (tablet-breakpoint) px & min-width: (mobile-breakpoint + 1) px */ + $edd_css_output = astra_parse_css( $max_tablet_edd_css, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() ); + + if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { + if ( $is_site_rtl ) { + $max_tablet_edd_lang_direction_css = array( + '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array( + 'margin-left' => '20px', + 'clear' => 'none', + ), + '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n)' => array( + 'margin-left' => '0', + 'clear' => 'left', + ), + '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n+1), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n+1), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n+1), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n+1), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n+1), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n+1)' => array( + 'clear' => 'right', + ), + ); + } else { + $max_tablet_edd_lang_direction_css = array( + '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array( + 'margin-right' => '20px', + 'clear' => 'none', + ), + '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n)' => array( + 'margin-right' => '0', + 'clear' => 'right', + ), + '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n+1), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n+1), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n+1), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n+1), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n+1), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n+1)' => array( + 'clear' => 'left', + ), + ); + } + /* Parse CSS from array() -> max-width: (tablet-breakpoint) px & min-width: (mobile-breakpoint + 1) px */ + $edd_css_output .= astra_parse_css( $max_tablet_edd_lang_direction_css, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() ); + } + + if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { + $mobile_edd_css = array( + '.mobile-columns-1 .ast-edd-archive-article' => array( + 'width' => '100%', + ), + '.mobile-columns-3 .ast-edd-archive-article' => array( + 'width' => '28.2%', + 'width' => 'calc(33.33% - 14px)', + ), + '.mobile-columns-4 .ast-edd-archive-article' => array( + 'width' => '19%', + 'width' => 'calc(25% - 15px)', + ), + '.mobile-columns-5 .ast-edd-archive-article' => array( + 'width' => '13%', + 'width' => 'calc(20% - 16px)', + ), + '.mobile-columns-6 .ast-edd-archive-article' => array( + 'width' => '10.2%', + 'width' => 'calc(16.66% - 16.66px)', + ), + '.edd_downloads_list[class*="edd_download_columns_"] .edd_download, .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n+1), .mobile-columns-2 .ast-edd-archive-article' => array( + 'width' => '46.1%', + 'width' => 'calc(50% - 10px)', + ), + ); + } else { + $mobile_edd_css = array( + '.mobile-columns-1 .ast-edd-container' => array( + 'grid-template-columns' => 'repeat(1, 1fr)', + ), + '.mobile-columns-3 .ast-edd-container' => array( + 'grid-template-columns' => 'repeat(3, 1fr)', + ), + '.mobile-columns-4 .ast-edd-container' => array( + 'grid-template-columns' => 'repeat(4, 1fr)', + ), + '.mobile-columns-5 .ast-edd-container' => array( + 'grid-template-columns' => 'repeat(5, 1fr)', + ), + '.mobile-columns-6 .ast-edd-container' => array( + 'grid-template-columns' => 'repeat(6, 1fr)', + ), + '.edd_downloads_list[class*="edd_download_columns_"] .edd_download, .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n+1), .mobile-columns-2 .ast-edd-container' => array( + 'grid-template-columns' => 'repeat(2, 1fr)', + ), + ); + } + + /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */ + $edd_css_output .= astra_parse_css( $mobile_edd_css, '', astra_get_mobile_breakpoint() ); + + if ( $is_site_rtl ) { + $mobile_edd_lang_direction_css = array( + '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array( + 'margin-left' => '20px', + 'clear' => 'none', + ), + '.mobile-columns-1 .ast-edd-archive-article:nth-child(n)' => array( + 'margin-left' => '0', + ), + '.edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n), .mobile-columns-2 .ast-edd-archive-article:nth-child(2n), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n)' => array( + 'margin-left' => '0', + 'clear' => 'left', + ), + '.mobile-columns-2 .ast-edd-archive-article:nth-child(2n+1), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n+1), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n+1), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n+1), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n+1)' => array( + 'clear' => 'right', + ), + ); + } else { + $mobile_edd_lang_direction_css = array( + '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array( + 'margin-right' => '20px', + 'clear' => 'none', + ), + '.mobile-columns-1 .ast-edd-archive-article:nth-child(n)' => array( + 'margin-right' => '0', + ), + '.edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n), .mobile-columns-2 .ast-edd-archive-article:nth-child(2n), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n)' => array( + 'margin-right' => '0', + 'clear' => 'right', + ), + '.mobile-columns-2 .ast-edd-archive-article:nth-child(2n+1), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n+1), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n+1), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n+1), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n+1)' => array( + 'clear' => 'left', + ), + ); + } + + /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */ + $edd_css_output .= astra_parse_css( $mobile_edd_lang_direction_css, '', astra_get_mobile_breakpoint() ); + + wp_add_inline_style( 'astra-edd', apply_filters( 'astra_theme_edd_dynamic_css', $edd_css_output ) ); + + // Inline js for EDD Cart updates. + wp_add_inline_script( + 'edd-ajax', + "jQuery( document ).ready( function($) { + /** + * Astra - Easy Digital Downloads Cart Quantity & Total Amount + */ + var cartQuantity = jQuery('.ast-edd-site-header-cart-wrap .count'), + iconQuantity = jQuery('.ast-edd-site-header-cart-wrap .astra-icon'), + cartTotalAmount = jQuery('.ast-edd-site-header-cart-wrap .ast-edd-header-cart-total'); + + jQuery('body').on('edd_cart_item_added', function( event, response ) { + cartQuantity.html( response.cart_quantity ); + iconQuantity.attr('data-cart-total', response.cart_quantity ); + cartTotalAmount.html( response.total ); + }); + + jQuery('body').on('edd_cart_item_removed', function( event, response ) { + cartQuantity.html( response.cart_quantity ); + iconQuantity.attr('data-cart-total', response.cart_quantity ); + cartTotalAmount.html( response.total ); + }); + });" + ); + } + + /** + * Dynamic CSS + * + * @param string $dynamic_css Astra Dynamic CSS. + * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. + * @since 1.5.5 + * @return string $dynamic_css + */ + public function add_inline_styles( $dynamic_css, $dynamic_css_filtered = '' ) { + + /** + * - Variable Declaration + */ + + $site_content_width = astra_get_option( 'site-content-width', 1200 ); + $edd_archive_width = astra_get_option( 'edd-archive-width' ); + $edd_archive_max_width = astra_get_option( 'edd-archive-max-width' ); + $css_output = ''; + + $theme_color = astra_get_option( 'theme-color' ); + $link_color = astra_get_option( 'link-color', $theme_color ); + $text_color = astra_get_option( 'text-color' ); + $link_h_color = astra_get_option( 'link-h-color' ); + + $btn_color = astra_get_option( 'button-color' ); + if ( empty( $btn_color ) ) { + $btn_color = astra_get_foreground_color( $theme_color ); + } + + $btn_h_color = astra_get_option( 'button-h-color' ); + if ( empty( $btn_h_color ) ) { + $btn_h_color = astra_get_foreground_color( $link_h_color ); + } + $btn_bg_h_color = astra_get_option( 'button-bg-h-color', $link_h_color ); + + $btn_border_radius = astra_get_option( 'button-radius' ); + + $cart_h_color = astra_get_foreground_color( $link_h_color ); + + $css_output = array( + // Loading effect color. + 'a.edd-add-to-cart.white .edd-loading, .edd-discount-loader.edd-loading, .edd-loading-ajax.edd-loading' => array( + 'border-left-color' => esc_attr( $cart_h_color ), + ), + ); + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + $compat_css_desktop = array( + /** + * Cart in menu + */ + '.ast-edd-site-header-cart a' => array( + 'color' => esc_attr( $text_color ), + ), + + '.ast-edd-site-header-cart a:focus, .ast-edd-site-header-cart a:hover, .ast-edd-site-header-cart .current-menu-item a' => array( + 'color' => esc_attr( $text_color ), + ), + + '.ast-edd-cart-menu-wrap .count, .ast-edd-cart-menu-wrap .count:after' => array( + 'border-color' => esc_attr( $link_color ), + 'color' => esc_attr( $link_color ), + ), + + '.ast-edd-cart-menu-wrap:hover .count' => array( + 'color' => esc_attr( $cart_h_color ), + 'background-color' => esc_attr( $link_color ), + ), + '.ast-edd-site-header-cart .widget_edd_cart_widget .cart-total' => array( + 'color' => esc_attr( $link_color ), + ), + + '.ast-edd-site-header-cart .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a' => array( + 'color' => $btn_h_color, + 'border-color' => $btn_bg_h_color, + 'background-color' => $btn_bg_h_color, + 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), + ), + '.site-header .ast-edd-site-header-cart .ast-edd-site-header-cart-widget .edd_checkout a, .site-header .ast-edd-site-header-cart .ast-edd-site-header-cart-widget .edd_checkout a:hover' => array( + 'color' => $btn_color, + ), + '.below-header-user-select .ast-edd-site-header-cart .widget, .ast-above-header-section .ast-edd-site-header-cart .widget a, .below-header-user-select .ast-edd-site-header-cart .widget_edd_cart_widget a' => array( + 'color' => $text_color, + ), + '.below-header-user-select .ast-edd-site-header-cart .widget_edd_cart_widget a:hover, .ast-above-header-section .ast-edd-site-header-cart .widget_edd_cart_widget a:hover, .below-header-user-select .ast-edd-site-header-cart .widget_edd_cart_widget a.remove:hover, .ast-above-header-section .ast-edd-site-header-cart .widget_edd_cart_widget a.remove:hover' => array( + 'color' => esc_attr( $link_color ), + ), + '.widget_edd_cart_widget a.edd-remove-from-cart:hover:after' => array( + 'color' => esc_attr( $link_color ), + 'border-color' => esc_attr( $link_color ), + 'background-color' => esc_attr( '#ffffff' ), + ), + ); + + $css_output = array_merge( $css_output, $compat_css_desktop ); + } + + /* Parse CSS from array() */ + $css_output = astra_parse_css( $css_output ); + + /* Easy Digital DOwnloads Shop Archive width */ + if ( 'custom' === $edd_archive_width ) : + // Easy Digital DOwnloads shop archive custom width. + $site_width = array( + '.ast-edd-archive-page .site-content > .ast-container' => array( + 'max-width' => astra_get_css_value( $edd_archive_max_width, 'px' ), + ), + ); + $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) ); + + else : + // Easy Digital DOwnloads shop archive default width. + $site_width = array( + '.ast-edd-archive-page .site-content > .ast-container' => array( + 'max-width' => astra_get_css_value( $site_content_width + 40, 'px' ), + ), + ); + + /* Parse CSS from array()*/ + $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) ); + endif; + + $dynamic_css .= apply_filters( 'astra_theme_edd_dynamic_css', $css_output ); + + return $dynamic_css; + } + + /** + * Theme Defaults. + * + * @param array $defaults Array of options value. + * @return array + */ + public function theme_defaults( $defaults ) { + + // Container. + $defaults['edd-content-layout'] = 'plain-container'; + + // // Sidebar. + $defaults['edd-sidebar-layout'] = 'no-sidebar'; + $defaults['edd-single-product-sidebar-layout'] = 'default'; + + // Edd Archive. + $defaults['edd-archive-grids'] = array( + 'desktop' => 4, + 'tablet' => 3, + 'mobile' => 2, + ); + + $defaults['edd-archive-product-structure'] = array( + 'image', + 'category', + 'title', + 'price', + 'add_cart', + ); + + $defaults['edd-archive-add-to-cart-button-text'] = __( 'Add To Cart', 'astra' ); + $defaults['edd-archive-variable-button'] = 'button'; + $defaults['edd-archive-variable-button-text'] = __( 'View Details', 'astra' ); + + $defaults['edd-archive-width'] = 'default'; + $defaults['edd-archive-max-width'] = 1200; + $defaults['disable-edd-single-product-nav'] = false; + + return $defaults; + } + + + /** + * Add products item class to the body + * + * @param Array $classes product classes. + * + * @return array. + */ + public function edd_products_item_class( $classes = '' ) { + + $is_edd_archive_page = astra_is_edd_archive_page(); + + if ( $is_edd_archive_page ) { + $shop_grid = astra_get_option( 'edd-archive-grids' ); + $classes[] = 'columns-' . $shop_grid['desktop']; + $classes[] = 'tablet-columns-' . $shop_grid['tablet']; + $classes[] = 'mobile-columns-' . $shop_grid['mobile']; + + $classes[] = 'ast-edd-archive-page'; + } + + return $classes; + } + + /** + * Add class on single product page + * + * @param Array $classes product classes. + * + * @return array. + */ + public function edd_single_product_class( $classes ) { + + $is_edd_archive_page = astra_is_edd_archive_page(); + + if ( $is_edd_archive_page ) { + $classes[] = 'ast-edd-archive-article'; + } + + return $classes; + } + + /** + * Store widgets init. + */ + public function store_widgets_init() { + register_sidebar( + apply_filters( + 'astra_edd_sidebar_init', + array( + 'name' => esc_html__( 'Easy Digital Downloads Sidebar', 'astra' ), + 'id' => 'astra-edd-sidebar', + 'description' => __( 'This sidebar will be used on Product archive, Cart, Checkout and My Account pages.', 'astra' ), + 'before_widget' => '
    ', + 'after_widget' => '
    ', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + register_sidebar( + apply_filters( + 'astra_edd_single_product_sidebar_init', + array( + 'name' => esc_html__( 'EDD Single Product Sidebar', 'astra' ), + 'id' => 'astra-edd-single-product-sidebar', + 'description' => __( 'This sidebar will be used on EDD Single Product page.', 'astra' ), + 'before_widget' => '
    ', + 'after_widget' => '
    ', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + } + + /** + * Assign shop sidebar for store page. + * + * @param String $sidebar Sidebar. + * + * @return String $sidebar Sidebar. + */ + public function replace_store_sidebar( $sidebar ) { + + $is_edd_page = astra_is_edd_page(); + $is_edd_single_product_page = astra_is_edd_single_product_page(); + + if ( $is_edd_page && ! $is_edd_single_product_page ) { + $sidebar = 'astra-edd-sidebar'; + } elseif ( $is_edd_single_product_page ) { + $sidebar = 'astra-edd-single-product-sidebar'; + } + + return $sidebar; + } + + /** + * Easy Digital Downloads Container + * + * @param String $sidebar_layout Layout type. + * + * @return String $sidebar_layout Layout type. + */ + public function store_sidebar_layout( $sidebar_layout ) { + + $is_edd_page = astra_is_edd_page(); + $is_edd_single_product_page = astra_is_edd_single_product_page(); + $is_edd_archive_page = astra_is_edd_archive_page(); + + if ( $is_edd_page ) { + + $edd_sidebar = astra_get_option( 'edd-sidebar-layout' ); + + if ( 'default' !== $edd_sidebar ) { + + $sidebar_layout = $edd_sidebar; + } + + if ( $is_edd_single_product_page ) { + $edd_single_product_sidebar = astra_get_option( 'edd-single-product-sidebar-layout' ); + + if ( 'default' !== $edd_single_product_sidebar ) { + $sidebar_layout = $edd_single_product_sidebar; + } else { + $sidebar_layout = astra_get_option( 'site-sidebar-layout' ); + } + + $page_id = get_the_ID(); + $edd_sidebar_layout = get_post_meta( $page_id, 'site-sidebar-layout', true ); + } elseif ( $is_edd_archive_page ) { + $edd_sidebar_layout = astra_get_option( 'edd-sidebar-layout' ); + } else { + $edd_sidebar_layout = astra_get_option_meta( 'site-sidebar-layout', '', true ); + } + + if ( 'default' !== $edd_sidebar_layout && ! empty( $edd_sidebar_layout ) ) { + $sidebar_layout = $edd_sidebar_layout; + } + } + + return $sidebar_layout; + } + /** + * Easy Digital Downloads Container + * + * @param String $layout Layout type. + * + * @return String $layout Layout type. + */ + public function store_content_layout( $layout ) { + + $is_edd_page = astra_is_edd_page(); + $is_edd_single_page = astra_is_edd_single_page(); + $is_edd_archive_page = astra_is_edd_archive_page(); + + if ( $is_edd_page ) { + + $edd_layout = astra_get_option( 'edd-content-layout' ); + + if ( 'default' !== $edd_layout ) { + + $layout = $edd_layout; + } + + if ( $is_edd_single_page ) { + $page_id = get_the_ID(); + $edd_page_layout = get_post_meta( $page_id, 'site-content-layout', true ); + } elseif ( $is_edd_archive_page ) { + $edd_page_layout = astra_get_option( 'edd-content-layout' ); + } else { + $edd_page_layout = astra_get_option_meta( 'site-content-layout', '', true ); + } + + if ( 'default' !== $edd_page_layout && ! empty( $edd_page_layout ) ) { + $layout = $edd_page_layout; + } + } + + return $layout; + } + + /** + * Register Customizer sections and panel for Easy Digital Downloads. + * + * @since 1.5.5 + * @param WP_Customize_Manager $wp_customize Theme Customizer object. + */ + public function customize_register( $wp_customize ) { + + // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + /** + * Register Sections & Panels + */ + require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/class-astra-customizer-register-edd-section.php'; + + /** + * Sections + */ + require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/class-astra-edd-container-configs.php'; + require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/class-astra-edd-sidebar-configs.php'; + require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php'; + require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php'; + // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + + } + + } + +endif; + +if ( apply_filters( 'astra_enable_edd_integration', true ) ) { + Astra_Edd::get_instance(); +} diff --git a/inc/compatibility/edd/customizer/class-astra-customizer-register-edd-section.php b/inc/compatibility/edd/customizer/class-astra-customizer-register-edd-section.php index afdfa36..7efaf64 100644 --- a/inc/compatibility/edd/customizer/class-astra-customizer-register-edd-section.php +++ b/inc/compatibility/edd/customizer/class-astra-customizer-register-edd-section.php @@ -1,67 +1,67 @@ - 'section-edd-group', - 'type' => 'section', - 'title' => __( 'Easy Digital Downloads', 'astra' ), - 'priority' => 60, - ), - - array( - 'name' => 'section-edd-archive', - 'title' => __( 'Product Archive', 'astra' ), - 'type' => 'section', - 'section' => 'section-edd-group', - 'priority' => 10, - ), - - array( - 'name' => 'section-edd-single', - 'type' => 'section', - 'title' => __( 'Single Product', 'astra' ), - 'section' => 'section-edd-group', - 'priority' => 15, - ), - ); - - return array_merge( $configurations, $configs ); - } - } -} - - -new Astra_Customizer_Register_Edd_Section(); + 'section-edd-group', + 'type' => 'section', + 'title' => __( 'Easy Digital Downloads', 'astra' ), + 'priority' => 60, + ), + + array( + 'name' => 'section-edd-archive', + 'title' => __( 'Product Archive', 'astra' ), + 'type' => 'section', + 'section' => 'section-edd-group', + 'priority' => 10, + ), + + array( + 'name' => 'section-edd-single', + 'type' => 'section', + 'title' => __( 'Single Product', 'astra' ), + 'section' => 'section-edd-group', + 'priority' => 15, + ), + ); + + return array_merge( $configurations, $configs ); + } + } +} + + +new Astra_Customizer_Register_Edd_Section(); diff --git a/inc/compatibility/edd/customizer/sections/class-astra-edd-container-configs.php b/inc/compatibility/edd/customizer/sections/class-astra-edd-container-configs.php index 45c2cb3..5f48705 100644 --- a/inc/compatibility/edd/customizer/sections/class-astra-edd-container-configs.php +++ b/inc/compatibility/edd/customizer/sections/class-astra-edd-container-configs.php @@ -1,64 +1,64 @@ - ASTRA_THEME_SETTINGS . '[edd-content-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'default' => astra_get_option( 'edd-content-layout' ), - 'section' => 'section-container-layout', - 'priority' => 85, - 'title' => __( 'Easy Digital Downloads Layout', 'astra' ), - 'divider' => array( 'ast_class' => 'ast-top-divider' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'boxed-container' => __( 'Boxed', 'astra' ), - 'content-boxed-container' => __( 'Content Boxed', 'astra' ), - 'plain-container' => __( 'Full Width / Contained', 'astra' ), - 'page-builder' => __( 'Full Width / Stretched', 'astra' ), - ), - ), - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Edd_Container_Configs(); - + ASTRA_THEME_SETTINGS . '[edd-content-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'default' => astra_get_option( 'edd-content-layout' ), + 'section' => 'section-container-layout', + 'priority' => 85, + 'title' => __( 'Easy Digital Downloads Layout', 'astra' ), + 'divider' => array( 'ast_class' => 'ast-top-divider' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'boxed-container' => __( 'Boxed', 'astra' ), + 'content-boxed-container' => __( 'Content Boxed', 'astra' ), + 'plain-container' => __( 'Full Width / Contained', 'astra' ), + 'page-builder' => __( 'Full Width / Stretched', 'astra' ), + ), + ), + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Edd_Container_Configs(); + diff --git a/inc/compatibility/edd/customizer/sections/class-astra-edd-sidebar-configs.php b/inc/compatibility/edd/customizer/sections/class-astra-edd-sidebar-configs.php index eb36e7f..7404dfc 100644 --- a/inc/compatibility/edd/customizer/sections/class-astra-edd-sidebar-configs.php +++ b/inc/compatibility/edd/customizer/sections/class-astra-edd-sidebar-configs.php @@ -1,84 +1,84 @@ - ASTRA_THEME_SETTINGS . '[edd-sidebar-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-sidebars', - 'default' => astra_get_option( 'edd-sidebar-layout' ), - 'priority' => 5, - 'title' => __( 'Easy Digital Downloads', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'no-sidebar' => __( 'No Sidebar', 'astra' ), - 'left-sidebar' => __( 'Left Sidebar', 'astra' ), - 'right-sidebar' => __( 'Right Sidebar', 'astra' ), - ), - ), - - /** - * Option: Single Product - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[edd-single-product-sidebar-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'default' => astra_get_option( 'edd-single-product-sidebar-layout' ), - 'section' => 'section-sidebars', - 'priority' => 5, - 'title' => __( 'EDD Single Product', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'no-sidebar' => __( 'No Sidebar', 'astra' ), - 'left-sidebar' => __( 'Left Sidebar', 'astra' ), - 'right-sidebar' => __( 'Right Sidebar', 'astra' ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Edd_Sidebar_Configs(); - - - + ASTRA_THEME_SETTINGS . '[edd-sidebar-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-sidebars', + 'default' => astra_get_option( 'edd-sidebar-layout' ), + 'priority' => 5, + 'title' => __( 'Easy Digital Downloads', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'no-sidebar' => __( 'No Sidebar', 'astra' ), + 'left-sidebar' => __( 'Left Sidebar', 'astra' ), + 'right-sidebar' => __( 'Right Sidebar', 'astra' ), + ), + ), + + /** + * Option: Single Product + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[edd-single-product-sidebar-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'default' => astra_get_option( 'edd-single-product-sidebar-layout' ), + 'section' => 'section-sidebars', + 'priority' => 5, + 'title' => __( 'EDD Single Product', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'no-sidebar' => __( 'No Sidebar', 'astra' ), + 'left-sidebar' => __( 'Left Sidebar', 'astra' ), + 'right-sidebar' => __( 'Right Sidebar', 'astra' ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Edd_Sidebar_Configs(); + + + diff --git a/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php b/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php index bd770a9..7a088d5 100644 --- a/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php +++ b/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php @@ -1,214 +1,214 @@ - ASTRA_THEME_SETTINGS . '[edd-archive-grids]', - 'type' => 'control', - 'control' => 'ast-responsive-slider', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), - 'section' => 'section-edd-archive', - 'default' => astra_get_option( - 'edd-archive-grids', - array( - 'desktop' => 4, - 'tablet' => 3, - 'mobile' => 2, - ) - ), - 'priority' => 10, - 'title' => __( 'Archive Columns', 'astra' ), - 'input_attrs' => array( - 'step' => 1, - 'min' => 1, - 'max' => 6, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'transport' => 'postMessage', - ), - - /** - * Option: EDD Archive Post Meta - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]', - 'type' => 'control', - 'control' => 'ast-sortable', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), - 'section' => 'section-edd-archive', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'default' => astra_get_option( 'edd-archive-product-structure' ), - 'priority' => 30, - 'title' => __( 'Product Structure', 'astra' ), - 'description' => __( 'The Image option cannot be sortable if the Product Style is selected to the List Style ', 'astra' ), - 'choices' => array( - 'image' => __( 'Image', 'astra' ), - 'category' => __( 'Category', 'astra' ), - 'title' => __( 'Title', 'astra' ), - 'price' => __( 'Price', 'astra' ), - 'short_desc' => __( 'Short Description', 'astra' ), - 'add_cart' => __( 'Add To Cart', 'astra' ), - ), - ), - - /** - * Option: Add to Cart button text - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-add-to-cart-button-text]', - 'type' => 'control', - 'control' => 'text', - 'section' => 'section-edd-archive', - 'default' => astra_get_option( 'edd-archive-add-to-cart-button-text' ), - 'priority' => 31, - 'title' => __( 'Cart Button Text', 'astra' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]', - 'operator' => 'contains', - 'value' => 'add_cart', - ), - ), - ), - - /** - * Option: Variable product button - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-variable-button]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-edd-archive', - 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), - 'default' => astra_get_option( 'edd-archive-variable-button' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]', - 'operator' => 'contains', - 'value' => 'add_cart', - ), - ), - 'priority' => 31, - 'title' => __( 'Variable Product Button', 'astra' ), - 'choices' => array( - 'button' => __( 'Button', 'astra' ), - 'options' => __( 'Options', 'astra' ), - ), - ), - - /** - * Option: Variable product button text - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-variable-button-text]', - 'type' => 'control', - 'control' => 'text', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'section' => 'section-edd-archive', - 'default' => astra_get_option( 'edd-archive-variable-button-text' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-variable-button]', - 'operator' => '==', - 'value' => 'button', - ), - ), - 'priority' => 31, - 'title' => __( 'Variable Product Button Text', 'astra' ), - ), - - /** - * Option: Archive Content Width - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-width]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-edd-archive', - 'default' => astra_get_option( 'edd-archive-width' ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'priority' => 220, - 'title' => __( 'Archive Content Width', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'custom' => __( 'Custom', 'astra' ), - ), - 'transport' => 'postMessage', - ), - - /** - * Option: Enter Width - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-max-width]', - 'type' => 'control', - 'control' => 'ast-slider', - 'section' => 'section-edd-archive', - 'default' => astra_get_option( 'edd-archive-max-width' ), - 'priority' => 225, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-width]', - 'operator' => '===', - 'value' => 'custom', - ), - ), - - 'title' => __( 'Custom Width', 'astra' ), - 'transport' => 'postMessage', - 'suffix' => 'px', - 'input_attrs' => array( - 'min' => 768, - 'step' => 1, - 'max' => 1920, - ), - ), - ); - - $configurations = array_merge( $configurations, $_configs ); - - return $configurations; - - } - } -} - -new Astra_Edd_Archive_Layout_Configs(); - + ASTRA_THEME_SETTINGS . '[edd-archive-grids]', + 'type' => 'control', + 'control' => 'ast-responsive-slider', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), + 'section' => 'section-edd-archive', + 'default' => astra_get_option( + 'edd-archive-grids', + array( + 'desktop' => 4, + 'tablet' => 3, + 'mobile' => 2, + ) + ), + 'priority' => 10, + 'title' => __( 'Archive Columns', 'astra' ), + 'input_attrs' => array( + 'step' => 1, + 'min' => 1, + 'max' => 6, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'transport' => 'postMessage', + ), + + /** + * Option: EDD Archive Post Meta + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]', + 'type' => 'control', + 'control' => 'ast-sortable', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), + 'section' => 'section-edd-archive', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'default' => astra_get_option( 'edd-archive-product-structure' ), + 'priority' => 30, + 'title' => __( 'Product Structure', 'astra' ), + 'description' => __( 'The Image option cannot be sortable if the Product Style is selected to the List Style ', 'astra' ), + 'choices' => array( + 'image' => __( 'Image', 'astra' ), + 'category' => __( 'Category', 'astra' ), + 'title' => __( 'Title', 'astra' ), + 'price' => __( 'Price', 'astra' ), + 'short_desc' => __( 'Short Description', 'astra' ), + 'add_cart' => __( 'Add To Cart', 'astra' ), + ), + ), + + /** + * Option: Add to Cart button text + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-add-to-cart-button-text]', + 'type' => 'control', + 'control' => 'text', + 'section' => 'section-edd-archive', + 'default' => astra_get_option( 'edd-archive-add-to-cart-button-text' ), + 'priority' => 31, + 'title' => __( 'Cart Button Text', 'astra' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]', + 'operator' => 'contains', + 'value' => 'add_cart', + ), + ), + ), + + /** + * Option: Variable product button + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-variable-button]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-edd-archive', + 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), + 'default' => astra_get_option( 'edd-archive-variable-button' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]', + 'operator' => 'contains', + 'value' => 'add_cart', + ), + ), + 'priority' => 31, + 'title' => __( 'Variable Product Button', 'astra' ), + 'choices' => array( + 'button' => __( 'Button', 'astra' ), + 'options' => __( 'Options', 'astra' ), + ), + ), + + /** + * Option: Variable product button text + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-variable-button-text]', + 'type' => 'control', + 'control' => 'text', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'section' => 'section-edd-archive', + 'default' => astra_get_option( 'edd-archive-variable-button-text' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-variable-button]', + 'operator' => '==', + 'value' => 'button', + ), + ), + 'priority' => 31, + 'title' => __( 'Variable Product Button Text', 'astra' ), + ), + + /** + * Option: Archive Content Width + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-width]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-edd-archive', + 'default' => astra_get_option( 'edd-archive-width' ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'priority' => 220, + 'title' => __( 'Archive Content Width', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'custom' => __( 'Custom', 'astra' ), + ), + 'transport' => 'postMessage', + ), + + /** + * Option: Enter Width + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-max-width]', + 'type' => 'control', + 'control' => 'ast-slider', + 'section' => 'section-edd-archive', + 'default' => astra_get_option( 'edd-archive-max-width' ), + 'priority' => 225, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-width]', + 'operator' => '===', + 'value' => 'custom', + ), + ), + + 'title' => __( 'Custom Width', 'astra' ), + 'transport' => 'postMessage', + 'suffix' => 'px', + 'input_attrs' => array( + 'min' => 768, + 'step' => 1, + 'max' => 1920, + ), + ), + ); + + $configurations = array_merge( $configurations, $_configs ); + + return $configurations; + + } + } +} + +new Astra_Edd_Archive_Layout_Configs(); + diff --git a/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php b/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php index 64e163b..ef39d97 100644 --- a/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php +++ b/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php @@ -1,57 +1,57 @@ - ASTRA_THEME_SETTINGS . '[disable-edd-single-product-nav]', - 'section' => 'section-edd-single', - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'default' => astra_get_option( 'disable-edd-single-product-nav' ), - 'title' => __( 'Disable Product Navigation', 'astra' ), - 'priority' => 10, - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - - ), - ); - - return array_merge( $configurations, $_configs ); - } - } -} - -new Astra_Edd_Single_Product_Layout_Configs(); + ASTRA_THEME_SETTINGS . '[disable-edd-single-product-nav]', + 'section' => 'section-edd-single', + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'default' => astra_get_option( 'disable-edd-single-product-nav' ), + 'title' => __( 'Disable Product Navigation', 'astra' ), + 'priority' => 10, + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + + ), + ); + + return array_merge( $configurations, $_configs ); + } + } +} + +new Astra_Edd_Single_Product_Layout_Configs(); diff --git a/inc/compatibility/edd/edd-common-functions.php b/inc/compatibility/edd/edd-common-functions.php index 7bcbca6..7f030d0 100644 --- a/inc/compatibility/edd/edd-common-functions.php +++ b/inc/compatibility/edd/edd-common-functions.php @@ -1,324 +1,324 @@ -'; - do_action( 'astra_edd_archive_block_wrap_top' ); - - foreach ( $edd_structure as $value ) { - - switch ( $value ) { - case 'title': - /** - * Add Product Title on edd page for all products. - */ - do_action( 'astra_edd_archive_title_before' ); - do_action( 'astra_edd_archive_title' ); - do_action( 'astra_edd_archive_title_after' ); - break; - case 'image': - /** - * Add Product Title on edd page for all products. - */ - do_action( 'astra_edd_archive_image_before' ); - do_action( 'astra_edd_archive_image' ); - do_action( 'astra_edd_archive_image_after' ); - break; - case 'price': - /** - * Add Product Price on edd page for all products. - */ - do_action( 'astra_edd_archive_price_before' ); - do_action( 'astra_edd_archive_price' ); - do_action( 'astra_edd_archive_price_after' ); - break; - case 'short_desc': - /** - * Add Product short description on edd page for all products. - */ - do_action( 'astra_edd_archive_short_description_before' ); - do_action( 'astra_edd_archive_short_description' ); - do_action( 'astra_edd_archive_short_description_after' ); - break; - case 'add_cart': - /** - * Add to cart on edd page for all products. - */ - do_action( 'astra_edd_archive_add_to_cart_before' ); - do_action( 'astra_edd_archive_add_to_cart' ); - do_action( 'astra_edd_archive_add_to_cart_after' ); - - break; - case 'category': - /** - * Add and/or Remove Categories from edd archive page. - */ - do_action( 'astra_edd_archive_category_before' ); - do_action( 'astra_edd_archive_category' ); - do_action( 'astra_edd_archive_category_after' ); - break; - default: - break; - } - } - - do_action( 'astra_edd_archive_block_wrap_bottom' ); - echo ''; - do_action( 'astra_edd_archive_after_block_wrap' ); - } - } - - add_action( 'astra_edd_archive_product_content', 'astra_edd_archive_product_structure' ); -} - -/** - * Returns list of Easy Digital Downloads Terms - */ -if ( ! function_exists( 'astra_edd_terms_list' ) ) { - /** - * Show EDD product terms - * - * @param string $taxonomy_name Taxonomy name. - * @return void - */ - function astra_edd_terms_list( $taxonomy_name ) { - $terms = get_terms( $taxonomy_name ); - ?> -
    - - name ); ?> - -
    - '; - $output .= '' . esc_html( $variable_button_text ) . ''; - $output .= ''; - } else { - if ( ! empty( $add_to_cart_text ) ) { - $output = edd_get_purchase_link( - array( - 'price' => false, - 'text' => esc_html( $add_to_cart_text ), - ) - ); - } - } - - return $output; -} +'; + do_action( 'astra_edd_archive_block_wrap_top' ); + + foreach ( $edd_structure as $value ) { + + switch ( $value ) { + case 'title': + /** + * Add Product Title on edd page for all products. + */ + do_action( 'astra_edd_archive_title_before' ); + do_action( 'astra_edd_archive_title' ); + do_action( 'astra_edd_archive_title_after' ); + break; + case 'image': + /** + * Add Product Title on edd page for all products. + */ + do_action( 'astra_edd_archive_image_before' ); + do_action( 'astra_edd_archive_image' ); + do_action( 'astra_edd_archive_image_after' ); + break; + case 'price': + /** + * Add Product Price on edd page for all products. + */ + do_action( 'astra_edd_archive_price_before' ); + do_action( 'astra_edd_archive_price' ); + do_action( 'astra_edd_archive_price_after' ); + break; + case 'short_desc': + /** + * Add Product short description on edd page for all products. + */ + do_action( 'astra_edd_archive_short_description_before' ); + do_action( 'astra_edd_archive_short_description' ); + do_action( 'astra_edd_archive_short_description_after' ); + break; + case 'add_cart': + /** + * Add to cart on edd page for all products. + */ + do_action( 'astra_edd_archive_add_to_cart_before' ); + do_action( 'astra_edd_archive_add_to_cart' ); + do_action( 'astra_edd_archive_add_to_cart_after' ); + + break; + case 'category': + /** + * Add and/or Remove Categories from edd archive page. + */ + do_action( 'astra_edd_archive_category_before' ); + do_action( 'astra_edd_archive_category' ); + do_action( 'astra_edd_archive_category_after' ); + break; + default: + break; + } + } + + do_action( 'astra_edd_archive_block_wrap_bottom' ); + echo ''; + do_action( 'astra_edd_archive_after_block_wrap' ); + } + } + + add_action( 'astra_edd_archive_product_content', 'astra_edd_archive_product_structure' ); +} + +/** + * Returns list of Easy Digital Downloads Terms + */ +if ( ! function_exists( 'astra_edd_terms_list' ) ) { + /** + * Show EDD product terms + * + * @param string $taxonomy_name Taxonomy name. + * @return void + */ + function astra_edd_terms_list( $taxonomy_name ) { + $terms = get_terms( $taxonomy_name ); + ?> +
    + + name ); ?> + +
    + '; + $output .= '' . esc_html( $variable_button_text ) . ''; + $output .= ''; + } else { + if ( ! empty( $add_to_cart_text ) ) { + $output = edd_get_purchase_link( + array( + 'price' => false, + 'text' => esc_html( $add_to_cart_text ), + ) + ); + } + } + + return $output; +} diff --git a/inc/compatibility/index.php b/inc/compatibility/index.php index 8b96815..820bcb9 100644 --- a/inc/compatibility/index.php +++ b/inc/compatibility/index.php @@ -1,9 +1,9 @@ - span, body #learndash_lesson_topics_list span a, body #learndash_profile a, body #learndash_profile a span' => array( - 'font-family' => astra_get_font_family( $body_font_family ), - ), - 'body #ld_course_list .btn, body a.btn-blue, body a.btn-blue:visited, body a#quiz_continue_link, body .btn-join, body .learndash_checkout_buttons input.btn-join[type="button"], body #btn-join, body .learndash_checkout_buttons input.btn-join[type="submit"], body .wpProQuiz_content .wpProQuiz_button2' => array( - 'color' => $btn_color, - 'border-color' => $btn_bg_color, - 'background-color' => $btn_bg_color, - 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), - ), - 'body #ld_course_list .btn:hover, body #ld_course_list .btn:focus, body a.btn-blue:hover, body a.btn-blue:focus, body a#quiz_continue_link:hover, body a#quiz_continue_link:focus, body .btn-join:hover, body .learndash_checkout_buttons input.btn-join[type="button"]:hover, body .btn-join:focus, body .learndash_checkout_buttons input.btn-join[type="button"]:focus, .wpProQuiz_content .wpProQuiz_button2:hover, .wpProQuiz_content .wpProQuiz_button2:focus, body #btn-join:hover, body .learndash_checkout_buttons input.btn-join[type="submit"]:hover, body #btn-join:focus, body .learndash_checkout_buttons input.btn-join[type="submit"]:focus' => array( - 'color' => $btn_h_color, - 'border-color' => $btn_bg_h_color, - 'background-color' => $btn_bg_h_color, - ), - 'body dd.course_progress div.course_progress_blue, body .wpProQuiz_content .wpProQuiz_time_limit .wpProQuiz_progress' => array( - 'background-color' => $theme_color, - ), - 'body #learndash_lessons a, body #learndash_quizzes a, body .expand_collapse a, body .learndash_topic_dots a, body .learndash_topic_dots a > span, body #learndash_lesson_topics_list span a, body #learndash_profile a, #learndash_profile .profile_edit_profile a, body #learndash_profile .expand_collapse a, body #learndash_profile a span, #lessons_list .list-count, #quiz_list .list-count' => array( - 'color' => $link_color, - ), - '.learndash .notcompleted:before, #learndash_profile .notcompleted:before, .learndash_topic_dots ul .topic-notcompleted span:before, .learndash_navigation_lesson_topics_list .topic-notcompleted span:before, .learndash_navigation_lesson_topics_list ul .topic-notcompleted span:before, .learndash .topic-notcompleted span:before' => array( - 'color' => astra_hex_to_rgba( $text_color, .5 ), - ), - 'body .thumbnail.course .ld_course_grid_price, body .thumbnail.course .ld_course_grid_price.ribbon-enrolled, body #learndash_lessons #lesson_heading, body #learndash_profile .learndash_profile_heading, body #learndash_quizzes #quiz_heading, body #learndash_lesson_topics_list div > strong, body .learndash-pager span a, body #learndash_profile .learndash_profile_quiz_heading' => array( - 'background-color' => $theme_color, - 'color' => $theme_forground_color, - ), - '.learndash .completed:before, #learndash_profile .completed:before, .learndash_topic_dots ul .topic-completed span:before, .learndash_navigation_lesson_topics_list .topic-completed span:before, .learndash_navigation_lesson_topics_list ul .topic-completed span:before, .learndash .topic-completed span:before, body .list_arrow.lesson_completed:before' => array( - 'color' => $theme_color, - ), - 'body .thumbnail.course .ld_course_grid_price:before' => array( - 'border-top-color' => astra_hex_to_rgba( $theme_color, .75 ), - 'border-right-color' => astra_hex_to_rgba( $theme_color, .75 ), - ), - 'body .wpProQuiz_loadQuiz, body .wpProQuiz_lock' => array( - 'border-color' => astra_hex_to_rgba( $link_color, .5 ), - 'background-color' => astra_hex_to_rgba( $link_color, .1 ), - ), - '#ld_course_list .entry-title' => array( - 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'desktop' ), - ), - ); - - if ( ! astra_get_option( 'learndash-lesson-serial-number' ) ) { - $css_output['body #course_list .list-count, body #lessons_list .list-count, body #quiz_list .list-count'] = array( - 'display' => 'none', - ); - $css_output['body #course_list > div h4 > a, body #lessons_list > div h4 > a, body #quiz_list > div h4 > a, body #learndash_course_content .learndash_topic_dots ul > li a'] = array( - 'padding-left' => '.75em', - 'margin-left' => 'auto', - ); - } - if ( ! astra_get_option( 'learndash-differentiate-rows' ) ) { - $css_output['body #course_list > div:nth-of-type(odd), body #lessons_list > div:nth-of-type(odd), body #quiz_list > div:nth-of-type(odd), body #learndash_lesson_topics_list .learndash_topic_dots ul > li.nth-of-type-odd'] = array( - 'background' => 'none', - ); - } - - /* Parse CSS from array() */ - $css_output = astra_parse_css( $css_output ); - - $tablet_typography = array( - '#ld_course_list .entry-title' => array( - 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'tablet', 30 ), - ), - ); - /* Parse CSS from array()*/ - $css_output .= astra_parse_css( $tablet_typography, '', astra_get_tablet_breakpoint() ); - - if ( $is_site_rtl ) { - $mobile_min_width_css = array( - 'body #learndash_profile .profile_edit_profile' => array( - 'position' => 'absolute', - 'top' => '15px', - 'left' => '15px', - ), - ); - } else { - $mobile_min_width_css = array( - 'body #learndash_profile .profile_edit_profile' => array( - 'position' => 'absolute', - 'top' => '15px', - 'right' => '15px', - ), - ); - } - - /* Parse CSS from array() -> min-width: (mobile-breakpoint + 1) px */ - $css_output .= astra_parse_css( $mobile_min_width_css, astra_get_mobile_breakpoint( '', 1 ) ); - - $mobile_typography = array( - '#ld_course_list .entry-title' => array( - 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'mobile', 30 ), - ), - '#learndash_next_prev_link a' => array( - 'width' => '100%', - ), - '#learndash_next_prev_link a.prev-link' => array( - 'margin-bottom' => '1em', - ), - '#ld_course_info_mycourses_list .ld-course-info-my-courses .ld-entry-title' => array( - 'margin' => '0 0 20px', - ), - ); - - /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */ - $css_output .= astra_parse_css( $mobile_typography, '', astra_get_mobile_breakpoint() ); - - if ( $is_site_rtl ) { - $mobile_typography_lang_direction_css = array( - '#ld_course_info_mycourses_list .ld-course-info-my-courses img' => array( - 'display' => 'block', - 'margin-right' => 'initial', - 'max-width' => '100%', - 'margin' => '10px 0', - ), - ); - } else { - $mobile_typography_lang_direction_css = array( - '#ld_course_info_mycourses_list .ld-course-info-my-courses img' => array( - 'display' => 'block', - 'margin-left' => 'initial', - 'max-width' => '100%', - 'margin' => '10px 0', - ), - ); - } - - /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */ - $css_output .= astra_parse_css( $mobile_typography_lang_direction_css, '', astra_get_mobile_breakpoint() ); - - $dynamic_css .= apply_filters( 'astra_theme_learndash_dynamic_css', $css_output ); - - return $dynamic_css; - } - - /** - * Register Customizer sections and panel for learndash. - * - * @since 1.3.0 - * @param WP_Customize_Manager $wp_customize Theme Customizer object. - */ - public function customize_register( $wp_customize ) { - - $active_ld_theme = ''; - - if ( is_callable( 'LearnDash_Theme_Register::get_active_theme_key' ) ) { - $active_ld_theme = LearnDash_Theme_Register::get_active_theme_key(); - } - - // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - /** - * Register Sections & Panels - */ - require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/class-astra-customizer-register-learndash-section.php'; - - /** - * Sections - */ - require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/sections/class-astra-learndash-container-configs.php'; - require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/sections/class-astra-learndash-sidebar-configs.php'; - - if ( 'ld30' !== $active_ld_theme ) { - require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/sections/layout/class-astra-learndash-general-configs.php'; - } - // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - } - - /** - * Theme Defaults. - * - * @since 1.3.0 - * @param array $defaults Array of options value. - * @return array - */ - public function theme_defaults( $defaults ) { - - // General. - $defaults['learndash-lesson-serial-number'] = false; - $defaults['learndash-differentiate-rows'] = true; - - // Container. - $defaults['learndash-content-layout'] = 'plain-container'; - - // Sidebar. - $defaults['learndash-sidebar-layout'] = 'default'; - - return $defaults; - } - - /** - * Add assets in theme - * - * @since 1.3.0 - * @param array $assets list of theme assets (JS & CSS). - * @return array List of updated assets. - */ - public function add_styles( $assets ) { - $assets['css']['astra-learndash'] = 'compatibility/learndash'; - return $assets; - } - - /** - * LeanDash Sidebar - * - * @since 1.3.0 - * @param string $layout Layout type. - * @return string $layout Layout type. - */ - public function sidebar_layout( $layout ) { - - if ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) || is_singular( 'sfwd-certificates' ) || is_singular( 'sfwd-assignment' ) ) { - - $learndash_sidebar = astra_get_option( 'learndash-sidebar-layout' ); - if ( 'default' !== $learndash_sidebar ) { - $layout = $learndash_sidebar; - } - - $sidebar = astra_get_option_meta( 'site-sidebar-layout', '', true ); - - if ( 'default' !== $sidebar && ! empty( $sidebar ) ) { - $layout = $sidebar; - } - } - - // When Learhdash shortoce is used on the Page. - // Applied only to the pages which uses the learndash shortcode. - global $learndash_shortcode_used; - - if ( $learndash_shortcode_used && ! ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) || is_singular( 'sfwd-certificates' ) || is_singular( 'sfwd-assignment' ) ) ) { - // Page Meta Sidebar. - $layout = astra_get_option_meta( 'site-sidebar-layout', '', true ); - if ( empty( $layout ) ) { - // Page Sidebar. - $layout = astra_get_option( 'single-page-sidebar-layout' ); - // Default Site Sidebar. - if ( 'default' == $layout || empty( $layout ) ) { - // Get the global sidebar value. - // NOTE: Here not used `true` in the below function call. - $layout = astra_get_option( 'site-sidebar-layout' ); - } - } - } - return $layout; - } - - /** - * LeanDash Container - * - * @since 1.3.0 - * @param string $layout Layout type. - * @return string $layout Layout type. - */ - public function content_layout( $layout ) { - - if ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) || is_singular( 'sfwd-certificates' ) || is_singular( 'sfwd-assignment' ) ) { - - $learndash_layout = astra_get_option( 'learndash-content-layout' ); - - if ( 'default' !== $learndash_layout ) { - $layout = $learndash_layout; - } - - $learndash_layout = astra_get_option_meta( 'site-content-layout', '', true ); - - if ( 'default' !== $learndash_layout && ! empty( $learndash_layout ) ) { - $layout = $learndash_layout; - } - } - - return $layout; - } - - /** - * LearnDash Static CSS. - * - * @since 3.3.0 - * @return string - */ - public static function ld_static_css() { - $ld_static_css = ' - .learndash .completed:before, - .learndash .notcompleted:before, - #learndash_profile .completed:before, - #learndash_profile .notcompleted:before { - content: "\e903"; - display: inline-block; - font-family: "Astra"; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - float: left; - text-indent: 0; - font-size: 1.5em; - line-height: 1; - } - - .learndash .completed:before, - #learndash_profile .completed:before { - content: "\e901"; - font-weight: bold; - } - - .learndash .completed:before, - .learndash .notcompleted:before { - position: absolute; - top: 8px; - right: .75em; - width: 1.75em; - text-align: center; - line-height: 1.2; - } - - .learndash .topic-completed span, - .learndash .topic-notcompleted span { - background: none; - padding: 0; - } - - .learndash .topic-completed span:before, - .learndash .topic-notcompleted span:before { - content: "\e903"; - display: inline-block; - font-family: "Astra"; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-size: 1.25em; - } - - .learndash .topic-completed span:before { - content: "\e901"; - font-weight: bold; - } - - body .learndash .completed, - body .learndash .notcompleted, - body #learndash_profile .completed, - body #learndash_profile .notcompleted { - line-height: 1.7; - background: none; - } - - body .learndash_profile_heading, - body #learndash_profile a, - body #learndash_profile div - { - ont-size: 1em; - font-weight: inherit; - } - - body #lessons_list > div h4, - body #course_list > div h4, - body #quiz_list > div h4, - body #learndash_lesson_topics_list ul > li > span.topic_item { - font-size: 1em; - } - - body #learndash_lessons #lesson_heading, - body #learndash_profile .learndash_profile_heading, - body #learndash_quizzes #quiz_heading, - body #learndash_lesson_topics_list div > strong { - padding: 10px .75em; - font-weight: 600; - text-transform: uppercase; - border-radius: 0; - } - - body #learndash_lessons .right, - body #learndash_quizzes .right { - width: auto; - } - - body .expand_collapse .expand_collapse, - body #learndash_profile .expand_collapse { - top: -1em; - } - - body .expand_collapse .expand_collapse a, - body #learndash_profile .expand_collapse a { - font-size: .8em; - } - - body .expand_collapse .list_arrow.collapse, body .expand_collapse .list_arrow.expand, - body #learndash_profile .list_arrow.collapse, - body #learndash_profile .list_arrow.expand { - vertical-align: top; - } - - body .expand_collapse .list_arrow.collapse:before, body .expand_collapse .list_arrow.expand:before, - body #learndash_profile .list_arrow.collapse:before, - body #learndash_profile .list_arrow.expand:before { - content: "\e900"; - transform: rotate(270deg); - font-weight: bold; - } - - body .expand_collapse .list_arrow.expand:before, - body #learndash_profile .list_arrow.expand:before { - transform: rotate(0deg); - } - body #learndash_lessons #lesson_heading, - body #learndash_profile .learndash_profile_heading, - body #learndash_quizzes #quiz_heading, - body #learndash_lesson_topics_list div > strong { - padding: 10px .75em; - font-weight: 600; - text-transform: uppercase; - border-radius: 0; - } - body #learndash_lesson_topics_list ul > li > span.topic_item:hover { - background: none; - } - - body #learndash_lesson_topics_list .learndash_topic_dots { - order: none; - box-shadow: none; - } - - body #learndash_lesson_topics_list .learndash_topic_dots ul { - border: 1px solid #e2e2e2; - border-top: none; - overflow: hidden; - } - - body #learndash_lesson_topics_list .learndash_topic_dots ul > li:last-child a { - border-bottom: none; - } - - body #learndash_lesson_topics_list .learndash_topic_dots ul > li.nth-of-type-odd { - background: #fbfbfb; - } - - body #learndash_lesson_topics_list .learndash_topic_dots .topic-completed, - body #learndash_lesson_topics_list .learndash_topic_dots .topic-notcompleted { - padding: 8px .75em; - border-bottom: 1px solid #ddd; - } - - body #learndash_lesson_topics_list .learndash_topic_dots .topic-completed span, - body #learndash_lesson_topics_list .learndash_topic_dots .topic-notcompleted span { - margin: 0 auto; - display: inline; - } - body #learndash_lesson_topics_list ul > li > span.topic_item { - font-size: 1em; - } - .learndash .completed:before, - .learndash .notcompleted:before { - position: absolute; - top: 8px; - right: .75em; - width: 1.75em; - text-align: center; - line-height: 1.2; - } - .learndash .topic-completed span, - .learndash .topic-notcompleted span { - background: none; - padding: 0; - } - .learndash .topic-completed span:before, - .learndash .topic-notcompleted span:before { - content: "\e903"; - display: inline-block; - font-family: "Astra"; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-size: 1.25em; - } - .learndash .topic-completed span:before { - content: "\e901"; - font-weight: bold; - } - .widget_ldcoursenavigation .learndash_topic_widget_list .topic-completed span:before, - .widget_ldcoursenavigation .learndash_topic_widget_list .topic-notcompleted span:before { - margin-left: 1px; - margin-right: 9px; - } - body .learndash_navigation_lesson_topics_list .topic-notcompleted span, - body .learndash_navigation_lesson_topics_list ul .topic-notcompleted span, - body .learndash_topic_dots .topic-notcompleted span, - body .learndash_topic_dots ul .topic-notcompleted span { - margin: 5px 0; - } - - body .learndash_navigation_lesson_topics_list .topic-completed span, - body .learndash_navigation_lesson_topics_list .topic-notcompleted span, - body .learndash_navigation_lesson_topics_list ul .topic-completed span, - body .learndash_navigation_lesson_topics_list ul .topic-notcompleted span, - body .learndash_topic_dots .topic-completed span, - body .learndash_topic_dots .topic-notcompleted span, - body .learndash_topic_dots ul .topic-completed span, - body .learndash_topic_dots ul .topic-notcompleted span { - padding-left: 0; - background: none; - margin: 5px 0; - } - - body .learndash_navigation_lesson_topics_list .topic-completed span:before, - body .learndash_navigation_lesson_topics_list .topic-notcompleted span:before, - body .learndash_navigation_lesson_topics_list ul .topic-completed span:before, - body .learndash_navigation_lesson_topics_list ul .topic-notcompleted span:before, - body .learndash_topic_dots .topic-completed span:before, - body .learndash_topic_dots .topic-notcompleted span:before, - body .learndash_topic_dots ul .topic-completed span:before, - body .learndash_topic_dots ul .topic-notcompleted span:before { - content: "\e903"; - display: inline-block; - font-family: "Astra"; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-size: 1em; - font-weight: normal; - margin-right: 10px; - } - - body .learndash_navigation_lesson_topics_list .topic-completed span:before, - body .learndash_navigation_lesson_topics_list ul .topic-completed span:before, - body .learndash_topic_dots .topic-completed span:before, - body .learndash_topic_dots ul .topic-completed span:before { - content: "\e901"; - font-weight: bold; - } - .widget_ldcoursenavigation .learndash_topic_widget_list .topic-completed span:before, - .widget_ldcoursenavigation .learndash_topic_widget_list .topic-notcompleted span:before { - margin-left: 1px; - margin-right: 9px; - } - body .learndash .topic-completed span, - body .learndash .topic-notcompleted span { - background: none; - padding: 0; - } - #learndash_next_prev_link { - margin: 0; - padding: 2em 0 0; - border-top: 1px solid #eeeeee; - overflow: hidden; - line-height: 0; - } - - #learndash_next_prev_link a { - margin: 2px; - display: inline-block; - padding: 0 1.5em; - height: 2.33333em; - line-height: 2.33333em; - text-align: center; - font-size: 16px; - font-size: 1.06666rem; - }'; - return Astra_Enqueue_Scripts::trim_css( $ld_static_css ); - } - } - -endif; - -if ( apply_filters( 'astra_enable_learndash_integration', true ) ) { - - /** - * Kicking this off by calling 'get_instance()' method - */ - Astra_LearnDash::get_instance(); -} + span, body #learndash_lesson_topics_list span a, body #learndash_profile a, body #learndash_profile a span' => array( + 'font-family' => astra_get_font_family( $body_font_family ), + ), + 'body #ld_course_list .btn, body a.btn-blue, body a.btn-blue:visited, body a#quiz_continue_link, body .btn-join, body .learndash_checkout_buttons input.btn-join[type="button"], body #btn-join, body .learndash_checkout_buttons input.btn-join[type="submit"], body .wpProQuiz_content .wpProQuiz_button2' => array( + 'color' => $btn_color, + 'border-color' => $btn_bg_color, + 'background-color' => $btn_bg_color, + 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), + ), + 'body #ld_course_list .btn:hover, body #ld_course_list .btn:focus, body a.btn-blue:hover, body a.btn-blue:focus, body a#quiz_continue_link:hover, body a#quiz_continue_link:focus, body .btn-join:hover, body .learndash_checkout_buttons input.btn-join[type="button"]:hover, body .btn-join:focus, body .learndash_checkout_buttons input.btn-join[type="button"]:focus, .wpProQuiz_content .wpProQuiz_button2:hover, .wpProQuiz_content .wpProQuiz_button2:focus, body #btn-join:hover, body .learndash_checkout_buttons input.btn-join[type="submit"]:hover, body #btn-join:focus, body .learndash_checkout_buttons input.btn-join[type="submit"]:focus' => array( + 'color' => $btn_h_color, + 'border-color' => $btn_bg_h_color, + 'background-color' => $btn_bg_h_color, + ), + 'body dd.course_progress div.course_progress_blue, body .wpProQuiz_content .wpProQuiz_time_limit .wpProQuiz_progress' => array( + 'background-color' => $theme_color, + ), + 'body #learndash_lessons a, body #learndash_quizzes a, body .expand_collapse a, body .learndash_topic_dots a, body .learndash_topic_dots a > span, body #learndash_lesson_topics_list span a, body #learndash_profile a, #learndash_profile .profile_edit_profile a, body #learndash_profile .expand_collapse a, body #learndash_profile a span, #lessons_list .list-count, #quiz_list .list-count' => array( + 'color' => $link_color, + ), + '.learndash .notcompleted:before, #learndash_profile .notcompleted:before, .learndash_topic_dots ul .topic-notcompleted span:before, .learndash_navigation_lesson_topics_list .topic-notcompleted span:before, .learndash_navigation_lesson_topics_list ul .topic-notcompleted span:before, .learndash .topic-notcompleted span:before' => array( + 'color' => astra_hex_to_rgba( $text_color, .5 ), + ), + 'body .thumbnail.course .ld_course_grid_price, body .thumbnail.course .ld_course_grid_price.ribbon-enrolled, body #learndash_lessons #lesson_heading, body #learndash_profile .learndash_profile_heading, body #learndash_quizzes #quiz_heading, body #learndash_lesson_topics_list div > strong, body .learndash-pager span a, body #learndash_profile .learndash_profile_quiz_heading' => array( + 'background-color' => $theme_color, + 'color' => $theme_forground_color, + ), + '.learndash .completed:before, #learndash_profile .completed:before, .learndash_topic_dots ul .topic-completed span:before, .learndash_navigation_lesson_topics_list .topic-completed span:before, .learndash_navigation_lesson_topics_list ul .topic-completed span:before, .learndash .topic-completed span:before, body .list_arrow.lesson_completed:before' => array( + 'color' => $theme_color, + ), + 'body .thumbnail.course .ld_course_grid_price:before' => array( + 'border-top-color' => astra_hex_to_rgba( $theme_color, .75 ), + 'border-right-color' => astra_hex_to_rgba( $theme_color, .75 ), + ), + 'body .wpProQuiz_loadQuiz, body .wpProQuiz_lock' => array( + 'border-color' => astra_hex_to_rgba( $link_color, .5 ), + 'background-color' => astra_hex_to_rgba( $link_color, .1 ), + ), + '#ld_course_list .entry-title' => array( + 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'desktop' ), + ), + ); + + if ( ! astra_get_option( 'learndash-lesson-serial-number' ) ) { + $css_output['body #course_list .list-count, body #lessons_list .list-count, body #quiz_list .list-count'] = array( + 'display' => 'none', + ); + $css_output['body #course_list > div h4 > a, body #lessons_list > div h4 > a, body #quiz_list > div h4 > a, body #learndash_course_content .learndash_topic_dots ul > li a'] = array( + 'padding-left' => '.75em', + 'margin-left' => 'auto', + ); + } + if ( ! astra_get_option( 'learndash-differentiate-rows' ) ) { + $css_output['body #course_list > div:nth-of-type(odd), body #lessons_list > div:nth-of-type(odd), body #quiz_list > div:nth-of-type(odd), body #learndash_lesson_topics_list .learndash_topic_dots ul > li.nth-of-type-odd'] = array( + 'background' => 'none', + ); + } + + /* Parse CSS from array() */ + $css_output = astra_parse_css( $css_output ); + + $tablet_typography = array( + '#ld_course_list .entry-title' => array( + 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'tablet', 30 ), + ), + ); + /* Parse CSS from array()*/ + $css_output .= astra_parse_css( $tablet_typography, '', astra_get_tablet_breakpoint() ); + + if ( $is_site_rtl ) { + $mobile_min_width_css = array( + 'body #learndash_profile .profile_edit_profile' => array( + 'position' => 'absolute', + 'top' => '15px', + 'left' => '15px', + ), + ); + } else { + $mobile_min_width_css = array( + 'body #learndash_profile .profile_edit_profile' => array( + 'position' => 'absolute', + 'top' => '15px', + 'right' => '15px', + ), + ); + } + + /* Parse CSS from array() -> min-width: (mobile-breakpoint + 1) px */ + $css_output .= astra_parse_css( $mobile_min_width_css, astra_get_mobile_breakpoint( '', 1 ) ); + + $mobile_typography = array( + '#ld_course_list .entry-title' => array( + 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'mobile', 30 ), + ), + '#learndash_next_prev_link a' => array( + 'width' => '100%', + ), + '#learndash_next_prev_link a.prev-link' => array( + 'margin-bottom' => '1em', + ), + '#ld_course_info_mycourses_list .ld-course-info-my-courses .ld-entry-title' => array( + 'margin' => '0 0 20px', + ), + ); + + /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */ + $css_output .= astra_parse_css( $mobile_typography, '', astra_get_mobile_breakpoint() ); + + if ( $is_site_rtl ) { + $mobile_typography_lang_direction_css = array( + '#ld_course_info_mycourses_list .ld-course-info-my-courses img' => array( + 'display' => 'block', + 'margin-right' => 'initial', + 'max-width' => '100%', + 'margin' => '10px 0', + ), + ); + } else { + $mobile_typography_lang_direction_css = array( + '#ld_course_info_mycourses_list .ld-course-info-my-courses img' => array( + 'display' => 'block', + 'margin-left' => 'initial', + 'max-width' => '100%', + 'margin' => '10px 0', + ), + ); + } + + /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */ + $css_output .= astra_parse_css( $mobile_typography_lang_direction_css, '', astra_get_mobile_breakpoint() ); + + $dynamic_css .= apply_filters( 'astra_theme_learndash_dynamic_css', $css_output ); + + return $dynamic_css; + } + + /** + * Register Customizer sections and panel for learndash. + * + * @since 1.3.0 + * @param WP_Customize_Manager $wp_customize Theme Customizer object. + */ + public function customize_register( $wp_customize ) { + + $active_ld_theme = ''; + + if ( is_callable( 'LearnDash_Theme_Register::get_active_theme_key' ) ) { + $active_ld_theme = LearnDash_Theme_Register::get_active_theme_key(); + } + + // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + /** + * Register Sections & Panels + */ + require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/class-astra-customizer-register-learndash-section.php'; + + /** + * Sections + */ + require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/sections/class-astra-learndash-container-configs.php'; + require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/sections/class-astra-learndash-sidebar-configs.php'; + + if ( 'ld30' !== $active_ld_theme ) { + require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/sections/layout/class-astra-learndash-general-configs.php'; + } + // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + } + + /** + * Theme Defaults. + * + * @since 1.3.0 + * @param array $defaults Array of options value. + * @return array + */ + public function theme_defaults( $defaults ) { + + // General. + $defaults['learndash-lesson-serial-number'] = false; + $defaults['learndash-differentiate-rows'] = true; + + // Container. + $defaults['learndash-content-layout'] = 'plain-container'; + + // Sidebar. + $defaults['learndash-sidebar-layout'] = 'default'; + + return $defaults; + } + + /** + * Add assets in theme + * + * @since 1.3.0 + * @param array $assets list of theme assets (JS & CSS). + * @return array List of updated assets. + */ + public function add_styles( $assets ) { + $assets['css']['astra-learndash'] = 'compatibility/learndash'; + return $assets; + } + + /** + * LeanDash Sidebar + * + * @since 1.3.0 + * @param string $layout Layout type. + * @return string $layout Layout type. + */ + public function sidebar_layout( $layout ) { + + if ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) || is_singular( 'sfwd-certificates' ) || is_singular( 'sfwd-assignment' ) ) { + + $learndash_sidebar = astra_get_option( 'learndash-sidebar-layout' ); + if ( 'default' !== $learndash_sidebar ) { + $layout = $learndash_sidebar; + } + + $sidebar = astra_get_option_meta( 'site-sidebar-layout', '', true ); + + if ( 'default' !== $sidebar && ! empty( $sidebar ) ) { + $layout = $sidebar; + } + } + + // When Learhdash shortoce is used on the Page. + // Applied only to the pages which uses the learndash shortcode. + global $learndash_shortcode_used; + + if ( $learndash_shortcode_used && ! ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) || is_singular( 'sfwd-certificates' ) || is_singular( 'sfwd-assignment' ) ) ) { + // Page Meta Sidebar. + $layout = astra_get_option_meta( 'site-sidebar-layout', '', true ); + if ( empty( $layout ) ) { + // Page Sidebar. + $layout = astra_get_option( 'single-page-sidebar-layout' ); + // Default Site Sidebar. + if ( 'default' == $layout || empty( $layout ) ) { + // Get the global sidebar value. + // NOTE: Here not used `true` in the below function call. + $layout = astra_get_option( 'site-sidebar-layout' ); + } + } + } + return $layout; + } + + /** + * LeanDash Container + * + * @since 1.3.0 + * @param string $layout Layout type. + * @return string $layout Layout type. + */ + public function content_layout( $layout ) { + + if ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) || is_singular( 'sfwd-certificates' ) || is_singular( 'sfwd-assignment' ) ) { + + $learndash_layout = astra_get_option( 'learndash-content-layout' ); + + if ( 'default' !== $learndash_layout ) { + $layout = $learndash_layout; + } + + $learndash_layout = astra_get_option_meta( 'site-content-layout', '', true ); + + if ( 'default' !== $learndash_layout && ! empty( $learndash_layout ) ) { + $layout = $learndash_layout; + } + } + + return $layout; + } + + /** + * LearnDash Static CSS. + * + * @since 3.3.0 + * @return string + */ + public static function ld_static_css() { + $ld_static_css = ' + .learndash .completed:before, + .learndash .notcompleted:before, + #learndash_profile .completed:before, + #learndash_profile .notcompleted:before { + content: "\e903"; + display: inline-block; + font-family: "Astra"; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + float: left; + text-indent: 0; + font-size: 1.5em; + line-height: 1; + } + + .learndash .completed:before, + #learndash_profile .completed:before { + content: "\e901"; + font-weight: bold; + } + + .learndash .completed:before, + .learndash .notcompleted:before { + position: absolute; + top: 8px; + right: .75em; + width: 1.75em; + text-align: center; + line-height: 1.2; + } + + .learndash .topic-completed span, + .learndash .topic-notcompleted span { + background: none; + padding: 0; + } + + .learndash .topic-completed span:before, + .learndash .topic-notcompleted span:before { + content: "\e903"; + display: inline-block; + font-family: "Astra"; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-size: 1.25em; + } + + .learndash .topic-completed span:before { + content: "\e901"; + font-weight: bold; + } + + body .learndash .completed, + body .learndash .notcompleted, + body #learndash_profile .completed, + body #learndash_profile .notcompleted { + line-height: 1.7; + background: none; + } + + body .learndash_profile_heading, + body #learndash_profile a, + body #learndash_profile div + { + ont-size: 1em; + font-weight: inherit; + } + + body #lessons_list > div h4, + body #course_list > div h4, + body #quiz_list > div h4, + body #learndash_lesson_topics_list ul > li > span.topic_item { + font-size: 1em; + } + + body #learndash_lessons #lesson_heading, + body #learndash_profile .learndash_profile_heading, + body #learndash_quizzes #quiz_heading, + body #learndash_lesson_topics_list div > strong { + padding: 10px .75em; + font-weight: 600; + text-transform: uppercase; + border-radius: 0; + } + + body #learndash_lessons .right, + body #learndash_quizzes .right { + width: auto; + } + + body .expand_collapse .expand_collapse, + body #learndash_profile .expand_collapse { + top: -1em; + } + + body .expand_collapse .expand_collapse a, + body #learndash_profile .expand_collapse a { + font-size: .8em; + } + + body .expand_collapse .list_arrow.collapse, body .expand_collapse .list_arrow.expand, + body #learndash_profile .list_arrow.collapse, + body #learndash_profile .list_arrow.expand { + vertical-align: top; + } + + body .expand_collapse .list_arrow.collapse:before, body .expand_collapse .list_arrow.expand:before, + body #learndash_profile .list_arrow.collapse:before, + body #learndash_profile .list_arrow.expand:before { + content: "\e900"; + transform: rotate(270deg); + font-weight: bold; + } + + body .expand_collapse .list_arrow.expand:before, + body #learndash_profile .list_arrow.expand:before { + transform: rotate(0deg); + } + body #learndash_lessons #lesson_heading, + body #learndash_profile .learndash_profile_heading, + body #learndash_quizzes #quiz_heading, + body #learndash_lesson_topics_list div > strong { + padding: 10px .75em; + font-weight: 600; + text-transform: uppercase; + border-radius: 0; + } + body #learndash_lesson_topics_list ul > li > span.topic_item:hover { + background: none; + } + + body #learndash_lesson_topics_list .learndash_topic_dots { + order: none; + box-shadow: none; + } + + body #learndash_lesson_topics_list .learndash_topic_dots ul { + border: 1px solid #e2e2e2; + border-top: none; + overflow: hidden; + } + + body #learndash_lesson_topics_list .learndash_topic_dots ul > li:last-child a { + border-bottom: none; + } + + body #learndash_lesson_topics_list .learndash_topic_dots ul > li.nth-of-type-odd { + background: #fbfbfb; + } + + body #learndash_lesson_topics_list .learndash_topic_dots .topic-completed, + body #learndash_lesson_topics_list .learndash_topic_dots .topic-notcompleted { + padding: 8px .75em; + border-bottom: 1px solid #ddd; + } + + body #learndash_lesson_topics_list .learndash_topic_dots .topic-completed span, + body #learndash_lesson_topics_list .learndash_topic_dots .topic-notcompleted span { + margin: 0 auto; + display: inline; + } + body #learndash_lesson_topics_list ul > li > span.topic_item { + font-size: 1em; + } + .learndash .completed:before, + .learndash .notcompleted:before { + position: absolute; + top: 8px; + right: .75em; + width: 1.75em; + text-align: center; + line-height: 1.2; + } + .learndash .topic-completed span, + .learndash .topic-notcompleted span { + background: none; + padding: 0; + } + .learndash .topic-completed span:before, + .learndash .topic-notcompleted span:before { + content: "\e903"; + display: inline-block; + font-family: "Astra"; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-size: 1.25em; + } + .learndash .topic-completed span:before { + content: "\e901"; + font-weight: bold; + } + .widget_ldcoursenavigation .learndash_topic_widget_list .topic-completed span:before, + .widget_ldcoursenavigation .learndash_topic_widget_list .topic-notcompleted span:before { + margin-left: 1px; + margin-right: 9px; + } + body .learndash_navigation_lesson_topics_list .topic-notcompleted span, + body .learndash_navigation_lesson_topics_list ul .topic-notcompleted span, + body .learndash_topic_dots .topic-notcompleted span, + body .learndash_topic_dots ul .topic-notcompleted span { + margin: 5px 0; + } + + body .learndash_navigation_lesson_topics_list .topic-completed span, + body .learndash_navigation_lesson_topics_list .topic-notcompleted span, + body .learndash_navigation_lesson_topics_list ul .topic-completed span, + body .learndash_navigation_lesson_topics_list ul .topic-notcompleted span, + body .learndash_topic_dots .topic-completed span, + body .learndash_topic_dots .topic-notcompleted span, + body .learndash_topic_dots ul .topic-completed span, + body .learndash_topic_dots ul .topic-notcompleted span { + padding-left: 0; + background: none; + margin: 5px 0; + } + + body .learndash_navigation_lesson_topics_list .topic-completed span:before, + body .learndash_navigation_lesson_topics_list .topic-notcompleted span:before, + body .learndash_navigation_lesson_topics_list ul .topic-completed span:before, + body .learndash_navigation_lesson_topics_list ul .topic-notcompleted span:before, + body .learndash_topic_dots .topic-completed span:before, + body .learndash_topic_dots .topic-notcompleted span:before, + body .learndash_topic_dots ul .topic-completed span:before, + body .learndash_topic_dots ul .topic-notcompleted span:before { + content: "\e903"; + display: inline-block; + font-family: "Astra"; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-size: 1em; + font-weight: normal; + margin-right: 10px; + } + + body .learndash_navigation_lesson_topics_list .topic-completed span:before, + body .learndash_navigation_lesson_topics_list ul .topic-completed span:before, + body .learndash_topic_dots .topic-completed span:before, + body .learndash_topic_dots ul .topic-completed span:before { + content: "\e901"; + font-weight: bold; + } + .widget_ldcoursenavigation .learndash_topic_widget_list .topic-completed span:before, + .widget_ldcoursenavigation .learndash_topic_widget_list .topic-notcompleted span:before { + margin-left: 1px; + margin-right: 9px; + } + body .learndash .topic-completed span, + body .learndash .topic-notcompleted span { + background: none; + padding: 0; + } + #learndash_next_prev_link { + margin: 0; + padding: 2em 0 0; + border-top: 1px solid #eeeeee; + overflow: hidden; + line-height: 0; + } + + #learndash_next_prev_link a { + margin: 2px; + display: inline-block; + padding: 0 1.5em; + height: 2.33333em; + line-height: 2.33333em; + text-align: center; + font-size: 16px; + font-size: 1.06666rem; + }'; + return Astra_Enqueue_Scripts::trim_css( $ld_static_css ); + } + } + +endif; + +if ( apply_filters( 'astra_enable_learndash_integration', true ) ) { + + /** + * Kicking this off by calling 'get_instance()' method + */ + Astra_LearnDash::get_instance(); +} diff --git a/inc/compatibility/learndash/customizer/class-astra-customizer-register-learndash-section.php b/inc/compatibility/learndash/customizer/class-astra-customizer-register-learndash-section.php index f9e2370..471def0 100644 --- a/inc/compatibility/learndash/customizer/class-astra-customizer-register-learndash-section.php +++ b/inc/compatibility/learndash/customizer/class-astra-customizer-register-learndash-section.php @@ -1,50 +1,50 @@ - 'section', - 'name' => 'section-learndash', - 'priority' => 65, - 'title' => __( 'LearnDash', 'astra' ), - ), - ); - - return array_merge( $configurations, $configs ); - } - } -} - - -new Astra_Customizer_Register_Learndash_Section(); + 'section', + 'name' => 'section-learndash', + 'priority' => 65, + 'title' => __( 'LearnDash', 'astra' ), + ), + ); + + return array_merge( $configurations, $configs ); + } + } +} + + +new Astra_Customizer_Register_Learndash_Section(); diff --git a/inc/compatibility/learndash/customizer/sections/class-astra-learndash-container-configs.php b/inc/compatibility/learndash/customizer/sections/class-astra-learndash-container-configs.php index 9e0d704..218c477 100644 --- a/inc/compatibility/learndash/customizer/sections/class-astra-learndash-container-configs.php +++ b/inc/compatibility/learndash/customizer/sections/class-astra-learndash-container-configs.php @@ -1,63 +1,63 @@ - ASTRA_THEME_SETTINGS . '[learndash-content-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-container-layout', - 'default' => astra_get_option( 'learndash-content-layout' ), - 'priority' => 68, - 'title' => __( 'LearnDash Layout', 'astra' ), - 'description' => __( 'Will be applied to All Single Courses, Topics, Lessons and Quizzes. Does not work on pages created with LearnDash shortcodes.', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'boxed-container' => __( 'Boxed', 'astra' ), - 'content-boxed-container' => __( 'Content Boxed', 'astra' ), - 'plain-container' => __( 'Full Width / Contained', 'astra' ), - 'page-builder' => __( 'Full Width / Stretched', 'astra' ), - ), - ), - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Learndash_Container_Configs(); + ASTRA_THEME_SETTINGS . '[learndash-content-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-container-layout', + 'default' => astra_get_option( 'learndash-content-layout' ), + 'priority' => 68, + 'title' => __( 'LearnDash Layout', 'astra' ), + 'description' => __( 'Will be applied to All Single Courses, Topics, Lessons and Quizzes. Does not work on pages created with LearnDash shortcodes.', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'boxed-container' => __( 'Boxed', 'astra' ), + 'content-boxed-container' => __( 'Content Boxed', 'astra' ), + 'plain-container' => __( 'Full Width / Contained', 'astra' ), + 'page-builder' => __( 'Full Width / Stretched', 'astra' ), + ), + ), + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Learndash_Container_Configs(); diff --git a/inc/compatibility/learndash/customizer/sections/class-astra-learndash-sidebar-configs.php b/inc/compatibility/learndash/customizer/sections/class-astra-learndash-sidebar-configs.php index 336afee..d1dc90f 100644 --- a/inc/compatibility/learndash/customizer/sections/class-astra-learndash-sidebar-configs.php +++ b/inc/compatibility/learndash/customizer/sections/class-astra-learndash-sidebar-configs.php @@ -1,62 +1,62 @@ - ASTRA_THEME_SETTINGS . '[learndash-sidebar-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-sidebars', - 'divider' => array( 'ast_class' => 'ast-top-divider' ), - 'default' => astra_get_option( 'learndash-sidebar-layout' ), - 'priority' => 5, - 'title' => __( 'LearnDash', 'astra' ), - 'description' => __( 'This layout will apply on all single course, lesson, topic and quiz.', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'no-sidebar' => __( 'No Sidebar', 'astra' ), - 'left-sidebar' => __( 'Left Sidebar', 'astra' ), - 'right-sidebar' => __( 'Right Sidebar', 'astra' ), - ), - ), - ); - - return array_merge( $configurations, $_configs ); - } - } -} - -new Astra_Learndash_Sidebar_Configs(); + ASTRA_THEME_SETTINGS . '[learndash-sidebar-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-sidebars', + 'divider' => array( 'ast_class' => 'ast-top-divider' ), + 'default' => astra_get_option( 'learndash-sidebar-layout' ), + 'priority' => 5, + 'title' => __( 'LearnDash', 'astra' ), + 'description' => __( 'This layout will apply on all single course, lesson, topic and quiz.', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'no-sidebar' => __( 'No Sidebar', 'astra' ), + 'left-sidebar' => __( 'Left Sidebar', 'astra' ), + 'right-sidebar' => __( 'Right Sidebar', 'astra' ), + ), + ), + ); + + return array_merge( $configurations, $_configs ); + } + } +} + +new Astra_Learndash_Sidebar_Configs(); diff --git a/inc/compatibility/learndash/customizer/sections/layout/class-astra-learndash-general-configs.php b/inc/compatibility/learndash/customizer/sections/layout/class-astra-learndash-general-configs.php index 5a3b019..a6af15a 100644 --- a/inc/compatibility/learndash/customizer/sections/layout/class-astra-learndash-general-configs.php +++ b/inc/compatibility/learndash/customizer/sections/layout/class-astra-learndash-general-configs.php @@ -1,72 +1,72 @@ - ASTRA_THEME_SETTINGS . '[learndash-lesson-serial-number]', - 'section' => 'section-learndash', - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'default' => astra_get_option( 'learndash-lesson-serial-number' ), - 'title' => __( 'Display Serial Number', 'astra' ), - 'priority' => 25, - 'divider' => array( - 'ast_class' => 'ast-top-divider', - 'ast_title' => __( 'Course Content Table', 'astra' ), - ), - ), - - /** - * Option: Differentiate Rows - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[learndash-differentiate-rows]', - 'default' => astra_get_option( 'learndash-differentiate-rows' ), - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'section' => 'section-learndash', - 'title' => __( 'Differentiate Rows', 'astra' ), - 'priority' => 30, - ), - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Learndash_General_Configs(); + ASTRA_THEME_SETTINGS . '[learndash-lesson-serial-number]', + 'section' => 'section-learndash', + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'default' => astra_get_option( 'learndash-lesson-serial-number' ), + 'title' => __( 'Display Serial Number', 'astra' ), + 'priority' => 25, + 'divider' => array( + 'ast_class' => 'ast-top-divider', + 'ast_title' => __( 'Course Content Table', 'astra' ), + ), + ), + + /** + * Option: Differentiate Rows + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[learndash-differentiate-rows]', + 'default' => astra_get_option( 'learndash-differentiate-rows' ), + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'section' => 'section-learndash', + 'title' => __( 'Differentiate Rows', 'astra' ), + 'priority' => 30, + ), + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Learndash_General_Configs(); diff --git a/inc/compatibility/lifterlms/class-astra-lifterlms.php b/inc/compatibility/lifterlms/class-astra-lifterlms.php index 48d6344..c3d7811 100644 --- a/inc/compatibility/lifterlms/class-astra-lifterlms.php +++ b/inc/compatibility/lifterlms/class-astra-lifterlms.php @@ -1,858 +1,858 @@ - 3, - 'tablet' => 2, - 'mobile' => 1, - ); - $defaults['llms-membership-grid'] = array( - 'desktop' => 3, - 'tablet' => 2, - 'mobile' => 1, - ); - - // Container. - $defaults['lifterlms-content-layout'] = 'plain-container'; - - // Sidebar. - $defaults['lifterlms-sidebar-layout'] = 'no-sidebar'; - $defaults['lifterlms-course-lesson-sidebar-layout'] = 'default'; - - return $defaults; - } - - /** - * This function handles the HTML output of the reviews and review form. - * If the option is enabled, the review form will be output, - * if not, nothing will happen. This function also checks to - * see if a user is allowed to review more than once. - * - * @since 1.2.0 - */ - public function single_reviews() { - - /** - * Check to see if we are supposed to output the code at all - */ - if ( get_post_meta( get_the_ID(), '_llms_display_reviews', true ) ) { - ?> -
    -

    - get_post_meta( get_the_ID(), '_llms_num_reviews', true ), // phpcs:ignore WPThemeReview.CoreFunctionality.PostsPerPage.posts_per_page_posts_per_page, WordPress.WP.PostsPerPage.posts_per_page_posts_per_page - 'post_type' => 'llms_review', - 'post_status' => 'publish', - 'post_parent' => get_the_ID(), - 'suppress_filters' => true, - ); - $posts_array = get_posts( $args ); - - $styles = array( - 'background-color' => '#EFEFEF', - 'title-color' => 'inherit', - 'text-color' => 'inherit', - 'custom-css' => '', - ); - - if ( has_filter( 'llms_review_custom_styles' ) ) { - $styles = apply_filters( 'llms_review_custom_styles', $styles ); - } - - foreach ( $posts_array as $post ) { - echo $styles['custom-css']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - - ?> -
    -
    ID ) ); ?>
    - -
    ID ) ) ) ); ?>
    -

    ID ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

    -
    - -
    -
    - 1, - 'post_type' => 'llms_review', - 'post_status' => 'publish', - 'post_parent' => get_the_ID(), - 'author' => get_current_user_id(), - 'suppress_filters' => true, - ); - $posts_array = get_posts( $args ); - - /** - * Check to see if we are allowed to write more than one review. - * If we are not, check to see if we have written a review already. - */ - if ( get_post_meta( get_the_ID(), '_llms_multiple_reviews_disabled', true ) && $posts_array ) { - ?> -
    -

    -
    - -
    -

    - - - - - - - - -
    - - = 0 ) { - unset( $classes[ $index ] ); - } - } - $classes[] = 'cols-' . $llms_grid['desktop']; - } - } - - if ( ! empty( $llms_grid['tablet'] ) ) { - $classes[] = 'llms-tablet-cols-' . $llms_grid['tablet']; - } - if ( ! empty( $llms_grid['mobile'] ) ) { - $classes[] = 'llms-mobile-cols-' . $llms_grid['mobile']; - } - - return $classes; - } - - /** - * Enqueue styles - * - * @since 1.2.0 - * @return void - */ - public function add_dynamic_styles() { - - /** - * - Variable Declaration - */ - $theme_color = astra_get_option( 'theme-color' ); - $link_color = astra_get_option( 'link-color', $theme_color ); - $link_h_color = astra_get_option( 'link-h-color' ); - - $theme_forground_color = astra_get_foreground_color( $link_color ); - $btn_color = astra_get_option( 'button-color' ); - if ( empty( $btn_color ) ) { - $btn_color = $theme_forground_color; - } - - $btn_h_color = astra_get_option( 'button-h-color' ); - if ( empty( $btn_h_color ) ) { - $btn_h_color = astra_get_foreground_color( $link_h_color ); - } - $btn_bg_color = astra_get_option( 'button-bg-color', '', $link_color ); - $btn_bg_h_color = astra_get_option( 'button-bg-h-color', '', $link_h_color ); - - $btn_border_radius = astra_get_option( 'button-radius' ); - $theme_btn_padding = astra_get_option( 'theme-button-padding' ); - - $css_output = array( - 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, button.llms-field-button, a.llms-field-button' => array( - 'color' => $btn_color, - 'border-color' => $btn_bg_color, - 'background-color' => $btn_bg_color, - ), - 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, .llms-field-button, .llms-button-action.large' => array( - 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), - ), - 'a.llms-button-primary:hover, a.llms-button-primary:focus, .llms-button-secondary:hover, .llms-button-secondary:focus, .llms-button-action:hover, .llms-button-action:focus, button.llms-field-button:hover, button.llms-field-button:focus, a.llms-field-button:hover, a.llms-field-button:focus' => array( - 'color' => $btn_h_color, - 'border-color' => $btn_bg_h_color, - 'background-color' => $btn_bg_h_color, - ), - 'nav.llms-pagination ul li a:focus, nav.llms-pagination ul li a:hover, nav.llms-pagination ul li span.current' => array( - 'background' => $link_color, - 'color' => $btn_color, - ), - 'nav.llms-pagination ul, nav.llms-pagination ul li, .llms-instructor-info .llms-instructors .llms-author, .llms-instructor-info .llms-instructors .llms-author .avatar' => array( - 'border-color' => $link_color, - ), - '.llms-progress .progress-bar-complete, .llms-instructor-info .llms-instructors .llms-author .avatar, h4.llms-access-plan-title, .llms-lesson-preview .llms-icon-free, .llms-access-plan .stamp, .llms-student-dashboard .llms-status.llms-active, .llms-student-dashboard .llms-status.llms-completed, .llms-student-dashboard .llms-status.llms-txn-succeeded, .color-full, body .llms-syllabus-wrapper .llms-section-title' => array( - 'background' => $link_color, - ), - '.llms-lesson-preview.is-complete .llms-lesson-complete, .llms-lesson-preview.is-free .llms-lesson-complete, .llms-widget-syllabus .lesson-complete-placeholder.done, .llms-widget-syllabus .llms-lesson-complete.done, .single-llms_quiz .llms-quiz-results .llms-donut.passing, .llms-quiz-timer' => array( - 'color' => $link_color, - ), - '.llms-quiz-timer' => array( - 'border-color' => $link_color, - ), - '.single-llms_quiz .llms-quiz-results .llms-donut.passing svg path' => array( - 'stroke' => $link_color, - ), - 'h4.llms-access-plan-title, .llms-instructor-info .llms-instructors .llms-author .avatar, h4.llms-access-plan-title, .llms-lesson-preview .llms-icon-free, .llms-access-plan .stamp, .llms-student-dashboard .llms-status.llms-active, .llms-student-dashboard .llms-status.llms-completed, .llms-student-dashboard .llms-status.llms-txn-succeeded, body .llms-syllabus-wrapper .llms-section-title' => array( - 'color' => $theme_forground_color, - ), - 'body .progress-bar-complete:after' => array( - 'color' => $theme_forground_color, - ), - ); - - /* Parse CSS from array() */ - $css_output = astra_parse_css( $css_output ); - - if ( is_lesson() ) { - $css_output .= $this->llms_single_lesson_css(); - } - /** - * Global button CSS - Tablet. - */ - $css_global_button_tablet = array( - 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, .llms-field-button, .llms-button-action.large' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), - ), - ); - - $css_output .= astra_parse_css( $css_global_button_tablet, '', astra_get_tablet_breakpoint() ); - - /** - * Global button CSS - Mobile. - */ - $css_global_button_mobile = array( - 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, .llms-field-button, .llms-button-action.large' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), - ), - ); - - $css_output .= astra_parse_css( $css_global_button_mobile, '', astra_get_mobile_breakpoint() ); - - wp_add_inline_style( 'lifterlms-styles', apply_filters( 'astra_theme_lifterlms_dynamic_css', $css_output ) ); - - } - - /** - * Add start of wrapper - * - * @since 1.2.0 - * @return void - */ - public function before_main_content_start() { - $site_sidebar = astra_page_layout(); - if ( 'left-sidebar' == $site_sidebar ) { - get_sidebar(); - } - ?> -
    - - - -
    -
    - -
    -
    - - - -
    - 'ast-main-header-display', - 'id' => 'ast-main-header-display', - 'label' => esc_html__( 'Disable Primary Header', 'astra' ), - 'switch_on' => 'disabled', - 'type' => 'switch', - ); - /** - * Above Header - */ - $disable_fields[] = array( - 'attribute' => 'ast-hfb-above-header-display', - 'id' => 'ast-hfb-above-header-display', - 'label' => esc_html__( 'Disable Above Header', 'astra' ), - 'switch_on' => 'disabled', - 'type' => 'switch', - ); - /** - * Below Header - */ - $disable_fields[] = array( - 'attribute' => 'ast-hfb-below-header-display', - 'id' => 'ast-hfb-below-header-display', - 'label' => esc_html__( 'Disable Below Header', 'astra' ), - 'switch_on' => 'disabled', - 'type' => 'switch', - ); - /** - * Mobile Header - */ - $disable_fields[] = array( - 'attribute' => 'ast-hfb-mobile-header-display', - 'id' => 'ast-hfb-mobile-header-display', - 'label' => esc_html__( 'Disable Mobile Header', 'astra' ), - 'switch_on' => 'disabled', - 'type' => 'switch', - ); - if ( $show_meta_field ) { - $disable_fields[] = array( - 'attribute' => 'site-post-title', - 'id' => 'site-post-title', - 'label' => esc_html__( 'Disable Title', 'astra' ), - 'switch_on' => 'disabled', - 'type' => 'switch', - ); - } - if ( $show_meta_field && 'disabled' != astra_get_option( 'footer-adv' ) ) { - $disable_fields[] = array( - 'attribute' => 'footer-adv-display', - 'id' => 'footer-adv-display', - 'label' => esc_html__( 'Disable Footer Widgets', 'astra' ), - 'switch_on' => 'disabled', - 'type' => 'switch', - ); - } - if ( 'disabled' != astra_get_option( 'footer-sml-layout' ) ) { - $disable_fields[] = array( - 'attribute' => 'footer-sml-layout', - 'id' => 'footer-sml-layout', - 'label' => esc_html__( 'Disable Footer', 'astra' ), - 'switch_on' => 'disabled', - 'type' => 'switch', - ); - } - $fields['astra_theme_settings'] = array( - 'title' => __( 'Astra Settings', 'astra' ), - 'toggleable' => true, - 'fields' => apply_filters( - 'astra_theme_lifterlms_settings', - array( - array( - array( - 'attribute' => 'site-sidebar-layout', - 'id' => 'site-sidebar-layout', - 'label' => esc_html__( 'Sidebar', 'astra' ), - 'type' => 'ast-select', - 'options' => array( - 'default' => esc_html__( 'Customizer Setting', 'astra' ), - 'left-sidebar' => esc_html__( 'Left Sidebar', 'astra' ), - 'right-sidebar' => esc_html__( 'Right Sidebar', 'astra' ), - 'no-sidebar' => esc_html__( 'No Sidebar', 'astra' ), - ), - ), - array( - 'attribute' => 'site-content-layout', - 'id' => 'site-content-layout', - 'label' => esc_html__( 'Content Layout', 'astra' ), - 'type' => 'ast-select', - 'options' => array( - 'default' => esc_html__( 'Customizer Setting', 'astra' ), - 'boxed-container' => esc_html__( 'Boxed', 'astra' ), - 'content-boxed-container' => esc_html__( 'Content Boxed', 'astra' ), - 'plain-container' => esc_html__( 'Full Width / Contained', 'astra' ), - 'page-builder' => esc_html__( 'Full Width / Stretched', 'astra' ), - ), - ), - ), - $disable_fields, - ) - ), - ); - $default_fields['assignment'] = $fields; - $default_fields['lesson'] = $fields; - $default_fields['quiz'] = $fields; - return $default_fields; - } - - /** - * Llms single lesson static CSS move to dynamic to load conditionally. - * - * @since 3.3.0 - * @return string - */ - public function llms_single_lesson_css() { - $single_lesson_static_css = ' - .single-lesson.ast-separate-container .llms-lesson-preview .llms-lesson-link { - background: #fff; - } - - .single-lesson.ast-separate-container .llms-lesson-preview .llms-lesson-link:hover { - background: #fafafa; - } - - .single-lesson .ast-article-single .llms-lesson-button-wrapper { - font-weight: 600; - } - - .single-lesson .ast-article-single .llms-lesson-button-wrapper .llms-complete-lesson-form .llms-field-button:before { - content: "\2714"; - margin-right: .5em; - } - - .single-lesson .llms-course-navigation { - padding: 2em 0 0; - border-top: 1px solid #eeeeee; - } - - .single-lesson .llms-course-navigation .llms-lesson-preview { - vertical-align: top; - margin-top: 0; - } - - .single-lesson .llms-course-navigation .llms-lesson-preview .llms-lesson-link { - padding-left: 20px; - padding-right: 20px; - } - - .single-lesson .llms-course-navigation .llms-prev-lesson h6.llms-pre-text:before { - content: "\2190"; - margin-right: .5em; - } - - .single-lesson .llms-course-navigation .llms-back-to-course:first-child h6.llms-pre-text:before { - content: "\2190"; - margin-right: .5em; - } - - .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course h6.llms-pre-text:after, - .single-lesson .llms-course-navigation .llms-next-lesson h6.llms-pre-text:after { - content: "\2192"; - margin-left: 5px; - } - - .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course .llms-lesson-title, - .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course .llms-lesson-excerpt, - .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course h6.llms-pre-text, - .single-lesson .llms-course-navigation .llms-next-lesson .llms-lesson-title, - .single-lesson .llms-course-navigation .llms-next-lesson .llms-lesson-excerpt, - .single-lesson .llms-course-navigation .llms-next-lesson h6.llms-pre-text { - text-align: right; - } - - @media (max-width: 544px) { - .single-lesson .llms-course-navigation { - padding-top: 1.5em; - } - .single-lesson .llms-course-navigation .llms-course-nav { - width: 100%; - margin: 0; - } - .single-lesson .llms-course-navigation .llms-course-nav:first-child { - margin-bottom: 1.5em; - } - }'; - return Astra_Enqueue_Scripts::trim_css( $single_lesson_static_css ); - } - } - -endif; - -/** - * Kicking this off by calling 'get_instance()' method - */ -if ( apply_filters( 'astra_enable_lifterlms_integration', true ) ) { - Astra_LifterLMS::get_instance(); -} + 3, + 'tablet' => 2, + 'mobile' => 1, + ); + $defaults['llms-membership-grid'] = array( + 'desktop' => 3, + 'tablet' => 2, + 'mobile' => 1, + ); + + // Container. + $defaults['lifterlms-content-layout'] = 'plain-container'; + + // Sidebar. + $defaults['lifterlms-sidebar-layout'] = 'no-sidebar'; + $defaults['lifterlms-course-lesson-sidebar-layout'] = 'default'; + + return $defaults; + } + + /** + * This function handles the HTML output of the reviews and review form. + * If the option is enabled, the review form will be output, + * if not, nothing will happen. This function also checks to + * see if a user is allowed to review more than once. + * + * @since 1.2.0 + */ + public function single_reviews() { + + /** + * Check to see if we are supposed to output the code at all + */ + if ( get_post_meta( get_the_ID(), '_llms_display_reviews', true ) ) { + ?> +
    +

    + get_post_meta( get_the_ID(), '_llms_num_reviews', true ), // phpcs:ignore WPThemeReview.CoreFunctionality.PostsPerPage.posts_per_page_posts_per_page, WordPress.WP.PostsPerPage.posts_per_page_posts_per_page + 'post_type' => 'llms_review', + 'post_status' => 'publish', + 'post_parent' => get_the_ID(), + 'suppress_filters' => true, + ); + $posts_array = get_posts( $args ); + + $styles = array( + 'background-color' => '#EFEFEF', + 'title-color' => 'inherit', + 'text-color' => 'inherit', + 'custom-css' => '', + ); + + if ( has_filter( 'llms_review_custom_styles' ) ) { + $styles = apply_filters( 'llms_review_custom_styles', $styles ); + } + + foreach ( $posts_array as $post ) { + echo $styles['custom-css']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + + ?> +
    +
    ID ) ); ?>
    + +
    ID ) ) ) ); ?>
    +

    ID ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

    +
    + +
    +
    + 1, + 'post_type' => 'llms_review', + 'post_status' => 'publish', + 'post_parent' => get_the_ID(), + 'author' => get_current_user_id(), + 'suppress_filters' => true, + ); + $posts_array = get_posts( $args ); + + /** + * Check to see if we are allowed to write more than one review. + * If we are not, check to see if we have written a review already. + */ + if ( get_post_meta( get_the_ID(), '_llms_multiple_reviews_disabled', true ) && $posts_array ) { + ?> +
    +

    +
    + +
    +

    + + + + + + + + +
    + + = 0 ) { + unset( $classes[ $index ] ); + } + } + $classes[] = 'cols-' . $llms_grid['desktop']; + } + } + + if ( ! empty( $llms_grid['tablet'] ) ) { + $classes[] = 'llms-tablet-cols-' . $llms_grid['tablet']; + } + if ( ! empty( $llms_grid['mobile'] ) ) { + $classes[] = 'llms-mobile-cols-' . $llms_grid['mobile']; + } + + return $classes; + } + + /** + * Enqueue styles + * + * @since 1.2.0 + * @return void + */ + public function add_dynamic_styles() { + + /** + * - Variable Declaration + */ + $theme_color = astra_get_option( 'theme-color' ); + $link_color = astra_get_option( 'link-color', $theme_color ); + $link_h_color = astra_get_option( 'link-h-color' ); + + $theme_forground_color = astra_get_foreground_color( $link_color ); + $btn_color = astra_get_option( 'button-color' ); + if ( empty( $btn_color ) ) { + $btn_color = $theme_forground_color; + } + + $btn_h_color = astra_get_option( 'button-h-color' ); + if ( empty( $btn_h_color ) ) { + $btn_h_color = astra_get_foreground_color( $link_h_color ); + } + $btn_bg_color = astra_get_option( 'button-bg-color', '', $link_color ); + $btn_bg_h_color = astra_get_option( 'button-bg-h-color', '', $link_h_color ); + + $btn_border_radius = astra_get_option( 'button-radius' ); + $theme_btn_padding = astra_get_option( 'theme-button-padding' ); + + $css_output = array( + 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, button.llms-field-button, a.llms-field-button' => array( + 'color' => $btn_color, + 'border-color' => $btn_bg_color, + 'background-color' => $btn_bg_color, + ), + 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, .llms-field-button, .llms-button-action.large' => array( + 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), + ), + 'a.llms-button-primary:hover, a.llms-button-primary:focus, .llms-button-secondary:hover, .llms-button-secondary:focus, .llms-button-action:hover, .llms-button-action:focus, button.llms-field-button:hover, button.llms-field-button:focus, a.llms-field-button:hover, a.llms-field-button:focus' => array( + 'color' => $btn_h_color, + 'border-color' => $btn_bg_h_color, + 'background-color' => $btn_bg_h_color, + ), + 'nav.llms-pagination ul li a:focus, nav.llms-pagination ul li a:hover, nav.llms-pagination ul li span.current' => array( + 'background' => $link_color, + 'color' => $btn_color, + ), + 'nav.llms-pagination ul, nav.llms-pagination ul li, .llms-instructor-info .llms-instructors .llms-author, .llms-instructor-info .llms-instructors .llms-author .avatar' => array( + 'border-color' => $link_color, + ), + '.llms-progress .progress-bar-complete, .llms-instructor-info .llms-instructors .llms-author .avatar, h4.llms-access-plan-title, .llms-lesson-preview .llms-icon-free, .llms-access-plan .stamp, .llms-student-dashboard .llms-status.llms-active, .llms-student-dashboard .llms-status.llms-completed, .llms-student-dashboard .llms-status.llms-txn-succeeded, .color-full, body .llms-syllabus-wrapper .llms-section-title' => array( + 'background' => $link_color, + ), + '.llms-lesson-preview.is-complete .llms-lesson-complete, .llms-lesson-preview.is-free .llms-lesson-complete, .llms-widget-syllabus .lesson-complete-placeholder.done, .llms-widget-syllabus .llms-lesson-complete.done, .single-llms_quiz .llms-quiz-results .llms-donut.passing, .llms-quiz-timer' => array( + 'color' => $link_color, + ), + '.llms-quiz-timer' => array( + 'border-color' => $link_color, + ), + '.single-llms_quiz .llms-quiz-results .llms-donut.passing svg path' => array( + 'stroke' => $link_color, + ), + 'h4.llms-access-plan-title, .llms-instructor-info .llms-instructors .llms-author .avatar, h4.llms-access-plan-title, .llms-lesson-preview .llms-icon-free, .llms-access-plan .stamp, .llms-student-dashboard .llms-status.llms-active, .llms-student-dashboard .llms-status.llms-completed, .llms-student-dashboard .llms-status.llms-txn-succeeded, body .llms-syllabus-wrapper .llms-section-title' => array( + 'color' => $theme_forground_color, + ), + 'body .progress-bar-complete:after' => array( + 'color' => $theme_forground_color, + ), + ); + + /* Parse CSS from array() */ + $css_output = astra_parse_css( $css_output ); + + if ( is_lesson() ) { + $css_output .= $this->llms_single_lesson_css(); + } + /** + * Global button CSS - Tablet. + */ + $css_global_button_tablet = array( + 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, .llms-field-button, .llms-button-action.large' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), + ), + ); + + $css_output .= astra_parse_css( $css_global_button_tablet, '', astra_get_tablet_breakpoint() ); + + /** + * Global button CSS - Mobile. + */ + $css_global_button_mobile = array( + 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, .llms-field-button, .llms-button-action.large' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), + ), + ); + + $css_output .= astra_parse_css( $css_global_button_mobile, '', astra_get_mobile_breakpoint() ); + + wp_add_inline_style( 'lifterlms-styles', apply_filters( 'astra_theme_lifterlms_dynamic_css', $css_output ) ); + + } + + /** + * Add start of wrapper + * + * @since 1.2.0 + * @return void + */ + public function before_main_content_start() { + $site_sidebar = astra_page_layout(); + if ( 'left-sidebar' == $site_sidebar ) { + get_sidebar(); + } + ?> +
    + + + +
    +
    + +
    +
    + + + +
    + 'ast-main-header-display', + 'id' => 'ast-main-header-display', + 'label' => esc_html__( 'Disable Primary Header', 'astra' ), + 'switch_on' => 'disabled', + 'type' => 'switch', + ); + /** + * Above Header + */ + $disable_fields[] = array( + 'attribute' => 'ast-hfb-above-header-display', + 'id' => 'ast-hfb-above-header-display', + 'label' => esc_html__( 'Disable Above Header', 'astra' ), + 'switch_on' => 'disabled', + 'type' => 'switch', + ); + /** + * Below Header + */ + $disable_fields[] = array( + 'attribute' => 'ast-hfb-below-header-display', + 'id' => 'ast-hfb-below-header-display', + 'label' => esc_html__( 'Disable Below Header', 'astra' ), + 'switch_on' => 'disabled', + 'type' => 'switch', + ); + /** + * Mobile Header + */ + $disable_fields[] = array( + 'attribute' => 'ast-hfb-mobile-header-display', + 'id' => 'ast-hfb-mobile-header-display', + 'label' => esc_html__( 'Disable Mobile Header', 'astra' ), + 'switch_on' => 'disabled', + 'type' => 'switch', + ); + if ( $show_meta_field ) { + $disable_fields[] = array( + 'attribute' => 'site-post-title', + 'id' => 'site-post-title', + 'label' => esc_html__( 'Disable Title', 'astra' ), + 'switch_on' => 'disabled', + 'type' => 'switch', + ); + } + if ( $show_meta_field && 'disabled' != astra_get_option( 'footer-adv' ) ) { + $disable_fields[] = array( + 'attribute' => 'footer-adv-display', + 'id' => 'footer-adv-display', + 'label' => esc_html__( 'Disable Footer Widgets', 'astra' ), + 'switch_on' => 'disabled', + 'type' => 'switch', + ); + } + if ( 'disabled' != astra_get_option( 'footer-sml-layout' ) ) { + $disable_fields[] = array( + 'attribute' => 'footer-sml-layout', + 'id' => 'footer-sml-layout', + 'label' => esc_html__( 'Disable Footer', 'astra' ), + 'switch_on' => 'disabled', + 'type' => 'switch', + ); + } + $fields['astra_theme_settings'] = array( + 'title' => __( 'Astra Settings', 'astra' ), + 'toggleable' => true, + 'fields' => apply_filters( + 'astra_theme_lifterlms_settings', + array( + array( + array( + 'attribute' => 'site-sidebar-layout', + 'id' => 'site-sidebar-layout', + 'label' => esc_html__( 'Sidebar', 'astra' ), + 'type' => 'ast-select', + 'options' => array( + 'default' => esc_html__( 'Customizer Setting', 'astra' ), + 'left-sidebar' => esc_html__( 'Left Sidebar', 'astra' ), + 'right-sidebar' => esc_html__( 'Right Sidebar', 'astra' ), + 'no-sidebar' => esc_html__( 'No Sidebar', 'astra' ), + ), + ), + array( + 'attribute' => 'site-content-layout', + 'id' => 'site-content-layout', + 'label' => esc_html__( 'Content Layout', 'astra' ), + 'type' => 'ast-select', + 'options' => array( + 'default' => esc_html__( 'Customizer Setting', 'astra' ), + 'boxed-container' => esc_html__( 'Boxed', 'astra' ), + 'content-boxed-container' => esc_html__( 'Content Boxed', 'astra' ), + 'plain-container' => esc_html__( 'Full Width / Contained', 'astra' ), + 'page-builder' => esc_html__( 'Full Width / Stretched', 'astra' ), + ), + ), + ), + $disable_fields, + ) + ), + ); + $default_fields['assignment'] = $fields; + $default_fields['lesson'] = $fields; + $default_fields['quiz'] = $fields; + return $default_fields; + } + + /** + * Llms single lesson static CSS move to dynamic to load conditionally. + * + * @since 3.3.0 + * @return string + */ + public function llms_single_lesson_css() { + $single_lesson_static_css = ' + .single-lesson.ast-separate-container .llms-lesson-preview .llms-lesson-link { + background: #fff; + } + + .single-lesson.ast-separate-container .llms-lesson-preview .llms-lesson-link:hover { + background: #fafafa; + } + + .single-lesson .ast-article-single .llms-lesson-button-wrapper { + font-weight: 600; + } + + .single-lesson .ast-article-single .llms-lesson-button-wrapper .llms-complete-lesson-form .llms-field-button:before { + content: "\2714"; + margin-right: .5em; + } + + .single-lesson .llms-course-navigation { + padding: 2em 0 0; + border-top: 1px solid #eeeeee; + } + + .single-lesson .llms-course-navigation .llms-lesson-preview { + vertical-align: top; + margin-top: 0; + } + + .single-lesson .llms-course-navigation .llms-lesson-preview .llms-lesson-link { + padding-left: 20px; + padding-right: 20px; + } + + .single-lesson .llms-course-navigation .llms-prev-lesson h6.llms-pre-text:before { + content: "\2190"; + margin-right: .5em; + } + + .single-lesson .llms-course-navigation .llms-back-to-course:first-child h6.llms-pre-text:before { + content: "\2190"; + margin-right: .5em; + } + + .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course h6.llms-pre-text:after, + .single-lesson .llms-course-navigation .llms-next-lesson h6.llms-pre-text:after { + content: "\2192"; + margin-left: 5px; + } + + .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course .llms-lesson-title, + .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course .llms-lesson-excerpt, + .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course h6.llms-pre-text, + .single-lesson .llms-course-navigation .llms-next-lesson .llms-lesson-title, + .single-lesson .llms-course-navigation .llms-next-lesson .llms-lesson-excerpt, + .single-lesson .llms-course-navigation .llms-next-lesson h6.llms-pre-text { + text-align: right; + } + + @media (max-width: 544px) { + .single-lesson .llms-course-navigation { + padding-top: 1.5em; + } + .single-lesson .llms-course-navigation .llms-course-nav { + width: 100%; + margin: 0; + } + .single-lesson .llms-course-navigation .llms-course-nav:first-child { + margin-bottom: 1.5em; + } + }'; + return Astra_Enqueue_Scripts::trim_css( $single_lesson_static_css ); + } + } + +endif; + +/** + * Kicking this off by calling 'get_instance()' method + */ +if ( apply_filters( 'astra_enable_lifterlms_integration', true ) ) { + Astra_LifterLMS::get_instance(); +} diff --git a/inc/compatibility/lifterlms/customizer/class-astra-liferlms-section-configs.php b/inc/compatibility/lifterlms/customizer/class-astra-liferlms-section-configs.php index e6e6956..54356c7 100644 --- a/inc/compatibility/lifterlms/customizer/class-astra-liferlms-section-configs.php +++ b/inc/compatibility/lifterlms/customizer/class-astra-liferlms-section-configs.php @@ -1,60 +1,60 @@ - 'section-lifterlms', - 'type' => 'section', - 'priority' => 65, - 'title' => __( 'LifterLMS', 'astra' ), - ), - - /** - * General Section - */ - array( - 'name' => 'section-lifterlms-general', - 'type' => 'section', - 'title' => __( 'General', 'astra' ), - 'section' => 'section-lifterlms', - 'priority' => 0, - ), - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Liferlms_Section_Configs(); + 'section-lifterlms', + 'type' => 'section', + 'priority' => 65, + 'title' => __( 'LifterLMS', 'astra' ), + ), + + /** + * General Section + */ + array( + 'name' => 'section-lifterlms-general', + 'type' => 'section', + 'title' => __( 'General', 'astra' ), + 'section' => 'section-lifterlms', + 'priority' => 0, + ), + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Liferlms_Section_Configs(); diff --git a/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-container-configs.php b/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-container-configs.php index c74af6f..f74a380 100644 --- a/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-container-configs.php +++ b/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-container-configs.php @@ -1,66 +1,66 @@ - ASTRA_THEME_SETTINGS . '[lifterlms-content-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-container-layout', - 'default' => astra_get_option( 'lifterlms-content-layout' ), - 'priority' => 66, - 'title' => __( 'LifterLMS Layout', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'boxed-container' => __( 'Boxed', 'astra' ), - 'content-boxed-container' => __( 'Content Boxed', 'astra' ), - 'plain-container' => __( 'Full Width / Contained', 'astra' ), - 'page-builder' => __( 'Full Width / Stretched', 'astra' ), - ), - ), - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Lifter_Container_Configs(); - - + ASTRA_THEME_SETTINGS . '[lifterlms-content-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-container-layout', + 'default' => astra_get_option( 'lifterlms-content-layout' ), + 'priority' => 66, + 'title' => __( 'LifterLMS Layout', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'boxed-container' => __( 'Boxed', 'astra' ), + 'content-boxed-container' => __( 'Content Boxed', 'astra' ), + 'plain-container' => __( 'Full Width / Contained', 'astra' ), + 'page-builder' => __( 'Full Width / Stretched', 'astra' ), + ), + ), + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Lifter_Container_Configs(); + + diff --git a/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-sidebar-configs.php b/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-sidebar-configs.php index 787d385..fc6a696 100644 --- a/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-sidebar-configs.php +++ b/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-sidebar-configs.php @@ -1,80 +1,80 @@ - ASTRA_THEME_SETTINGS . '[lifterlms-sidebar-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-sidebars', - 'priority' => 5, - 'default' => astra_get_option( 'lifterlms-sidebar-layout' ), - 'title' => __( 'LifterLMS', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'no-sidebar' => __( 'No Sidebar', 'astra' ), - 'left-sidebar' => __( 'Left Sidebar', 'astra' ), - 'right-sidebar' => __( 'Right Sidebar', 'astra' ), - ), - ), - - /** - * Option: LifterLMS Course/Lesson - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[lifterlms-course-lesson-sidebar-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-sidebars', - 'default' => astra_get_option( 'lifterlms-course-lesson-sidebar-layout' ), - 'priority' => 5, - 'title' => __( 'LifterLMS Course/Lesson', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'no-sidebar' => __( 'No Sidebar', 'astra' ), - 'left-sidebar' => __( 'Left Sidebar', 'astra' ), - 'right-sidebar' => __( 'Right Sidebar', 'astra' ), - ), - ), - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Lifter_Sidebar_Configs(); + ASTRA_THEME_SETTINGS . '[lifterlms-sidebar-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-sidebars', + 'priority' => 5, + 'default' => astra_get_option( 'lifterlms-sidebar-layout' ), + 'title' => __( 'LifterLMS', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'no-sidebar' => __( 'No Sidebar', 'astra' ), + 'left-sidebar' => __( 'Left Sidebar', 'astra' ), + 'right-sidebar' => __( 'Right Sidebar', 'astra' ), + ), + ), + + /** + * Option: LifterLMS Course/Lesson + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[lifterlms-course-lesson-sidebar-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-sidebars', + 'default' => astra_get_option( 'lifterlms-course-lesson-sidebar-layout' ), + 'priority' => 5, + 'title' => __( 'LifterLMS Course/Lesson', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'no-sidebar' => __( 'No Sidebar', 'astra' ), + 'left-sidebar' => __( 'Left Sidebar', 'astra' ), + 'right-sidebar' => __( 'Right Sidebar', 'astra' ), + ), + ), + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Lifter_Sidebar_Configs(); diff --git a/inc/compatibility/lifterlms/customizer/sections/layout/class-astra-lifter-general-configs.php b/inc/compatibility/lifterlms/customizer/sections/layout/class-astra-lifter-general-configs.php index 392e28b..f203b10 100644 --- a/inc/compatibility/lifterlms/customizer/sections/layout/class-astra-lifter-general-configs.php +++ b/inc/compatibility/lifterlms/customizer/sections/layout/class-astra-lifter-general-configs.php @@ -1,104 +1,104 @@ - 'ast-bottom-divider' ); - $section = 'section-lifterlms-general'; - } else { - $divider_array = array(); - $section = 'section-lifterlms'; - } - - $_configs = array( - - /** - * Option: Course Columns - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[llms-course-grid]', - 'type' => 'control', - 'control' => 'ast-responsive-slider', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), - 'section' => $section, - 'default' => astra_get_option( - 'llms-course-grid', - array( - 'desktop' => 3, - 'tablet' => 2, - 'mobile' => 1, - ) - ), - 'title' => __( 'Course Columns', 'astra' ), - 'priority' => 0, - 'input_attrs' => array( - 'step' => 1, - 'min' => 1, - 'max' => 6, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Membership Columns - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[llms-membership-grid]', - 'type' => 'control', - 'control' => 'ast-responsive-slider', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), - 'section' => $section, - 'default' => astra_get_option( - 'llms-membership-grid', - array( - 'desktop' => 3, - 'tablet' => 2, - 'mobile' => 1, - ) - ), - 'title' => __( 'Membership Columns', 'astra' ), - 'priority' => 0, - 'input_attrs' => array( - 'step' => 1, - 'min' => 1, - 'max' => 6, - ), - 'divider' => $divider_array, - ), - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Lifter_General_Configs(); + 'ast-bottom-divider' ); + $section = 'section-lifterlms-general'; + } else { + $divider_array = array(); + $section = 'section-lifterlms'; + } + + $_configs = array( + + /** + * Option: Course Columns + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[llms-course-grid]', + 'type' => 'control', + 'control' => 'ast-responsive-slider', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), + 'section' => $section, + 'default' => astra_get_option( + 'llms-course-grid', + array( + 'desktop' => 3, + 'tablet' => 2, + 'mobile' => 1, + ) + ), + 'title' => __( 'Course Columns', 'astra' ), + 'priority' => 0, + 'input_attrs' => array( + 'step' => 1, + 'min' => 1, + 'max' => 6, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Membership Columns + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[llms-membership-grid]', + 'type' => 'control', + 'control' => 'ast-responsive-slider', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), + 'section' => $section, + 'default' => astra_get_option( + 'llms-membership-grid', + array( + 'desktop' => 3, + 'tablet' => 2, + 'mobile' => 1, + ) + ), + 'title' => __( 'Membership Columns', 'astra' ), + 'priority' => 0, + 'input_attrs' => array( + 'step' => 1, + 'min' => 1, + 'max' => 6, + ), + 'divider' => $divider_array, + ), + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Lifter_General_Configs(); diff --git a/inc/compatibility/woocommerce/class-astra-woocommerce.php b/inc/compatibility/woocommerce/class-astra-woocommerce.php index 91cd6ef..f9a9a81 100644 --- a/inc/compatibility/woocommerce/class-astra-woocommerce.php +++ b/inc/compatibility/woocommerce/class-astra-woocommerce.php @@ -1,1819 +1,1819 @@ -=' ) ) { - add_filter( 'woocommerce_add_to_cart_fragments', array( $this, 'cart_link_fragment' ) ); - } else { - add_filter( 'add_to_cart_fragments', array( $this, 'cart_link_fragment' ) ); - } - - add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'product_flip_image' ), 10 ); - add_filter( 'woocommerce_subcategory_count_html', array( $this, 'subcategory_count_markup' ), 10, 2 ); - - add_action( 'customize_register', array( $this, 'customize_register' ), 2 ); - - add_filter( 'woocommerce_get_stock_html', 'astra_woo_product_in_stock', 10, 2 ); - - add_filter( 'astra_schema_body', array( $this, 'remove_body_schema' ) ); - - // Header Cart Icon. - add_action( 'astra_woo_header_cart_icons_before', array( $this, 'header_cart_icon_markup' ) ); - - add_action( 'astra_cart_in_menu_class', array( $this, 'header_cart_icon_class' ), 99 ); - - } - - /** - * Header Cart Extra Icons markup - * - * @return void; - */ - public function header_cart_icon_markup() { - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && ! defined( 'ASTRA_EXT_VER' ) ) { - return; - } - - $icon = astra_get_option( 'woo-header-cart-icon' ); - $cart_total_display = astra_get_option( 'woo-header-cart-total-display' ); - $cart_count_display = apply_filters( 'astra_header_cart_count', true ); - $cart_title_display = astra_get_option( 'woo-header-cart-title-display' ); - $cart_title = apply_filters( 'astra_header_cart_title', __( 'Cart', 'astra' ) ); - - $cart_title_markup = '' . esc_html( $cart_title ) . ''; - $cart_total_markup = ''; - if ( null !== WC()->cart ) { - $cart_total_markup = '' . WC()->cart->get_cart_subtotal() . ''; - } - - // Cart Title & Cart Cart total markup. - $cart_info_markup = sprintf( - ' - %1$s - %2$s - %3$s - ', - ( $cart_title_display ) ? $cart_title_markup : '', - ( $cart_total_display && $cart_title_display ) ? '/' : '', - ( $cart_total_display ) ? $cart_total_markup : '' - ); - - $cart_contents_count = 0; - if ( null !== WC()->cart ) { - $cart_contents_count = WC()->cart->get_cart_contents_count(); - } - - // Cart Icon markup with total number of items. - $cart_icon = sprintf( - '%4$s', - ( $icon ) ? $icon : '', - ( $cart_count_display ) ? '' : 'no-cart-total', - ( $cart_count_display ) ? 'data-cart-total="' . $cart_contents_count . '"' : '', - ( $icon ) ? ( ( false !== Astra_Icons::is_svg_icons() ) ? Astra_Icons::get_icons( $icon ) : '' ) : '' - ); - - // Theme's default icon with cart title and cart total. - if ( 'default' == $icon || ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && ! Astra_Ext_Extension::is_active( 'woocommerce' ) ) ) { - // Cart Total or Cart Title enable then only add markup. - if ( $cart_title_display || $cart_total_display ) { - echo $cart_info_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - } else { - - // Remove Default cart icon added by theme. - add_filter( 'astra_woo_default_header_cart_icon', '__return_false' ); - - /* translators: 1: Cart Title Markup, 2: Cart Icon Markup */ - printf( - '
    - %1$s - %2$s -
    ', - ( $cart_title_display || $cart_total_display ) ? $cart_info_markup : '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ( $cart_icon ) ? $cart_icon : '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ); - } - } - - /** - * Header Cart Icon Class - * - * @param array $classes Default argument array. - * - * @return array; - */ - public function header_cart_icon_class( $classes ) { - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && ! defined( 'ASTRA_EXT_VER' ) ) { - return $classes; - } - - $header_cart_icon_style = astra_get_option( 'woo-header-cart-icon-style' ); - - $classes[] = 'ast-menu-cart-' . $header_cart_icon_style; - $header_cart_icon_has_color = astra_get_option( 'woo-header-cart-icon-color' ); - if ( ! empty( $header_cart_icon_has_color ) && ( 'none' !== $header_cart_icon_style ) ) { - $classes[] = 'ast-menu-cart-has-color'; - } - - return $classes; - } - - /** - * Remove body schema when using WooCommerce template. - * WooCommerce adds it's own product schema hence schema data from Astra should be disabled here. - * - * @since 1.8.0 - * @param String $schema Schema markup. - * @return String - */ - public function remove_body_schema( $schema ) { - if ( is_woocommerce() ) { - $schema = ''; - } - - return $schema; - } - - /** - * Rating Markup - * - * @since 1.2.2 - * @param string $html Rating Markup. - * @param float $rating Rating being shown. - * @param int $count Total number of ratings. - * @return string - */ - public function rating_markup( $html, $rating, $count ) { - - if ( 0 == $rating ) { - $html = '
    '; - $html .= wc_get_star_rating_html( $rating, $count ); - $html .= '
    '; - } - return $html; - } - - /** - * Cart Page Upselles products. - * - * @return void - */ - public function cart_page_upselles() { - - $upselles_enabled = astra_get_option( 'enable-cart-upsells' ); - if ( ! $upselles_enabled ) { - remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' ); - } - } - - /** - * Subcategory Count Markup - * - * @param array $styles Css files. - * - * @return array - */ - public function woo_filter_style( $styles ) { - - /* Directory and Extension */ - $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; - $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; - - $css_uri = ASTRA_THEME_URI . 'assets/css/' . $dir_name . '/compatibility/woocommerce/'; - - // Register & Enqueue Styles. - // Generate CSS URL. - - if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { - $styles = array( - 'woocommerce-layout' => array( - 'src' => $css_uri . 'woocommerce-layout' . $file_prefix . '.css', - 'deps' => '', - 'version' => ASTRA_THEME_VERSION, - 'media' => 'all', - 'has_rtl' => true, - ), - 'woocommerce-smallscreen' => array( - 'src' => $css_uri . 'woocommerce-smallscreen' . $file_prefix . '.css', - 'deps' => 'woocommerce-layout', - 'version' => ASTRA_THEME_VERSION, - 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', astra_get_tablet_breakpoint() . 'px' ) . ')', - 'has_rtl' => true, - ), - 'woocommerce-general' => array( - 'src' => $css_uri . 'woocommerce' . $file_prefix . '.css', - 'deps' => '', - 'version' => ASTRA_THEME_VERSION, - 'media' => 'all', - 'has_rtl' => true, - ), - ); - } else { - $styles = array( - 'woocommerce-layout' => array( - 'src' => $css_uri . 'woocommerce-layout-grid' . $file_prefix . '.css', - 'deps' => '', - 'version' => ASTRA_THEME_VERSION, - 'media' => 'all', - 'has_rtl' => true, - ), - 'woocommerce-smallscreen' => array( - 'src' => $css_uri . 'woocommerce-smallscreen-grid' . $file_prefix . '.css', - 'deps' => 'woocommerce-layout', - 'version' => ASTRA_THEME_VERSION, - 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', astra_get_tablet_breakpoint() . 'px' ) . ')', - 'has_rtl' => true, - ), - 'woocommerce-general' => array( - 'src' => $css_uri . 'woocommerce-grid' . $file_prefix . '.css', - 'deps' => '', - 'version' => ASTRA_THEME_VERSION, - 'media' => 'all', - 'has_rtl' => true, - ), - ); - } - - return $styles; - } - - /** - * Subcategory Count Markup - * - * @param mixed $content Count Markup. - * @param object $category Object of Category. - * @return mixed - */ - public function subcategory_count_markup( $content, $category ) { - - $content = sprintf( // WPCS: XSS OK. - /* translators: 1: number of products */ - _nx( '%1$s Product', '%1$s Products', $category->count, 'product categories', 'astra' ), - number_format_i18n( $category->count ) - ); - - return '' . $content . ''; - } - - /** - * Product Flip Image - */ - public function product_flip_image() { - - global $product; - - $hover_style = astra_get_option( 'shop-hover-style' ); - - if ( 'swap' === $hover_style ) { - - $attachment_ids = $product->get_gallery_image_ids(); - - if ( $attachment_ids ) { - - $image_size = apply_filters( 'single_product_archive_thumbnail_size', 'shop_catalog' ); - - echo apply_filters( 'astra_woocommerce_product_flip_image', wp_get_attachment_image( reset( $attachment_ids ), $image_size, false, array( 'class' => 'show-on-hover' ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - } - } - - /** - * Theme Defaults. - * - * @param array $defaults Array of options value. - * @return array - */ - public function theme_defaults( $defaults ) { - - // Container. - $defaults['woocommerce-content-layout'] = 'plain-container'; - - // Sidebar. - $defaults['woocommerce-sidebar-layout'] = 'no-sidebar'; - $defaults['single-product-sidebar-layout'] = 'default'; - - /* Shop */ - $defaults['shop-grids'] = array( - 'desktop' => 4, - 'tablet' => 3, - 'mobile' => 2, - ); - $defaults['shop-no-of-products'] = '12'; - $defaults['shop-product-structure'] = array( - 'category', - 'title', - 'ratings', - 'price', - 'add_cart', - ); - $defaults['shop-hover-style'] = ''; - - /* Single */ - $defaults['single-product-breadcrumb-disable'] = false; - - /* Cart */ - $defaults['enable-cart-upsells'] = true; - - $defaults['shop-archive-width'] = 'default'; - $defaults['shop-archive-max-width'] = 1200; - - return $defaults; - } - - /** - * Update Shop page grid - * - * @param int $col Shop Column. - * @return int - */ - public function shop_columns( $col ) { - - $col = astra_get_option( 'shop-grids' ); - return $col['desktop']; - } - - /** - * Check if the current page is a Product Subcategory page or not. - * - * @param integer $category_id Current page Category ID. - * @return boolean - */ - public function astra_woo_is_subcategory( $category_id = null ) { - if ( is_tax( 'product_cat' ) ) { - if ( empty( $category_id ) ) { - $category_id = get_queried_object_id(); - } - $category = get_term( get_queried_object_id(), 'product_cat' ); - if ( empty( $category->parent ) ) { - return false; - } - return true; - } - return false; - } - - /** - * Update Shop page grid - * - * @return int - */ - public function shop_no_of_products() { - $taxonomy_page_display = get_option( 'woocommerce_category_archive_display', false ); - if ( is_product_taxonomy() && 'subcategories' === $taxonomy_page_display ) { - if ( $this->astra_woo_is_subcategory() ) { - $products = astra_get_option( 'shop-no-of-products' ); - return $products; - } - $products = wp_count_posts( 'product' )->publish; - } else { - $products = astra_get_option( 'shop-no-of-products' ); - } - return $products; - } - - /** - * Add products item class on shop page - * - * @param Array $classes product classes. - * - * @return array. - */ - public function shop_page_products_item_class( $classes = '' ) { - - if ( is_shop() || is_product_taxonomy() ) { - $shop_grid = astra_get_option( 'shop-grids' ); - $classes[] = 'columns-' . $shop_grid['desktop']; - $classes[] = 'tablet-columns-' . $shop_grid['tablet']; - $classes[] = 'mobile-columns-' . $shop_grid['mobile']; - - $classes[] = 'ast-woo-shop-archive'; - } - // Cart menu is emabled. - $rt_section = astra_get_option( 'header-main-rt-section' ); - - if ( 'woocommerce' === $rt_section ) { - $classes[] = 'ast-woocommerce-cart-menu'; - } - - return $classes; - } - - /** - * Get grid columns for either Archive|Single product. - * Introducing this function to reduce lot of CSS we write for 'grid-template-columns' for every count (till 6). - * - * @param string $type - WooCommerce page type Archive/Single. - * @param string $device - Device specific grid option. - * @param int $default - Default grid count (fallback basically). - * - * @return int grid count. - * @since 3.4.3 - */ - public function get_grid_column_count( $type = 'archive', $device = 'desktop', $default = 2 ) { - - if ( 'archive' === $type ) { - $products_grid = astra_get_option( 'shop-grids' ); - } else { - $products_grid = astra_get_option( 'single-product-related-upsell-grid' ); - } - - return isset( $products_grid[ $device ] ) ? absint( $products_grid[ $device ] ) : $default; - } - - /** - * Add class on single product page - * - * @param Array $classes product classes. - * - * @return array. - */ - public function single_product_class( $classes ) { - - if ( is_product() && 0 == get_post_meta( get_the_ID(), '_wc_review_count', true ) ) { - $classes[] = 'ast-woo-product-no-review'; - } - - if ( is_shop() || is_product_taxonomy() ) { - $hover_style = astra_get_option( 'shop-hover-style' ); - - if ( '' !== $hover_style ) { - $classes[] = 'astra-woo-hover-' . $hover_style; - } - } - - return $classes; - } - - /** - * Update woocommerce related product numbers - * - * @param array $args Related products array. - * @return array - */ - public function related_products_args( $args ) { - - $col = astra_get_option( 'shop-grids' ); - $args['posts_per_page'] = $col['desktop']; - return $args; - } - - /** - * Setup theme - * - * @since 1.0.3 - */ - public function setup_theme() { - - // WooCommerce. - add_theme_support( 'wc-product-gallery-zoom' ); - add_theme_support( 'wc-product-gallery-lightbox' ); - add_theme_support( 'wc-product-gallery-slider' ); - } - - /** - * Store widgets init. - */ - public function store_widgets_init() { - register_sidebar( - apply_filters( - 'astra_woocommerce_shop_sidebar_init', - array( - 'name' => esc_html__( 'WooCommerce Sidebar', 'astra' ), - 'id' => 'astra-woo-shop-sidebar', - 'description' => __( 'This sidebar will be used on Product archive, Cart, Checkout and My Account pages.', 'astra' ), - 'before_widget' => '
    ', - 'after_widget' => '
    ', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - register_sidebar( - apply_filters( - 'astra_woocommerce_single_sidebar_init', - array( - 'name' => esc_html__( 'Product Sidebar', 'astra' ), - 'id' => 'astra-woo-single-sidebar', - 'description' => __( 'This sidebar will be used on Single Product page.', 'astra' ), - 'before_widget' => '
    ', - 'after_widget' => '
    ', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - } - - /** - * Assign shop sidebar for store page. - * - * @param String $sidebar Sidebar. - * - * @return String $sidebar Sidebar. - */ - public function replace_store_sidebar( $sidebar ) { - - if ( is_shop() || is_product_taxonomy() || is_checkout() || is_cart() || is_account_page() ) { - $sidebar = 'astra-woo-shop-sidebar'; - } elseif ( is_product() ) { - $sidebar = 'astra-woo-single-sidebar'; - } - - return $sidebar; - } - - /** - * WooCommerce Container - * - * @param String $sidebar_layout Layout type. - * - * @return String $sidebar_layout Layout type. - */ - public function store_sidebar_layout( $sidebar_layout ) { - - if ( is_shop() || is_product_taxonomy() || is_checkout() || is_cart() || is_account_page() ) { - - $woo_sidebar = astra_get_option( 'woocommerce-sidebar-layout' ); - - if ( 'default' !== $woo_sidebar ) { - - $sidebar_layout = $woo_sidebar; - } - - if ( is_shop() ) { - $shop_page_id = get_option( 'woocommerce_shop_page_id' ); - $shop_sidebar = get_post_meta( $shop_page_id, 'site-sidebar-layout', true ); - } elseif ( is_product_taxonomy() ) { - $shop_sidebar = 'default'; - } else { - $shop_sidebar = astra_get_option_meta( 'site-sidebar-layout', '', true ); - } - - if ( 'default' !== $shop_sidebar && ! empty( $shop_sidebar ) ) { - $sidebar_layout = $shop_sidebar; - } - } - - return $sidebar_layout; - } - /** - * WooCommerce Container - * - * @param String $layout Layout type. - * - * @return String $layout Layout type. - */ - public function store_content_layout( $layout ) { - - if ( is_woocommerce() || is_checkout() || is_cart() || is_account_page() ) { - - $woo_layout = astra_get_option( 'woocommerce-content-layout' ); - - if ( 'default' !== $woo_layout ) { - - $layout = $woo_layout; - } - - if ( is_shop() ) { - $shop_page_id = get_option( 'woocommerce_shop_page_id' ); - $shop_layout = get_post_meta( $shop_page_id, 'site-content-layout', true ); - } elseif ( is_product_taxonomy() ) { - $shop_layout = 'default'; - } else { - $shop_layout = astra_get_option_meta( 'site-content-layout', '', true ); - } - - if ( 'default' !== $shop_layout && ! empty( $shop_layout ) ) { - $layout = $shop_layout; - } - } - - return apply_filters( 'astra_get_store_content_layout', $layout ); - } - - /** - * Shop Page Meta - * - * @return void - */ - public function shop_meta_option() { - - // Page Title. - if ( is_shop() ) { - - $shop_page_id = get_option( 'woocommerce_shop_page_id' ); - $shop_title = get_post_meta( $shop_page_id, 'site-post-title', true ); - $main_header_display = get_post_meta( $shop_page_id, 'ast-main-header-display', true ); - $footer_layout = get_post_meta( $shop_page_id, 'footer-sml-layout', true ); - - if ( 'disabled' === $shop_title ) { - add_filter( 'woocommerce_show_page_title', '__return_false' ); - } - - if ( 'disabled' === $main_header_display ) { - remove_action( 'astra_masthead', 'astra_masthead_primary_template' ); - } - - if ( 'disabled' === $footer_layout ) { - remove_action( 'astra_footer_content', 'astra_footer_small_footer_template', 5 ); - } - } - } - - - /** - * Shop customization. - * - * @return void - */ - public function shop_customization() { - - if ( ! apply_filters( 'astra_woo_shop_product_structure_override', false ) ) { - - add_action( 'woocommerce_before_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_start', 6 ); - /** - * Add sale flash before shop loop. - */ - add_action( 'woocommerce_before_shop_loop_item', 'woocommerce_show_product_loop_sale_flash', 9 ); - - add_action( 'woocommerce_after_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_end', 8 ); - /** - * Add Out of Stock to the Shop page - */ - add_action( 'woocommerce_shop_loop_item_title', 'astra_woo_shop_out_of_stock', 8 ); - - remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); - - /** - * Shop Page Product Content Sorting - */ - add_action( 'woocommerce_after_shop_loop_item', 'astra_woo_woocommerce_shop_product_content' ); - } - } - - /** - * Checkout customization. - * - * @return void - */ - public function woocommerce_checkout() { - - if ( is_admin() ) { - return; - } - - if ( ! apply_filters( 'astra_woo_shop_product_structure_override', false ) ) { - - /** - * Checkout Page - */ - add_action( 'woocommerce_checkout_billing', array( WC()->checkout(), 'checkout_form_shipping' ) ); - } - - // Checkout Page. - remove_action( 'woocommerce_checkout_shipping', array( WC()->checkout(), 'checkout_form_shipping' ) ); - } - - /** - * Single product customization. - * - * @return void - */ - public function single_product_customization() { - - if ( ! is_product() ) { - return; - } - - add_filter( 'woocommerce_product_description_heading', '__return_false' ); - add_filter( 'woocommerce_product_additional_information_heading', '__return_false' ); - - // Breadcrumb. - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); - if ( ! astra_get_option( 'single-product-breadcrumb-disable' ) ) { - add_action( 'woocommerce_single_product_summary', 'woocommerce_breadcrumb', 2 ); - } - } - - /** - * Remove Woo-Commerce Default actions - */ - public function woocommerce_init() { - remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); - remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); - remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 ); - remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); - remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); - remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); - remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 ); - } - - /** - * Add start of wrapper - */ - public function before_main_content_start() { - $site_sidebar = astra_page_layout(); - if ( 'left-sidebar' == $site_sidebar ) { - get_sidebar(); - } - ?> -
    - - - -
    -
    - -
    -
    - - - -
    - array( - 'background-color' => $theme_color, - 'color' => astra_get_foreground_color( $theme_color ), - ), - '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled], .woocommerce input.button:disabled:hover, .woocommerce input.button:disabled[disabled]:hover, .woocommerce #respond input#submit, .woocommerce button.button.alt.disabled, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link, .wc-block-grid__product-onsale' => array( - 'color' => $btn_color, - 'border-color' => $btn_bg_color, - 'background-color' => $btn_bg_color, - ), - '.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce .woocommerce-message a.button:hover,.woocommerce #respond input#submit:hover,.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce input.button:hover, .woocommerce button.button.alt.disabled:hover, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array( - 'color' => $btn_h_color, - 'border-color' => $btn_bg_h_color, - 'background-color' => $btn_bg_h_color, - ), - '.woocommerce-message, .woocommerce-info' => array( - 'border-top-color' => $link_color, - ), - '.woocommerce-message::before,.woocommerce-info::before' => array( - 'color' => $link_color, - ), - '.woocommerce ul.products li.product .price, .woocommerce div.product p.price, .woocommerce div.product span.price, .widget_layered_nav_filters ul li.chosen a, .woocommerce-page ul.products li.product .ast-woo-product-category, .wc-layered-nav-rating a' => array( - 'color' => $text_color, - ), - // Form Fields, Pagination border Color. - '.woocommerce nav.woocommerce-pagination ul,.woocommerce nav.woocommerce-pagination ul li' => array( - 'border-color' => $link_color, - ), - '.woocommerce nav.woocommerce-pagination ul li a:focus, .woocommerce nav.woocommerce-pagination ul li a:hover, .woocommerce nav.woocommerce-pagination ul li span.current' => array( - 'background' => $link_color, - 'color' => $btn_color, - ), - '.woocommerce-MyAccount-navigation-link.is-active a' => array( - 'color' => $link_h_color, - ), - '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle' => array( - 'background-color' => $link_color, - ), - // Button Typography. - '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce-cart table.cart td.actions .button, .woocommerce form.checkout_coupon .button, .woocommerce #respond input#submit, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( - 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), - ), - '.woocommerce .star-rating, .woocommerce .comment-form-rating .stars a, .woocommerce .star-rating::before' => array( - 'color' => $link_color, - ), - '.woocommerce div.product .woocommerce-tabs ul.tabs li.active:before' => array( - 'background' => $link_color, - ), - '.woocommerce a.remove:hover' => array( - 'color' => esc_attr( $link_color ), - 'border-color' => esc_attr( $link_color ), - 'background-color' => esc_attr( '#ffffff' ), - ), - ); - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - $compat_css_desktop = array( - /** - * Cart in menu - */ - '.ast-site-header-cart a' => array( - 'color' => esc_attr( $text_color ), - ), - - '.ast-site-header-cart a:focus, .ast-site-header-cart a:hover, .ast-site-header-cart .current-menu-item a' => array( - 'color' => esc_attr( $link_color ), - ), - - '.ast-cart-menu-wrap .count, .ast-cart-menu-wrap .count:after' => array( - 'border-color' => esc_attr( $link_color ), - 'color' => esc_attr( $link_color ), - ), - - '.ast-cart-menu-wrap:hover .count' => array( - 'color' => esc_attr( $cart_h_color ), - 'background-color' => esc_attr( $link_color ), - ), - - '.ast-site-header-cart .widget_shopping_cart .total .woocommerce-Price-amount' => array( - 'color' => esc_attr( $link_color ), - ), - - '.woocommerce a.remove:hover, .ast-woocommerce-cart-menu .main-header-menu .woocommerce-custom-menu-item .menu-item:hover > .menu-link.remove:hover' => array( - 'color' => esc_attr( $link_color ), - 'border-color' => esc_attr( $link_color ), - 'background-color' => esc_attr( '#ffffff' ), - ), - - /** - * Checkout button color for widget - */ - '.ast-site-header-cart .widget_shopping_cart .buttons .button.checkout, .woocommerce .widget_shopping_cart .woocommerce-mini-cart__buttons .checkout.wc-forward' => array( - 'color' => $btn_h_color, - 'border-color' => $btn_bg_h_color, - 'background-color' => $btn_bg_h_color, - ), - '.site-header .ast-site-header-cart-data .button.wc-forward, .site-header .ast-site-header-cart-data .button.wc-forward:hover' => array( - 'color' => $btn_color, - ), - '.below-header-user-select .ast-site-header-cart .widget, .ast-above-header-section .ast-site-header-cart .widget a, .below-header-user-select .ast-site-header-cart .widget_shopping_cart a' => array( - 'color' => $text_color, - ), - '.below-header-user-select .ast-site-header-cart .widget_shopping_cart a:hover, .ast-above-header-section .ast-site-header-cart .widget_shopping_cart a:hover, .below-header-user-select .ast-site-header-cart .widget_shopping_cart a.remove:hover, .ast-above-header-section .ast-site-header-cart .widget_shopping_cart a.remove:hover' => array( - 'color' => esc_attr( $link_color ), - ), - ); - - $css_output = array_merge( $css_output, $compat_css_desktop ); - } - - if ( Astra_Builder_Helper::apply_flex_based_css() ) { - $css_output['.woocommerce[class*="rel-up-columns-"] .site-main div.product .related.products ul.products li.product, .woocommerce-page .site-main ul.products li.product'] = array( - 'width' => '100%', - ); - } - - if ( false === Astra_Icons::is_svg_icons() ) { - $css_output['.woocommerce ul.product-categories > li ul li:before'] = array( - 'content' => '"\e900"', - 'padding' => '0 5px 0 5px', - 'display' => 'inline-block', - 'font-family' => 'Astra', - 'transform' => 'rotate(-90deg)', - 'font-size' => '11px', - 'font-size' => '0.7rem', - ); - } else { - $css_output['.woocommerce ul.product-categories > li ul li'] = array( - 'position' => 'relative', - ); - if ( $is_site_rtl ) { - $css_output['.woocommerce ul.product-categories > li ul li:before'] = array( - 'content' => '""', - 'border-width' => '1px 0 0 1px', - 'border-style' => 'solid', - 'display' => 'inline-block', - 'width' => '6px', - 'height' => '6px', - 'position' => 'absolute', - 'top' => '50%', - 'margin-top' => '-2px', - '-webkit-transform' => 'rotate(45deg)', - 'transform' => 'rotate(45deg)', - ); - $css_output['.woocommerce ul.product-categories > li ul li a'] = array( - 'margin-right' => '15px', - ); - } else { - $css_output['.woocommerce ul.product-categories > li ul li:before'] = array( - 'content' => '""', - 'border-width' => '1px 1px 0 0', - 'border-style' => 'solid', - 'display' => 'inline-block', - 'width' => '6px', - 'height' => '6px', - 'position' => 'absolute', - 'top' => '50%', - 'margin-top' => '-2px', - '-webkit-transform' => 'rotate(45deg)', - 'transform' => 'rotate(45deg)', - ); - $css_output['.woocommerce ul.product-categories > li ul li a'] = array( - 'margin-left' => '15px', - ); - } - } - - /* Parse WooCommerce General CSS from array() */ - $css_output = astra_parse_css( $css_output ); - - if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { - $tablet_css_shop_page_grid = array( - '.woocommerce.tablet-columns-6 ul.products li.product, .woocommerce-page.tablet-columns-6 ul.products li.product' => array( - 'width' => '12.7%', - 'width' => 'calc(16.66% - 16.66px)', - ), - '.woocommerce.tablet-columns-5 ul.products li.product, .woocommerce-page.tablet-columns-5 ul.products li.product' => array( - 'width' => '16.2%', - 'width' => 'calc(20% - 16px)', - ), - '.woocommerce.tablet-columns-4 ul.products li.product, .woocommerce-page.tablet-columns-4 ul.products li.product' => array( - 'width' => '21.5%', - 'width' => 'calc(25% - 15px)', - ), - '.woocommerce.tablet-columns-3 ul.products li.product, .woocommerce-page.tablet-columns-3 ul.products li.product' => array( - 'width' => '30.2%', - 'width' => 'calc(33.33% - 14px)', - ), - '.woocommerce.tablet-columns-2 ul.products li.product, .woocommerce-page.tablet-columns-2 ul.products li.product' => array( - 'width' => '47.6%', - 'width' => 'calc(50% - 10px)', - ), - '.woocommerce.tablet-columns-1 ul.products li.product, .woocommerce-page.tablet-columns-1 ul.products li.product' => array( - 'width' => '100%', - ), - '.woocommerce div.product .related.products ul.products li.product' => array( - 'width' => '30.2%', - 'width' => 'calc(33.33% - 14px)', - ), - ); - - } else { - $archive_tablet_grid = $this->get_grid_column_count( 'archive', 'tablet' ); - - $tablet_css_shop_page_grid = array( - '.woocommerce.tablet-columns-' . $archive_tablet_grid . ' ul.products li.product, .woocommerce-page.tablet-columns-' . $archive_tablet_grid . ' ul.products' => array( - 'grid-template-columns' => 'repeat(' . $archive_tablet_grid . ', minmax(0, 1fr))', - ), - ); - } - $css_output .= astra_parse_css( $tablet_css_shop_page_grid, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() ); - - if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { - if ( $is_site_rtl ) { - $tablet_shop_page_grid_lang_direction_css = array( - '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array( - 'width' => '30.2%', - 'width' => 'calc(33.33% - 14px)', - 'margin-left' => '20px', - ), - '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n)' => array( - 'margin-left' => 0, - 'clear' => 'left', - ), - '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n+1)' => array( - 'clear' => 'right', - ), - '.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)' => array( - 'margin-left' => '20px', - 'clear' => 'none', - ), - '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n)' => array( - 'margin-left' => '0', - 'clear' => 'left', - ), - '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n+1)' => array( - 'clear' => 'right', - ), - '.woocommerce div.product .related.products ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-1 .site-main ul.products li.product' => array( - 'margin-left' => 0, - 'clear' => 'left', - ), - '.woocommerce div.product .related.products ul.products li.product:nth-child(3n+1)' => array( - 'clear' => 'right', - ), - ); - } else { - $tablet_shop_page_grid_lang_direction_css = array( - '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array( - 'width' => '30.2%', - 'width' => 'calc(33.33% - 14px)', - 'margin-right' => '20px', - ), - '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n)' => array( - 'margin-right' => 0, - 'clear' => 'right', - ), - '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n+1)' => array( - 'clear' => 'left', - ), - '.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)' => array( - 'margin-right' => '20px', - 'clear' => 'none', - ), - '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n)' => array( - 'margin-right' => '0', - 'clear' => 'right', - ), - '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n+1)' => array( - 'clear' => 'left', - ), - '.woocommerce div.product .related.products ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-1 .site-main ul.products li.product' => array( - 'margin-right' => 0, - 'clear' => 'right', - ), - '.woocommerce div.product .related.products ul.products li.product:nth-child(3n+1)' => array( - 'clear' => 'left', - ), - ); - } - $css_output .= astra_parse_css( $tablet_shop_page_grid_lang_direction_css, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() ); - } - - /** - * Global button CSS - Tablet = min-wdth: (tablet + 1)px - */ - if ( $is_site_rtl ) { - $min_tablet_css = array( - '.woocommerce #reviews #comments' => array( - 'width' => '55%', - 'float' => 'right', - ), - '.woocommerce #reviews #review_form_wrapper' => array( - 'width' => '45%', - 'float' => 'left', - 'padding-right' => '2em', - ), - '.woocommerce form.checkout_coupon' => array( - 'width' => '50%', - ), - ); - if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { - $min_tablet_css['.woocommerce #reviews #comments']['float'] = 'right'; - $min_tablet_css['.woocommerce #reviews #review_form_wrapper']['float'] = 'left'; - } - } else { - $min_tablet_css = array( - '.woocommerce #reviews #comments' => array( - 'width' => '55%', - ), - '.woocommerce #reviews #review_form_wrapper' => array( - 'width' => '45%', - 'padding-left' => '2em', - ), - '.woocommerce form.checkout_coupon' => array( - 'width' => '50%', - ), - ); - - if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { - $min_tablet_css['.woocommerce #reviews #comments']['float'] = 'left'; - $min_tablet_css['.woocommerce #reviews #review_form_wrapper']['float'] = 'right'; - } - } - - $css_output .= astra_parse_css( $min_tablet_css, astra_get_tablet_breakpoint( '', 1 ) ); - - /** - * Global button CSS - Tablet = max-width: (tab-breakpoint)px. - */ - $css_global_button_tablet = array( - '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart, .ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart' => array( - 'padding-right' => 0, - 'padding-left' => 0, - ), - '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .main-header-bar' => array( - 'text-align' => 'center', - ), - '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-site-header-cart, .ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-mobile-menu-buttons' => array( - 'display' => 'inline-block', - ), - '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-2.ast-mobile-header-inline .site-branding' => array( - 'flex' => 'auto', - ), - '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .site-branding' => array( - 'flex' => '0 0 100%', - ), - '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .main-header-container' => array( - 'display' => 'flex', - 'justify-content' => 'center', - ), - '.woocommerce-cart .woocommerce-shipping-calculator .button' => array( - 'width' => '100%', - ), - '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce-cart table.cart td.actions .button, .woocommerce form.checkout_coupon .button, .woocommerce #respond input#submit, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), - ), - '.woocommerce div.product div.images, .woocommerce div.product div.summary, .woocommerce #content div.product div.images, .woocommerce #content div.product div.summary, .woocommerce-page div.product div.images, .woocommerce-page div.product div.summary, .woocommerce-page #content div.product div.images, .woocommerce-page #content div.product div.summary' => array( - 'float' => 'none', - 'width' => '100%', - ), - '.woocommerce-cart table.cart td.actions .ast-return-to-shop' => array( - 'display' => 'block', - 'text-align' => 'center', - 'margin-top' => '1em', - ), - ); - - if ( Astra_Builder_Helper::apply_flex_based_css() ) { - $css_global_button_tablet['.woocommerce ul.products, .woocommerce-page ul.products'] = array( - 'grid-template-columns' => 'repeat(3, minmax(0, 1fr))', - ); - - if ( is_shop() || is_product_taxonomy() ) { - - $archive_tablet_grid = $this->get_grid_column_count( 'archive', 'tablet' ); - - $css_global_button_tablet[ '.woocommerce.tablet-columns-' . $archive_tablet_grid . ' ul.products' ] = array( - 'grid-template-columns' => 'repeat(' . $archive_tablet_grid . ', minmax(0, 1fr))', - ); - $css_global_button_tablet['.woocommerce[class*="tablet-columns-"] .site-main div.product .related.products ul.products li.product'] = array( - 'width' => '100%', - ); - } - - if ( is_product() ) { - - $single_tablet_grid = $this->get_grid_column_count( 'single', 'tablet' ); - - $css_global_button_tablet[ '.woocommerce.tablet-rel-up-columns-' . $single_tablet_grid . ' ul.products' ] = array( - 'grid-template-columns' => 'repeat(' . $single_tablet_grid . ', minmax(0, 1fr))', - ); - $css_global_button_tablet['.woocommerce[class*="tablet-rel-up-columns-"] .site-main div.product .related.products ul.products li.product'] = array( - 'width' => '100%', - ); - } - } - - $css_output .= astra_parse_css( $css_global_button_tablet, '', astra_get_tablet_breakpoint() ); - - /** - * Global button CSS - Mobile = max-width: (mobile-breakpoint)px. - */ - $css_global_button_mobile = array( - '.ast-separate-container .ast-woocommerce-container' => array( - 'padding' => '.54em 1em 1.33333em', - ), - '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce-cart table.cart td.actions .button, .woocommerce form.checkout_coupon .button, .woocommerce #respond input#submit, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), - ), - '.woocommerce-message, .woocommerce-error, .woocommerce-info' => array( - 'display' => 'flex', - 'flex-wrap' => 'wrap', - ), - '.woocommerce-message a.button, .woocommerce-error a.button, .woocommerce-info a.button' => array( - 'order' => '1', - 'margin-top' => '.5em', - ), - - '.woocommerce .woocommerce-ordering, .woocommerce-page .woocommerce-ordering' => array( - 'float' => 'none', - 'margin-bottom' => '2em', - 'width' => '100%', - ), - '.woocommerce ul.products a.button, .woocommerce-page ul.products a.button' => array( - 'padding' => '0.5em 0.75em', - ), - '.woocommerce table.cart td.actions .button, .woocommerce #content table.cart td.actions .button, .woocommerce-page table.cart td.actions .button, .woocommerce-page #content table.cart td.actions .button' => array( - 'padding-left' => '1em', - 'padding-right' => '1em', - ), - '.woocommerce #content table.cart .button, .woocommerce-page #content table.cart .button' => array( - 'width' => '100%', - ), - '.woocommerce #content table.cart .product-thumbnail, .woocommerce-page #content table.cart .product-thumbnail' => array( - 'display' => 'block', - 'text-align' => 'center !important', - ), - '.woocommerce #content table.cart .product-thumbnail::before, .woocommerce-page #content table.cart .product-thumbnail::before' => array( - 'display' => 'none', - ), - '.woocommerce #content table.cart td.actions .coupon, .woocommerce-page #content table.cart td.actions .coupon' => array( - 'float' => 'none', - ), - '.woocommerce #content table.cart td.actions .coupon .button, .woocommerce-page #content table.cart td.actions .coupon .button' => array( - 'flex' => '1', - ), - '.woocommerce #content div.product .woocommerce-tabs ul.tabs li a, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li a' => array( - 'display' => 'block', - ), - ); - - if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { - $css_global_button_mobile['.woocommerce div.product .related.products ul.products li.product, .woocommerce.mobile-columns-2 ul.products li.product, .woocommerce-page.mobile-columns-2 ul.products li.product'] = array( - 'width' => '46.1%', - 'width' => 'calc(50% - 10px)', - ); - $css_global_button_mobile['.woocommerce.mobile-columns-6 ul.products li.product, .woocommerce-page.mobile-columns-6 ul.products li.product'] = array( - 'width' => '10.2%', - 'width' => 'calc(16.66% - 16.66px)', - ); - $css_global_button_mobile['.woocommerce.mobile-columns-5 ul.products li.product, .woocommerce-page.mobile-columns-5 ul.products li.product'] = array( - 'width' => '13%', - 'width' => 'calc(20% - 16px)', - ); - $css_global_button_mobile['.woocommerce.mobile-columns-4 ul.products li.product, .woocommerce-page.mobile-columns-4 ul.products li.product'] = array( - 'width' => '19%', - 'width' => 'calc(25% - 15px)', - ); - $css_global_button_mobile['.woocommerce.mobile-columns-3 ul.products li.product, .woocommerce-page.mobile-columns-3 ul.products li.product'] = array( - 'width' => '28.2%', - 'width' => 'calc(33.33% - 14px)', - ); - $css_global_button_mobile['.woocommerce.mobile-columns-1 ul.products li.product, .woocommerce-page.mobile-columns-1 ul.products li.product'] = array( - 'width' => '100%', - ); - } else { - - $archive_mobile_grid = $this->get_grid_column_count( 'archive', 'mobile' ); - $single_mobile_grid = $this->get_grid_column_count( 'single', 'mobile' ); - - $css_global_button_mobile[ '.woocommerce ul.products, .woocommerce-page ul.products, .woocommerce.mobile-columns-' . $archive_mobile_grid . ' ul.products, .woocommerce-page.mobile-columns-' . $archive_mobile_grid . ' ul.products' ] = array( - 'grid-template-columns' => 'repeat(' . $archive_mobile_grid . ', minmax(0, 1fr))', - ); - $css_global_button_mobile[ '.woocommerce.mobile-rel-up-columns-' . $single_mobile_grid . ' ul.products' ] = array( - 'grid-template-columns' => 'repeat(' . $single_mobile_grid . ', minmax(0, 1fr))', - ); - } - - $css_output .= astra_parse_css( $css_global_button_mobile, '', astra_get_mobile_breakpoint() ); - - if ( $is_site_rtl ) { - $global_button_mobile_lang_direction_css = array( - '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array( - 'width' => '46.1%', - 'width' => 'calc(50% - 10px)', - 'margin-left' => '20px', - ), - '.woocommerce ul.products a.button.loading::after, .woocommerce-page ul.products a.button.loading::after' => array( - 'display' => 'inline-block', - 'margin-right' => '5px', - 'position' => 'initial', - ), - '.woocommerce.mobile-columns-1 .site-main ul.products li.product:nth-child(n), .woocommerce-page.mobile-columns-1 .site-main ul.products li.product:nth-child(n)' => array( - 'margin-left' => 0, - ), - '.woocommerce #content div.product .woocommerce-tabs ul.tabs li, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li' => array( - 'display' => 'block', - 'margin-left' => 0, - ), - ); - - if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { - $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)'] = array( - 'margin-left' => '20px', - 'clear' => 'none', - ); - $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-6>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-6>ul.products li.product:nth-child(2n)'] = array( - 'margin-left' => 0, - 'clear' => 'left', - ); - $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(2n+1)'] = array( - 'clear' => 'right', - ); - $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-] ul.products li.product:nth-child(n), .woocommerce[class*=columns-] ul.products li.product:nth-child(n)'] = array( - 'margin-left' => '20px', - 'clear' => 'none', - ); - $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce div.product .related.products ul.products li.product:nth-child(2n)'] = array( - 'margin-left' => 0, - 'clear' => 'left', - ); - $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce div.product .related.products ul.products li.product:nth-child(2n+1)'] = array( - 'clear' => 'right', - ); - } - } else { - $global_button_mobile_lang_direction_css = array( - '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array( - 'width' => '46.1%', - 'width' => 'calc(50% - 10px)', - 'margin-right' => '20px', - ), - '.woocommerce ul.products a.button.loading::after, .woocommerce-page ul.products a.button.loading::after' => array( - 'display' => 'inline-block', - 'margin-left' => '5px', - 'position' => 'initial', - ), - '.woocommerce.mobile-columns-1 .site-main ul.products li.product:nth-child(n), .woocommerce-page.mobile-columns-1 .site-main ul.products li.product:nth-child(n)' => array( - 'margin-right' => 0, - ), - '.woocommerce #content div.product .woocommerce-tabs ul.tabs li, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li' => array( - 'display' => 'block', - 'margin-right' => 0, - ), - ); - - if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { - $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)'] = array( - 'margin-right' => '20px', - 'clear' => 'none', - ); - $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-6>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-6>ul.products li.product:nth-child(2n)'] = array( - 'margin-right' => 0, - 'clear' => 'right', - ); - $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(2n+1)'] = array( - 'clear' => 'left', - ); - $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-] ul.products li.product:nth-child(n), .woocommerce[class*=columns-] ul.products li.product:nth-child(n)'] = array( - 'margin-right' => '20px', - 'clear' => 'none', - ); - $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce div.product .related.products ul.products li.product:nth-child(2n)'] = array( - 'margin-right' => 0, - 'clear' => 'right', - ); - $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce div.product .related.products ul.products li.product:nth-child(2n+1)'] = array( - 'clear' => 'left', - ); - } - } - - $css_output .= astra_parse_css( $global_button_mobile_lang_direction_css, '', astra_get_mobile_breakpoint() ); - - if ( 'page-builder' !== astra_get_content_layout() ) { - /* Woocommerce Shop Archive width */ - if ( 'custom' === $woo_shop_archive_width ) : - // Woocommerce shop archive custom width. - $site_width = array( - '.ast-woo-shop-archive .site-content > .ast-container' => array( - 'max-width' => astra_get_css_value( $woo_shop_archive_max_width, 'px' ), - ), - ); - $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) ); - - else : - // Woocommerce shop archive default width. - $site_width = array( - '.ast-woo-shop-archive .site-content > .ast-container' => array( - 'max-width' => astra_get_css_value( $site_content_width + 40, 'px' ), - ), - ); - - /* Parse CSS from array()*/ - $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) ); - endif; - } - - $woo_product_css = array( - '.woocommerce #content .ast-woocommerce-container div.product div.images, .woocommerce .ast-woocommerce-container div.product div.images, .woocommerce-page #content .ast-woocommerce-container div.product div.images, .woocommerce-page .ast-woocommerce-container div.product div.images' => array( - 'width' => '50%', - ), - '.woocommerce #content .ast-woocommerce-container div.product div.summary, .woocommerce .ast-woocommerce-container div.product div.summary, .woocommerce-page #content .ast-woocommerce-container div.product div.summary, .woocommerce-page .ast-woocommerce-container div.product div.summary' => array( - 'width' => '46%', - ), - '.woocommerce.woocommerce-checkout form #customer_details.col2-set .col-1, .woocommerce.woocommerce-checkout form #customer_details.col2-set .col-2, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set .col-1, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set .col-2' => array( - 'float' => 'none', - 'width' => 'auto', - ), - ); - - /* Parse CSS from array()*/ - $css_output .= astra_parse_css( $woo_product_css, astra_get_tablet_breakpoint( '', 1 ) ); - - /* - * global button settings not working for woocommerce button on shop and single page. - * check if the current user is existing user or new user. - * if new user load the CSS bty default if existing provide a filter - */ - if ( self::astra_global_btn_woo_comp() ) { - - $woo_global_button_css = array( - '.woocommerce a.button , .woocommerce button.button.alt ,.woocommerce-page table.cart td.actions .button, .woocommerce-page #content table.cart td.actions .button , .woocommerce a.button.alt ,.woocommerce .woocommerce-message a.button , .ast-site-header-cart .widget_shopping_cart .buttons .button.checkout, .woocommerce button.button.alt.disabled , .wc-block-grid__products .wc-block-grid__product .wp-block-button__link ' => array( - 'border' => 'solid', - 'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '0', - 'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '0', - 'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '0', - 'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '0', - 'border-color' => $btn_border_color ? $btn_border_color : $btn_bg_color, - ), - '.woocommerce a.button:hover , .woocommerce button.button.alt:hover , .woocommerce-page table.cart td.actions .button:hover, .woocommerce-page #content table.cart td.actions .button:hover, .woocommerce a.button.alt:hover ,.woocommerce .woocommerce-message a.button:hover , .ast-site-header-cart .widget_shopping_cart .buttons .button.checkout:hover , .woocommerce button.button.alt.disabled:hover , .wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array( - 'border-color' => $btn_border_h_color ? $btn_border_h_color : $btn_bg_h_color, - ), - ); - - $css_output .= astra_parse_css( $woo_global_button_css ); - } - - if ( ! is_shop() && ! is_product() ) { - - $css_output .= astra_parse_css( - array( - '.widget_product_search button' => array( - 'flex' => '0 0 auto', - 'padding' => '10px 20px;', - ), - ) - ); - } - - if ( $is_site_rtl ) { - $woo_product_lang_direction_css = array( - '.woocommerce.woocommerce-checkout form #customer_details.col2-set, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set' => array( - 'width' => '55%', - 'float' => 'right', - 'margin-left' => '4.347826087%', - ), - '.woocommerce.woocommerce-checkout form #order_review, .woocommerce.woocommerce-checkout form #order_review_heading, .woocommerce-page.woocommerce-checkout form #order_review, .woocommerce-page.woocommerce-checkout form #order_review_heading' => array( - 'width' => '40%', - 'float' => 'left', - 'margin-left' => '0', - 'clear' => 'left', - ), - ); - } else { - $woo_product_lang_direction_css = array( - '.woocommerce.woocommerce-checkout form #customer_details.col2-set, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set' => array( - 'width' => '55%', - 'float' => 'left', - 'margin-right' => '4.347826087%', - ), - '.woocommerce.woocommerce-checkout form #order_review, .woocommerce.woocommerce-checkout form #order_review_heading, .woocommerce-page.woocommerce-checkout form #order_review, .woocommerce-page.woocommerce-checkout form #order_review_heading' => array( - 'width' => '40%', - 'float' => 'right', - 'margin-right' => '0', - 'clear' => 'right', - ), - ); - } - - /* Parse CSS from array()*/ - $css_output .= astra_parse_css( $woo_product_lang_direction_css, astra_get_tablet_breakpoint( '', 1 ) ); - - wp_add_inline_style( 'woocommerce-general', apply_filters( 'astra_theme_woocommerce_dynamic_css', $css_output ) ); - - /** - * YITH WooCommerce Wishlist Style - */ - $yith_wcwl_main_style = array( - '.yes-js.js_active .ast-plain-container.ast-single-post #primary' => array( - 'margin' => esc_attr( '4em 0' ), - ), - '.js_active .ast-plain-container.ast-single-post .entry-header' => array( - 'margin-top' => esc_attr( '0' ), - ), - '.woocommerce table.wishlist_table' => array( - 'font-size' => esc_attr( '100%' ), - ), - '.woocommerce table.wishlist_table tbody td.product-name' => array( - 'font-weight' => esc_attr( '700' ), - ), - '.woocommerce table.wishlist_table thead th' => array( - 'border-top' => esc_attr( '0' ), - ), - '.woocommerce table.wishlist_table tr td.product-remove' => array( - 'padding' => esc_attr( '.7em 1em' ), - ), - '.woocommerce table.wishlist_table tbody td' => array( - 'border-right' => esc_attr( '0' ), - ), - '.woocommerce .wishlist_table td.product-add-to-cart a' => array( - 'display' => esc_attr( 'inherit !important' ), - ), - '.wishlist_table tr td, .wishlist_table tr th.wishlist-delete, .wishlist_table tr th.product-checkbox' => array( - 'text-align' => esc_attr( 'left' ), - ), - '.woocommerce #content table.wishlist_table.cart a.remove' => array( - 'display' => esc_attr( 'inline-block' ), - 'vertical-align' => esc_attr( 'middle' ), - 'font-size' => esc_attr( '18px' ), - 'font-weight' => esc_attr( 'normal' ), - 'width' => esc_attr( '24px' ), - 'height' => esc_attr( '24px' ), - 'line-height' => esc_attr( '21px' ), - 'color' => esc_attr( '#ccc !important' ), - 'text-align' => esc_attr( 'center' ), - 'border' => esc_attr( '1px solid #ccc' ), - ), - '.woocommerce #content table.wishlist_table.cart a.remove:hover' => array( - 'color' => esc_attr( $link_color . '!important' ), - 'border-color' => esc_attr( $link_color ), - 'background-color' => esc_attr( '#ffffff' ), - ), - ); - /* Parse CSS from array() */ - $yith_wcwl_main_style = astra_parse_css( $yith_wcwl_main_style ); - - $yith_wcwl_main_style_small = array( - '.yes-js.js_active .ast-plain-container.ast-single-post #primary' => array( - 'padding' => esc_attr( '1.5em 0' ), - 'margin' => esc_attr( '0' ), - ), - ); - /* Parse CSS from array()*/ - $yith_wcwl_main_style .= astra_parse_css( $yith_wcwl_main_style_small, '', astra_get_tablet_breakpoint() ); - - wp_add_inline_style( 'yith-wcwl-main', $yith_wcwl_main_style ); - } - - /** - * Register Customizer sections and panel for woocommerce - * - * @since 1.0.0 - * @param WP_Customize_Manager $wp_customize Theme Customizer object. - */ - public function customize_register( $wp_customize ) { - - // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - /** - * Register Sections & Panels - */ - require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/class-astra-customizer-register-woo-section.php'; - - /** - * Sections - */ - require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-container-configs.php'; - require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php'; - require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php'; - require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php'; - require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php'; - // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - - } - - /** - * Add Cart icon markup - * - * @param String $output Markup. - * @param String $section Section name. - * @param String $section_type Section selected option. - * @return Markup String. - * - * @since 1.0.0 - */ - public function astra_header_cart( $output, $section, $section_type ) { - - if ( 'woocommerce' === $section_type && apply_filters( 'astra_woo_header_cart_icon', true ) ) { - - $output = $this->woo_mini_cart_markup(); - } - - return $output; - } - - /** - * Woocommerce mini cart markup markup - * - * @since 1.2.2 - * @return html - */ - public function woo_mini_cart_markup() { - - if ( is_cart() ) { - $class = 'current-menu-item'; - } else { - $class = ''; - } - - $cart_menu_classes = apply_filters( 'astra_cart_in_menu_class', array( 'ast-menu-cart-with-border' ) ); - - ob_start(); - if ( is_customize_preview() && true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - Astra_Builder_UI_Controller::render_customizer_edit_button(); - } - ?> -
    -
    - astra_get_cart_link(); ?> -
    -
    - -
    -
    - - - - -
    - - cart ) { - echo WC()->cart->get_cart_contents_count(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - ?> - -
    - -
    - astra_get_cart_link(); - $fragments['a.cart-container'] = ob_get_clean(); - - return $fragments; - } - - /** - * For existing users, do not load the wide/full width image CSS by default. - * - * @since 2.5.0 - * @return boolean false if it is an existing user , true if not. - */ - public static function astra_global_btn_woo_comp() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['global-btn-woo-css'] = isset( $astra_settings['global-btn-woo-css'] ) ? false : true; - return apply_filters( 'astra_global_btn_woo_comp', $astra_settings['global-btn-woo-css'] ); - } - } - -endif; - -if ( apply_filters( 'astra_enable_woocommerce_integration', true ) ) { - Astra_Woocommerce::get_instance(); -} +=' ) ) { + add_filter( 'woocommerce_add_to_cart_fragments', array( $this, 'cart_link_fragment' ) ); + } else { + add_filter( 'add_to_cart_fragments', array( $this, 'cart_link_fragment' ) ); + } + + add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'product_flip_image' ), 10 ); + add_filter( 'woocommerce_subcategory_count_html', array( $this, 'subcategory_count_markup' ), 10, 2 ); + + add_action( 'customize_register', array( $this, 'customize_register' ), 2 ); + + add_filter( 'woocommerce_get_stock_html', 'astra_woo_product_in_stock', 10, 2 ); + + add_filter( 'astra_schema_body', array( $this, 'remove_body_schema' ) ); + + // Header Cart Icon. + add_action( 'astra_woo_header_cart_icons_before', array( $this, 'header_cart_icon_markup' ) ); + + add_action( 'astra_cart_in_menu_class', array( $this, 'header_cart_icon_class' ), 99 ); + + } + + /** + * Header Cart Extra Icons markup + * + * @return void; + */ + public function header_cart_icon_markup() { + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && ! defined( 'ASTRA_EXT_VER' ) ) { + return; + } + + $icon = astra_get_option( 'woo-header-cart-icon' ); + $cart_total_display = astra_get_option( 'woo-header-cart-total-display' ); + $cart_count_display = apply_filters( 'astra_header_cart_count', true ); + $cart_title_display = astra_get_option( 'woo-header-cart-title-display' ); + $cart_title = apply_filters( 'astra_header_cart_title', __( 'Cart', 'astra' ) ); + + $cart_title_markup = '' . esc_html( $cart_title ) . ''; + $cart_total_markup = ''; + if ( null !== WC()->cart ) { + $cart_total_markup = '' . WC()->cart->get_cart_subtotal() . ''; + } + + // Cart Title & Cart Cart total markup. + $cart_info_markup = sprintf( + ' + %1$s + %2$s + %3$s + ', + ( $cart_title_display ) ? $cart_title_markup : '', + ( $cart_total_display && $cart_title_display ) ? '/' : '', + ( $cart_total_display ) ? $cart_total_markup : '' + ); + + $cart_contents_count = 0; + if ( null !== WC()->cart ) { + $cart_contents_count = WC()->cart->get_cart_contents_count(); + } + + // Cart Icon markup with total number of items. + $cart_icon = sprintf( + '%4$s', + ( $icon ) ? $icon : '', + ( $cart_count_display ) ? '' : 'no-cart-total', + ( $cart_count_display ) ? 'data-cart-total="' . $cart_contents_count . '"' : '', + ( $icon ) ? ( ( false !== Astra_Icons::is_svg_icons() ) ? Astra_Icons::get_icons( $icon ) : '' ) : '' + ); + + // Theme's default icon with cart title and cart total. + if ( 'default' == $icon || ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && ! Astra_Ext_Extension::is_active( 'woocommerce' ) ) ) { + // Cart Total or Cart Title enable then only add markup. + if ( $cart_title_display || $cart_total_display ) { + echo $cart_info_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } + } else { + + // Remove Default cart icon added by theme. + add_filter( 'astra_woo_default_header_cart_icon', '__return_false' ); + + /* translators: 1: Cart Title Markup, 2: Cart Icon Markup */ + printf( + '
    + %1$s + %2$s +
    ', + ( $cart_title_display || $cart_total_display ) ? $cart_info_markup : '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + ( $cart_icon ) ? $cart_icon : '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + ); + } + } + + /** + * Header Cart Icon Class + * + * @param array $classes Default argument array. + * + * @return array; + */ + public function header_cart_icon_class( $classes ) { + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && ! defined( 'ASTRA_EXT_VER' ) ) { + return $classes; + } + + $header_cart_icon_style = astra_get_option( 'woo-header-cart-icon-style' ); + + $classes[] = 'ast-menu-cart-' . $header_cart_icon_style; + $header_cart_icon_has_color = astra_get_option( 'woo-header-cart-icon-color' ); + if ( ! empty( $header_cart_icon_has_color ) && ( 'none' !== $header_cart_icon_style ) ) { + $classes[] = 'ast-menu-cart-has-color'; + } + + return $classes; + } + + /** + * Remove body schema when using WooCommerce template. + * WooCommerce adds it's own product schema hence schema data from Astra should be disabled here. + * + * @since 1.8.0 + * @param String $schema Schema markup. + * @return String + */ + public function remove_body_schema( $schema ) { + if ( is_woocommerce() ) { + $schema = ''; + } + + return $schema; + } + + /** + * Rating Markup + * + * @since 1.2.2 + * @param string $html Rating Markup. + * @param float $rating Rating being shown. + * @param int $count Total number of ratings. + * @return string + */ + public function rating_markup( $html, $rating, $count ) { + + if ( 0 == $rating ) { + $html = '
    '; + $html .= wc_get_star_rating_html( $rating, $count ); + $html .= '
    '; + } + return $html; + } + + /** + * Cart Page Upselles products. + * + * @return void + */ + public function cart_page_upselles() { + + $upselles_enabled = astra_get_option( 'enable-cart-upsells' ); + if ( ! $upselles_enabled ) { + remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' ); + } + } + + /** + * Subcategory Count Markup + * + * @param array $styles Css files. + * + * @return array + */ + public function woo_filter_style( $styles ) { + + /* Directory and Extension */ + $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; + $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; + + $css_uri = ASTRA_THEME_URI . 'assets/css/' . $dir_name . '/compatibility/woocommerce/'; + + // Register & Enqueue Styles. + // Generate CSS URL. + + if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { + $styles = array( + 'woocommerce-layout' => array( + 'src' => $css_uri . 'woocommerce-layout' . $file_prefix . '.css', + 'deps' => '', + 'version' => ASTRA_THEME_VERSION, + 'media' => 'all', + 'has_rtl' => true, + ), + 'woocommerce-smallscreen' => array( + 'src' => $css_uri . 'woocommerce-smallscreen' . $file_prefix . '.css', + 'deps' => 'woocommerce-layout', + 'version' => ASTRA_THEME_VERSION, + 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', astra_get_tablet_breakpoint() . 'px' ) . ')', + 'has_rtl' => true, + ), + 'woocommerce-general' => array( + 'src' => $css_uri . 'woocommerce' . $file_prefix . '.css', + 'deps' => '', + 'version' => ASTRA_THEME_VERSION, + 'media' => 'all', + 'has_rtl' => true, + ), + ); + } else { + $styles = array( + 'woocommerce-layout' => array( + 'src' => $css_uri . 'woocommerce-layout-grid' . $file_prefix . '.css', + 'deps' => '', + 'version' => ASTRA_THEME_VERSION, + 'media' => 'all', + 'has_rtl' => true, + ), + 'woocommerce-smallscreen' => array( + 'src' => $css_uri . 'woocommerce-smallscreen-grid' . $file_prefix . '.css', + 'deps' => 'woocommerce-layout', + 'version' => ASTRA_THEME_VERSION, + 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', astra_get_tablet_breakpoint() . 'px' ) . ')', + 'has_rtl' => true, + ), + 'woocommerce-general' => array( + 'src' => $css_uri . 'woocommerce-grid' . $file_prefix . '.css', + 'deps' => '', + 'version' => ASTRA_THEME_VERSION, + 'media' => 'all', + 'has_rtl' => true, + ), + ); + } + + return $styles; + } + + /** + * Subcategory Count Markup + * + * @param mixed $content Count Markup. + * @param object $category Object of Category. + * @return mixed + */ + public function subcategory_count_markup( $content, $category ) { + + $content = sprintf( // WPCS: XSS OK. + /* translators: 1: number of products */ + _nx( '%1$s Product', '%1$s Products', $category->count, 'product categories', 'astra' ), + number_format_i18n( $category->count ) + ); + + return '' . $content . ''; + } + + /** + * Product Flip Image + */ + public function product_flip_image() { + + global $product; + + $hover_style = astra_get_option( 'shop-hover-style' ); + + if ( 'swap' === $hover_style ) { + + $attachment_ids = $product->get_gallery_image_ids(); + + if ( $attachment_ids ) { + + $image_size = apply_filters( 'single_product_archive_thumbnail_size', 'shop_catalog' ); + + echo apply_filters( 'astra_woocommerce_product_flip_image', wp_get_attachment_image( reset( $attachment_ids ), $image_size, false, array( 'class' => 'show-on-hover' ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } + } + } + + /** + * Theme Defaults. + * + * @param array $defaults Array of options value. + * @return array + */ + public function theme_defaults( $defaults ) { + + // Container. + $defaults['woocommerce-content-layout'] = 'plain-container'; + + // Sidebar. + $defaults['woocommerce-sidebar-layout'] = 'no-sidebar'; + $defaults['single-product-sidebar-layout'] = 'default'; + + /* Shop */ + $defaults['shop-grids'] = array( + 'desktop' => 4, + 'tablet' => 3, + 'mobile' => 2, + ); + $defaults['shop-no-of-products'] = '12'; + $defaults['shop-product-structure'] = array( + 'category', + 'title', + 'ratings', + 'price', + 'add_cart', + ); + $defaults['shop-hover-style'] = ''; + + /* Single */ + $defaults['single-product-breadcrumb-disable'] = false; + + /* Cart */ + $defaults['enable-cart-upsells'] = true; + + $defaults['shop-archive-width'] = 'default'; + $defaults['shop-archive-max-width'] = 1200; + + return $defaults; + } + + /** + * Update Shop page grid + * + * @param int $col Shop Column. + * @return int + */ + public function shop_columns( $col ) { + + $col = astra_get_option( 'shop-grids' ); + return $col['desktop']; + } + + /** + * Check if the current page is a Product Subcategory page or not. + * + * @param integer $category_id Current page Category ID. + * @return boolean + */ + public function astra_woo_is_subcategory( $category_id = null ) { + if ( is_tax( 'product_cat' ) ) { + if ( empty( $category_id ) ) { + $category_id = get_queried_object_id(); + } + $category = get_term( get_queried_object_id(), 'product_cat' ); + if ( empty( $category->parent ) ) { + return false; + } + return true; + } + return false; + } + + /** + * Update Shop page grid + * + * @return int + */ + public function shop_no_of_products() { + $taxonomy_page_display = get_option( 'woocommerce_category_archive_display', false ); + if ( is_product_taxonomy() && 'subcategories' === $taxonomy_page_display ) { + if ( $this->astra_woo_is_subcategory() ) { + $products = astra_get_option( 'shop-no-of-products' ); + return $products; + } + $products = wp_count_posts( 'product' )->publish; + } else { + $products = astra_get_option( 'shop-no-of-products' ); + } + return $products; + } + + /** + * Add products item class on shop page + * + * @param Array $classes product classes. + * + * @return array. + */ + public function shop_page_products_item_class( $classes = '' ) { + + if ( is_shop() || is_product_taxonomy() ) { + $shop_grid = astra_get_option( 'shop-grids' ); + $classes[] = 'columns-' . $shop_grid['desktop']; + $classes[] = 'tablet-columns-' . $shop_grid['tablet']; + $classes[] = 'mobile-columns-' . $shop_grid['mobile']; + + $classes[] = 'ast-woo-shop-archive'; + } + // Cart menu is emabled. + $rt_section = astra_get_option( 'header-main-rt-section' ); + + if ( 'woocommerce' === $rt_section ) { + $classes[] = 'ast-woocommerce-cart-menu'; + } + + return $classes; + } + + /** + * Get grid columns for either Archive|Single product. + * Introducing this function to reduce lot of CSS we write for 'grid-template-columns' for every count (till 6). + * + * @param string $type - WooCommerce page type Archive/Single. + * @param string $device - Device specific grid option. + * @param int $default - Default grid count (fallback basically). + * + * @return int grid count. + * @since 3.4.3 + */ + public function get_grid_column_count( $type = 'archive', $device = 'desktop', $default = 2 ) { + + if ( 'archive' === $type ) { + $products_grid = astra_get_option( 'shop-grids' ); + } else { + $products_grid = astra_get_option( 'single-product-related-upsell-grid' ); + } + + return isset( $products_grid[ $device ] ) ? absint( $products_grid[ $device ] ) : $default; + } + + /** + * Add class on single product page + * + * @param Array $classes product classes. + * + * @return array. + */ + public function single_product_class( $classes ) { + + if ( is_product() && 0 == get_post_meta( get_the_ID(), '_wc_review_count', true ) ) { + $classes[] = 'ast-woo-product-no-review'; + } + + if ( is_shop() || is_product_taxonomy() ) { + $hover_style = astra_get_option( 'shop-hover-style' ); + + if ( '' !== $hover_style ) { + $classes[] = 'astra-woo-hover-' . $hover_style; + } + } + + return $classes; + } + + /** + * Update woocommerce related product numbers + * + * @param array $args Related products array. + * @return array + */ + public function related_products_args( $args ) { + + $col = astra_get_option( 'shop-grids' ); + $args['posts_per_page'] = $col['desktop']; + return $args; + } + + /** + * Setup theme + * + * @since 1.0.3 + */ + public function setup_theme() { + + // WooCommerce. + add_theme_support( 'wc-product-gallery-zoom' ); + add_theme_support( 'wc-product-gallery-lightbox' ); + add_theme_support( 'wc-product-gallery-slider' ); + } + + /** + * Store widgets init. + */ + public function store_widgets_init() { + register_sidebar( + apply_filters( + 'astra_woocommerce_shop_sidebar_init', + array( + 'name' => esc_html__( 'WooCommerce Sidebar', 'astra' ), + 'id' => 'astra-woo-shop-sidebar', + 'description' => __( 'This sidebar will be used on Product archive, Cart, Checkout and My Account pages.', 'astra' ), + 'before_widget' => '
    ', + 'after_widget' => '
    ', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + register_sidebar( + apply_filters( + 'astra_woocommerce_single_sidebar_init', + array( + 'name' => esc_html__( 'Product Sidebar', 'astra' ), + 'id' => 'astra-woo-single-sidebar', + 'description' => __( 'This sidebar will be used on Single Product page.', 'astra' ), + 'before_widget' => '
    ', + 'after_widget' => '
    ', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + } + + /** + * Assign shop sidebar for store page. + * + * @param String $sidebar Sidebar. + * + * @return String $sidebar Sidebar. + */ + public function replace_store_sidebar( $sidebar ) { + + if ( is_shop() || is_product_taxonomy() || is_checkout() || is_cart() || is_account_page() ) { + $sidebar = 'astra-woo-shop-sidebar'; + } elseif ( is_product() ) { + $sidebar = 'astra-woo-single-sidebar'; + } + + return $sidebar; + } + + /** + * WooCommerce Container + * + * @param String $sidebar_layout Layout type. + * + * @return String $sidebar_layout Layout type. + */ + public function store_sidebar_layout( $sidebar_layout ) { + + if ( is_shop() || is_product_taxonomy() || is_checkout() || is_cart() || is_account_page() ) { + + $woo_sidebar = astra_get_option( 'woocommerce-sidebar-layout' ); + + if ( 'default' !== $woo_sidebar ) { + + $sidebar_layout = $woo_sidebar; + } + + if ( is_shop() ) { + $shop_page_id = get_option( 'woocommerce_shop_page_id' ); + $shop_sidebar = get_post_meta( $shop_page_id, 'site-sidebar-layout', true ); + } elseif ( is_product_taxonomy() ) { + $shop_sidebar = 'default'; + } else { + $shop_sidebar = astra_get_option_meta( 'site-sidebar-layout', '', true ); + } + + if ( 'default' !== $shop_sidebar && ! empty( $shop_sidebar ) ) { + $sidebar_layout = $shop_sidebar; + } + } + + return $sidebar_layout; + } + /** + * WooCommerce Container + * + * @param String $layout Layout type. + * + * @return String $layout Layout type. + */ + public function store_content_layout( $layout ) { + + if ( is_woocommerce() || is_checkout() || is_cart() || is_account_page() ) { + + $woo_layout = astra_get_option( 'woocommerce-content-layout' ); + + if ( 'default' !== $woo_layout ) { + + $layout = $woo_layout; + } + + if ( is_shop() ) { + $shop_page_id = get_option( 'woocommerce_shop_page_id' ); + $shop_layout = get_post_meta( $shop_page_id, 'site-content-layout', true ); + } elseif ( is_product_taxonomy() ) { + $shop_layout = 'default'; + } else { + $shop_layout = astra_get_option_meta( 'site-content-layout', '', true ); + } + + if ( 'default' !== $shop_layout && ! empty( $shop_layout ) ) { + $layout = $shop_layout; + } + } + + return apply_filters( 'astra_get_store_content_layout', $layout ); + } + + /** + * Shop Page Meta + * + * @return void + */ + public function shop_meta_option() { + + // Page Title. + if ( is_shop() ) { + + $shop_page_id = get_option( 'woocommerce_shop_page_id' ); + $shop_title = get_post_meta( $shop_page_id, 'site-post-title', true ); + $main_header_display = get_post_meta( $shop_page_id, 'ast-main-header-display', true ); + $footer_layout = get_post_meta( $shop_page_id, 'footer-sml-layout', true ); + + if ( 'disabled' === $shop_title ) { + add_filter( 'woocommerce_show_page_title', '__return_false' ); + } + + if ( 'disabled' === $main_header_display ) { + remove_action( 'astra_masthead', 'astra_masthead_primary_template' ); + } + + if ( 'disabled' === $footer_layout ) { + remove_action( 'astra_footer_content', 'astra_footer_small_footer_template', 5 ); + } + } + } + + + /** + * Shop customization. + * + * @return void + */ + public function shop_customization() { + + if ( ! apply_filters( 'astra_woo_shop_product_structure_override', false ) ) { + + add_action( 'woocommerce_before_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_start', 6 ); + /** + * Add sale flash before shop loop. + */ + add_action( 'woocommerce_before_shop_loop_item', 'woocommerce_show_product_loop_sale_flash', 9 ); + + add_action( 'woocommerce_after_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_end', 8 ); + /** + * Add Out of Stock to the Shop page + */ + add_action( 'woocommerce_shop_loop_item_title', 'astra_woo_shop_out_of_stock', 8 ); + + remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); + + /** + * Shop Page Product Content Sorting + */ + add_action( 'woocommerce_after_shop_loop_item', 'astra_woo_woocommerce_shop_product_content' ); + } + } + + /** + * Checkout customization. + * + * @return void + */ + public function woocommerce_checkout() { + + if ( is_admin() ) { + return; + } + + if ( ! apply_filters( 'astra_woo_shop_product_structure_override', false ) ) { + + /** + * Checkout Page + */ + add_action( 'woocommerce_checkout_billing', array( WC()->checkout(), 'checkout_form_shipping' ) ); + } + + // Checkout Page. + remove_action( 'woocommerce_checkout_shipping', array( WC()->checkout(), 'checkout_form_shipping' ) ); + } + + /** + * Single product customization. + * + * @return void + */ + public function single_product_customization() { + + if ( ! is_product() ) { + return; + } + + add_filter( 'woocommerce_product_description_heading', '__return_false' ); + add_filter( 'woocommerce_product_additional_information_heading', '__return_false' ); + + // Breadcrumb. + remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); + if ( ! astra_get_option( 'single-product-breadcrumb-disable' ) ) { + add_action( 'woocommerce_single_product_summary', 'woocommerce_breadcrumb', 2 ); + } + } + + /** + * Remove Woo-Commerce Default actions + */ + public function woocommerce_init() { + remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); + remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); + remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 ); + remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); + remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); + remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); + remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 ); + } + + /** + * Add start of wrapper + */ + public function before_main_content_start() { + $site_sidebar = astra_page_layout(); + if ( 'left-sidebar' == $site_sidebar ) { + get_sidebar(); + } + ?> +
    + + + +
    +
    + +
    +
    + + + +
    + array( + 'background-color' => $theme_color, + 'color' => astra_get_foreground_color( $theme_color ), + ), + '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled], .woocommerce input.button:disabled:hover, .woocommerce input.button:disabled[disabled]:hover, .woocommerce #respond input#submit, .woocommerce button.button.alt.disabled, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link, .wc-block-grid__product-onsale' => array( + 'color' => $btn_color, + 'border-color' => $btn_bg_color, + 'background-color' => $btn_bg_color, + ), + '.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce .woocommerce-message a.button:hover,.woocommerce #respond input#submit:hover,.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce input.button:hover, .woocommerce button.button.alt.disabled:hover, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array( + 'color' => $btn_h_color, + 'border-color' => $btn_bg_h_color, + 'background-color' => $btn_bg_h_color, + ), + '.woocommerce-message, .woocommerce-info' => array( + 'border-top-color' => $link_color, + ), + '.woocommerce-message::before,.woocommerce-info::before' => array( + 'color' => $link_color, + ), + '.woocommerce ul.products li.product .price, .woocommerce div.product p.price, .woocommerce div.product span.price, .widget_layered_nav_filters ul li.chosen a, .woocommerce-page ul.products li.product .ast-woo-product-category, .wc-layered-nav-rating a' => array( + 'color' => $text_color, + ), + // Form Fields, Pagination border Color. + '.woocommerce nav.woocommerce-pagination ul,.woocommerce nav.woocommerce-pagination ul li' => array( + 'border-color' => $link_color, + ), + '.woocommerce nav.woocommerce-pagination ul li a:focus, .woocommerce nav.woocommerce-pagination ul li a:hover, .woocommerce nav.woocommerce-pagination ul li span.current' => array( + 'background' => $link_color, + 'color' => $btn_color, + ), + '.woocommerce-MyAccount-navigation-link.is-active a' => array( + 'color' => $link_h_color, + ), + '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle' => array( + 'background-color' => $link_color, + ), + // Button Typography. + '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce-cart table.cart td.actions .button, .woocommerce form.checkout_coupon .button, .woocommerce #respond input#submit, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( + 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), + ), + '.woocommerce .star-rating, .woocommerce .comment-form-rating .stars a, .woocommerce .star-rating::before' => array( + 'color' => $link_color, + ), + '.woocommerce div.product .woocommerce-tabs ul.tabs li.active:before' => array( + 'background' => $link_color, + ), + '.woocommerce a.remove:hover' => array( + 'color' => esc_attr( $link_color ), + 'border-color' => esc_attr( $link_color ), + 'background-color' => esc_attr( '#ffffff' ), + ), + ); + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + $compat_css_desktop = array( + /** + * Cart in menu + */ + '.ast-site-header-cart a' => array( + 'color' => esc_attr( $text_color ), + ), + + '.ast-site-header-cart a:focus, .ast-site-header-cart a:hover, .ast-site-header-cart .current-menu-item a' => array( + 'color' => esc_attr( $link_color ), + ), + + '.ast-cart-menu-wrap .count, .ast-cart-menu-wrap .count:after' => array( + 'border-color' => esc_attr( $link_color ), + 'color' => esc_attr( $link_color ), + ), + + '.ast-cart-menu-wrap:hover .count' => array( + 'color' => esc_attr( $cart_h_color ), + 'background-color' => esc_attr( $link_color ), + ), + + '.ast-site-header-cart .widget_shopping_cart .total .woocommerce-Price-amount' => array( + 'color' => esc_attr( $link_color ), + ), + + '.woocommerce a.remove:hover, .ast-woocommerce-cart-menu .main-header-menu .woocommerce-custom-menu-item .menu-item:hover > .menu-link.remove:hover' => array( + 'color' => esc_attr( $link_color ), + 'border-color' => esc_attr( $link_color ), + 'background-color' => esc_attr( '#ffffff' ), + ), + + /** + * Checkout button color for widget + */ + '.ast-site-header-cart .widget_shopping_cart .buttons .button.checkout, .woocommerce .widget_shopping_cart .woocommerce-mini-cart__buttons .checkout.wc-forward' => array( + 'color' => $btn_h_color, + 'border-color' => $btn_bg_h_color, + 'background-color' => $btn_bg_h_color, + ), + '.site-header .ast-site-header-cart-data .button.wc-forward, .site-header .ast-site-header-cart-data .button.wc-forward:hover' => array( + 'color' => $btn_color, + ), + '.below-header-user-select .ast-site-header-cart .widget, .ast-above-header-section .ast-site-header-cart .widget a, .below-header-user-select .ast-site-header-cart .widget_shopping_cart a' => array( + 'color' => $text_color, + ), + '.below-header-user-select .ast-site-header-cart .widget_shopping_cart a:hover, .ast-above-header-section .ast-site-header-cart .widget_shopping_cart a:hover, .below-header-user-select .ast-site-header-cart .widget_shopping_cart a.remove:hover, .ast-above-header-section .ast-site-header-cart .widget_shopping_cart a.remove:hover' => array( + 'color' => esc_attr( $link_color ), + ), + ); + + $css_output = array_merge( $css_output, $compat_css_desktop ); + } + + if ( Astra_Builder_Helper::apply_flex_based_css() ) { + $css_output['.woocommerce[class*="rel-up-columns-"] .site-main div.product .related.products ul.products li.product, .woocommerce-page .site-main ul.products li.product'] = array( + 'width' => '100%', + ); + } + + if ( false === Astra_Icons::is_svg_icons() ) { + $css_output['.woocommerce ul.product-categories > li ul li:before'] = array( + 'content' => '"\e900"', + 'padding' => '0 5px 0 5px', + 'display' => 'inline-block', + 'font-family' => 'Astra', + 'transform' => 'rotate(-90deg)', + 'font-size' => '11px', + 'font-size' => '0.7rem', + ); + } else { + $css_output['.woocommerce ul.product-categories > li ul li'] = array( + 'position' => 'relative', + ); + if ( $is_site_rtl ) { + $css_output['.woocommerce ul.product-categories > li ul li:before'] = array( + 'content' => '""', + 'border-width' => '1px 0 0 1px', + 'border-style' => 'solid', + 'display' => 'inline-block', + 'width' => '6px', + 'height' => '6px', + 'position' => 'absolute', + 'top' => '50%', + 'margin-top' => '-2px', + '-webkit-transform' => 'rotate(45deg)', + 'transform' => 'rotate(45deg)', + ); + $css_output['.woocommerce ul.product-categories > li ul li a'] = array( + 'margin-right' => '15px', + ); + } else { + $css_output['.woocommerce ul.product-categories > li ul li:before'] = array( + 'content' => '""', + 'border-width' => '1px 1px 0 0', + 'border-style' => 'solid', + 'display' => 'inline-block', + 'width' => '6px', + 'height' => '6px', + 'position' => 'absolute', + 'top' => '50%', + 'margin-top' => '-2px', + '-webkit-transform' => 'rotate(45deg)', + 'transform' => 'rotate(45deg)', + ); + $css_output['.woocommerce ul.product-categories > li ul li a'] = array( + 'margin-left' => '15px', + ); + } + } + + /* Parse WooCommerce General CSS from array() */ + $css_output = astra_parse_css( $css_output ); + + if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { + $tablet_css_shop_page_grid = array( + '.woocommerce.tablet-columns-6 ul.products li.product, .woocommerce-page.tablet-columns-6 ul.products li.product' => array( + 'width' => '12.7%', + 'width' => 'calc(16.66% - 16.66px)', + ), + '.woocommerce.tablet-columns-5 ul.products li.product, .woocommerce-page.tablet-columns-5 ul.products li.product' => array( + 'width' => '16.2%', + 'width' => 'calc(20% - 16px)', + ), + '.woocommerce.tablet-columns-4 ul.products li.product, .woocommerce-page.tablet-columns-4 ul.products li.product' => array( + 'width' => '21.5%', + 'width' => 'calc(25% - 15px)', + ), + '.woocommerce.tablet-columns-3 ul.products li.product, .woocommerce-page.tablet-columns-3 ul.products li.product' => array( + 'width' => '30.2%', + 'width' => 'calc(33.33% - 14px)', + ), + '.woocommerce.tablet-columns-2 ul.products li.product, .woocommerce-page.tablet-columns-2 ul.products li.product' => array( + 'width' => '47.6%', + 'width' => 'calc(50% - 10px)', + ), + '.woocommerce.tablet-columns-1 ul.products li.product, .woocommerce-page.tablet-columns-1 ul.products li.product' => array( + 'width' => '100%', + ), + '.woocommerce div.product .related.products ul.products li.product' => array( + 'width' => '30.2%', + 'width' => 'calc(33.33% - 14px)', + ), + ); + + } else { + $archive_tablet_grid = $this->get_grid_column_count( 'archive', 'tablet' ); + + $tablet_css_shop_page_grid = array( + '.woocommerce.tablet-columns-' . $archive_tablet_grid . ' ul.products li.product, .woocommerce-page.tablet-columns-' . $archive_tablet_grid . ' ul.products' => array( + 'grid-template-columns' => 'repeat(' . $archive_tablet_grid . ', minmax(0, 1fr))', + ), + ); + } + $css_output .= astra_parse_css( $tablet_css_shop_page_grid, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() ); + + if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { + if ( $is_site_rtl ) { + $tablet_shop_page_grid_lang_direction_css = array( + '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array( + 'width' => '30.2%', + 'width' => 'calc(33.33% - 14px)', + 'margin-left' => '20px', + ), + '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n)' => array( + 'margin-left' => 0, + 'clear' => 'left', + ), + '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n+1)' => array( + 'clear' => 'right', + ), + '.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)' => array( + 'margin-left' => '20px', + 'clear' => 'none', + ), + '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n)' => array( + 'margin-left' => '0', + 'clear' => 'left', + ), + '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n+1)' => array( + 'clear' => 'right', + ), + '.woocommerce div.product .related.products ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-1 .site-main ul.products li.product' => array( + 'margin-left' => 0, + 'clear' => 'left', + ), + '.woocommerce div.product .related.products ul.products li.product:nth-child(3n+1)' => array( + 'clear' => 'right', + ), + ); + } else { + $tablet_shop_page_grid_lang_direction_css = array( + '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array( + 'width' => '30.2%', + 'width' => 'calc(33.33% - 14px)', + 'margin-right' => '20px', + ), + '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n)' => array( + 'margin-right' => 0, + 'clear' => 'right', + ), + '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n+1)' => array( + 'clear' => 'left', + ), + '.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)' => array( + 'margin-right' => '20px', + 'clear' => 'none', + ), + '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n)' => array( + 'margin-right' => '0', + 'clear' => 'right', + ), + '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n+1)' => array( + 'clear' => 'left', + ), + '.woocommerce div.product .related.products ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-1 .site-main ul.products li.product' => array( + 'margin-right' => 0, + 'clear' => 'right', + ), + '.woocommerce div.product .related.products ul.products li.product:nth-child(3n+1)' => array( + 'clear' => 'left', + ), + ); + } + $css_output .= astra_parse_css( $tablet_shop_page_grid_lang_direction_css, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() ); + } + + /** + * Global button CSS - Tablet = min-wdth: (tablet + 1)px + */ + if ( $is_site_rtl ) { + $min_tablet_css = array( + '.woocommerce #reviews #comments' => array( + 'width' => '55%', + 'float' => 'right', + ), + '.woocommerce #reviews #review_form_wrapper' => array( + 'width' => '45%', + 'float' => 'left', + 'padding-right' => '2em', + ), + '.woocommerce form.checkout_coupon' => array( + 'width' => '50%', + ), + ); + if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { + $min_tablet_css['.woocommerce #reviews #comments']['float'] = 'right'; + $min_tablet_css['.woocommerce #reviews #review_form_wrapper']['float'] = 'left'; + } + } else { + $min_tablet_css = array( + '.woocommerce #reviews #comments' => array( + 'width' => '55%', + ), + '.woocommerce #reviews #review_form_wrapper' => array( + 'width' => '45%', + 'padding-left' => '2em', + ), + '.woocommerce form.checkout_coupon' => array( + 'width' => '50%', + ), + ); + + if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { + $min_tablet_css['.woocommerce #reviews #comments']['float'] = 'left'; + $min_tablet_css['.woocommerce #reviews #review_form_wrapper']['float'] = 'right'; + } + } + + $css_output .= astra_parse_css( $min_tablet_css, astra_get_tablet_breakpoint( '', 1 ) ); + + /** + * Global button CSS - Tablet = max-width: (tab-breakpoint)px. + */ + $css_global_button_tablet = array( + '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart, .ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart' => array( + 'padding-right' => 0, + 'padding-left' => 0, + ), + '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .main-header-bar' => array( + 'text-align' => 'center', + ), + '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-site-header-cart, .ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-mobile-menu-buttons' => array( + 'display' => 'inline-block', + ), + '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-2.ast-mobile-header-inline .site-branding' => array( + 'flex' => 'auto', + ), + '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .site-branding' => array( + 'flex' => '0 0 100%', + ), + '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .main-header-container' => array( + 'display' => 'flex', + 'justify-content' => 'center', + ), + '.woocommerce-cart .woocommerce-shipping-calculator .button' => array( + 'width' => '100%', + ), + '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce-cart table.cart td.actions .button, .woocommerce form.checkout_coupon .button, .woocommerce #respond input#submit, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), + ), + '.woocommerce div.product div.images, .woocommerce div.product div.summary, .woocommerce #content div.product div.images, .woocommerce #content div.product div.summary, .woocommerce-page div.product div.images, .woocommerce-page div.product div.summary, .woocommerce-page #content div.product div.images, .woocommerce-page #content div.product div.summary' => array( + 'float' => 'none', + 'width' => '100%', + ), + '.woocommerce-cart table.cart td.actions .ast-return-to-shop' => array( + 'display' => 'block', + 'text-align' => 'center', + 'margin-top' => '1em', + ), + ); + + if ( Astra_Builder_Helper::apply_flex_based_css() ) { + $css_global_button_tablet['.woocommerce ul.products, .woocommerce-page ul.products'] = array( + 'grid-template-columns' => 'repeat(3, minmax(0, 1fr))', + ); + + if ( is_shop() || is_product_taxonomy() ) { + + $archive_tablet_grid = $this->get_grid_column_count( 'archive', 'tablet' ); + + $css_global_button_tablet[ '.woocommerce.tablet-columns-' . $archive_tablet_grid . ' ul.products' ] = array( + 'grid-template-columns' => 'repeat(' . $archive_tablet_grid . ', minmax(0, 1fr))', + ); + $css_global_button_tablet['.woocommerce[class*="tablet-columns-"] .site-main div.product .related.products ul.products li.product'] = array( + 'width' => '100%', + ); + } + + if ( is_product() ) { + + $single_tablet_grid = $this->get_grid_column_count( 'single', 'tablet' ); + + $css_global_button_tablet[ '.woocommerce.tablet-rel-up-columns-' . $single_tablet_grid . ' ul.products' ] = array( + 'grid-template-columns' => 'repeat(' . $single_tablet_grid . ', minmax(0, 1fr))', + ); + $css_global_button_tablet['.woocommerce[class*="tablet-rel-up-columns-"] .site-main div.product .related.products ul.products li.product'] = array( + 'width' => '100%', + ); + } + } + + $css_output .= astra_parse_css( $css_global_button_tablet, '', astra_get_tablet_breakpoint() ); + + /** + * Global button CSS - Mobile = max-width: (mobile-breakpoint)px. + */ + $css_global_button_mobile = array( + '.ast-separate-container .ast-woocommerce-container' => array( + 'padding' => '.54em 1em 1.33333em', + ), + '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce-cart table.cart td.actions .button, .woocommerce form.checkout_coupon .button, .woocommerce #respond input#submit, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), + ), + '.woocommerce-message, .woocommerce-error, .woocommerce-info' => array( + 'display' => 'flex', + 'flex-wrap' => 'wrap', + ), + '.woocommerce-message a.button, .woocommerce-error a.button, .woocommerce-info a.button' => array( + 'order' => '1', + 'margin-top' => '.5em', + ), + + '.woocommerce .woocommerce-ordering, .woocommerce-page .woocommerce-ordering' => array( + 'float' => 'none', + 'margin-bottom' => '2em', + 'width' => '100%', + ), + '.woocommerce ul.products a.button, .woocommerce-page ul.products a.button' => array( + 'padding' => '0.5em 0.75em', + ), + '.woocommerce table.cart td.actions .button, .woocommerce #content table.cart td.actions .button, .woocommerce-page table.cart td.actions .button, .woocommerce-page #content table.cart td.actions .button' => array( + 'padding-left' => '1em', + 'padding-right' => '1em', + ), + '.woocommerce #content table.cart .button, .woocommerce-page #content table.cart .button' => array( + 'width' => '100%', + ), + '.woocommerce #content table.cart .product-thumbnail, .woocommerce-page #content table.cart .product-thumbnail' => array( + 'display' => 'block', + 'text-align' => 'center !important', + ), + '.woocommerce #content table.cart .product-thumbnail::before, .woocommerce-page #content table.cart .product-thumbnail::before' => array( + 'display' => 'none', + ), + '.woocommerce #content table.cart td.actions .coupon, .woocommerce-page #content table.cart td.actions .coupon' => array( + 'float' => 'none', + ), + '.woocommerce #content table.cart td.actions .coupon .button, .woocommerce-page #content table.cart td.actions .coupon .button' => array( + 'flex' => '1', + ), + '.woocommerce #content div.product .woocommerce-tabs ul.tabs li a, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li a' => array( + 'display' => 'block', + ), + ); + + if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { + $css_global_button_mobile['.woocommerce div.product .related.products ul.products li.product, .woocommerce.mobile-columns-2 ul.products li.product, .woocommerce-page.mobile-columns-2 ul.products li.product'] = array( + 'width' => '46.1%', + 'width' => 'calc(50% - 10px)', + ); + $css_global_button_mobile['.woocommerce.mobile-columns-6 ul.products li.product, .woocommerce-page.mobile-columns-6 ul.products li.product'] = array( + 'width' => '10.2%', + 'width' => 'calc(16.66% - 16.66px)', + ); + $css_global_button_mobile['.woocommerce.mobile-columns-5 ul.products li.product, .woocommerce-page.mobile-columns-5 ul.products li.product'] = array( + 'width' => '13%', + 'width' => 'calc(20% - 16px)', + ); + $css_global_button_mobile['.woocommerce.mobile-columns-4 ul.products li.product, .woocommerce-page.mobile-columns-4 ul.products li.product'] = array( + 'width' => '19%', + 'width' => 'calc(25% - 15px)', + ); + $css_global_button_mobile['.woocommerce.mobile-columns-3 ul.products li.product, .woocommerce-page.mobile-columns-3 ul.products li.product'] = array( + 'width' => '28.2%', + 'width' => 'calc(33.33% - 14px)', + ); + $css_global_button_mobile['.woocommerce.mobile-columns-1 ul.products li.product, .woocommerce-page.mobile-columns-1 ul.products li.product'] = array( + 'width' => '100%', + ); + } else { + + $archive_mobile_grid = $this->get_grid_column_count( 'archive', 'mobile' ); + $single_mobile_grid = $this->get_grid_column_count( 'single', 'mobile' ); + + $css_global_button_mobile[ '.woocommerce ul.products, .woocommerce-page ul.products, .woocommerce.mobile-columns-' . $archive_mobile_grid . ' ul.products, .woocommerce-page.mobile-columns-' . $archive_mobile_grid . ' ul.products' ] = array( + 'grid-template-columns' => 'repeat(' . $archive_mobile_grid . ', minmax(0, 1fr))', + ); + $css_global_button_mobile[ '.woocommerce.mobile-rel-up-columns-' . $single_mobile_grid . ' ul.products' ] = array( + 'grid-template-columns' => 'repeat(' . $single_mobile_grid . ', minmax(0, 1fr))', + ); + } + + $css_output .= astra_parse_css( $css_global_button_mobile, '', astra_get_mobile_breakpoint() ); + + if ( $is_site_rtl ) { + $global_button_mobile_lang_direction_css = array( + '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array( + 'width' => '46.1%', + 'width' => 'calc(50% - 10px)', + 'margin-left' => '20px', + ), + '.woocommerce ul.products a.button.loading::after, .woocommerce-page ul.products a.button.loading::after' => array( + 'display' => 'inline-block', + 'margin-right' => '5px', + 'position' => 'initial', + ), + '.woocommerce.mobile-columns-1 .site-main ul.products li.product:nth-child(n), .woocommerce-page.mobile-columns-1 .site-main ul.products li.product:nth-child(n)' => array( + 'margin-left' => 0, + ), + '.woocommerce #content div.product .woocommerce-tabs ul.tabs li, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li' => array( + 'display' => 'block', + 'margin-left' => 0, + ), + ); + + if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { + $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)'] = array( + 'margin-left' => '20px', + 'clear' => 'none', + ); + $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-6>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-6>ul.products li.product:nth-child(2n)'] = array( + 'margin-left' => 0, + 'clear' => 'left', + ); + $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(2n+1)'] = array( + 'clear' => 'right', + ); + $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-] ul.products li.product:nth-child(n), .woocommerce[class*=columns-] ul.products li.product:nth-child(n)'] = array( + 'margin-left' => '20px', + 'clear' => 'none', + ); + $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce div.product .related.products ul.products li.product:nth-child(2n)'] = array( + 'margin-left' => 0, + 'clear' => 'left', + ); + $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce div.product .related.products ul.products li.product:nth-child(2n+1)'] = array( + 'clear' => 'right', + ); + } + } else { + $global_button_mobile_lang_direction_css = array( + '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array( + 'width' => '46.1%', + 'width' => 'calc(50% - 10px)', + 'margin-right' => '20px', + ), + '.woocommerce ul.products a.button.loading::after, .woocommerce-page ul.products a.button.loading::after' => array( + 'display' => 'inline-block', + 'margin-left' => '5px', + 'position' => 'initial', + ), + '.woocommerce.mobile-columns-1 .site-main ul.products li.product:nth-child(n), .woocommerce-page.mobile-columns-1 .site-main ul.products li.product:nth-child(n)' => array( + 'margin-right' => 0, + ), + '.woocommerce #content div.product .woocommerce-tabs ul.tabs li, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li' => array( + 'display' => 'block', + 'margin-right' => 0, + ), + ); + + if ( ! Astra_Builder_Helper::apply_flex_based_css() ) { + $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)'] = array( + 'margin-right' => '20px', + 'clear' => 'none', + ); + $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-6>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-6>ul.products li.product:nth-child(2n)'] = array( + 'margin-right' => 0, + 'clear' => 'right', + ); + $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(2n+1)'] = array( + 'clear' => 'left', + ); + $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-] ul.products li.product:nth-child(n), .woocommerce[class*=columns-] ul.products li.product:nth-child(n)'] = array( + 'margin-right' => '20px', + 'clear' => 'none', + ); + $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce div.product .related.products ul.products li.product:nth-child(2n)'] = array( + 'margin-right' => 0, + 'clear' => 'right', + ); + $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce div.product .related.products ul.products li.product:nth-child(2n+1)'] = array( + 'clear' => 'left', + ); + } + } + + $css_output .= astra_parse_css( $global_button_mobile_lang_direction_css, '', astra_get_mobile_breakpoint() ); + + if ( 'page-builder' !== astra_get_content_layout() ) { + /* Woocommerce Shop Archive width */ + if ( 'custom' === $woo_shop_archive_width ) : + // Woocommerce shop archive custom width. + $site_width = array( + '.ast-woo-shop-archive .site-content > .ast-container' => array( + 'max-width' => astra_get_css_value( $woo_shop_archive_max_width, 'px' ), + ), + ); + $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) ); + + else : + // Woocommerce shop archive default width. + $site_width = array( + '.ast-woo-shop-archive .site-content > .ast-container' => array( + 'max-width' => astra_get_css_value( $site_content_width + 40, 'px' ), + ), + ); + + /* Parse CSS from array()*/ + $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) ); + endif; + } + + $woo_product_css = array( + '.woocommerce #content .ast-woocommerce-container div.product div.images, .woocommerce .ast-woocommerce-container div.product div.images, .woocommerce-page #content .ast-woocommerce-container div.product div.images, .woocommerce-page .ast-woocommerce-container div.product div.images' => array( + 'width' => '50%', + ), + '.woocommerce #content .ast-woocommerce-container div.product div.summary, .woocommerce .ast-woocommerce-container div.product div.summary, .woocommerce-page #content .ast-woocommerce-container div.product div.summary, .woocommerce-page .ast-woocommerce-container div.product div.summary' => array( + 'width' => '46%', + ), + '.woocommerce.woocommerce-checkout form #customer_details.col2-set .col-1, .woocommerce.woocommerce-checkout form #customer_details.col2-set .col-2, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set .col-1, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set .col-2' => array( + 'float' => 'none', + 'width' => 'auto', + ), + ); + + /* Parse CSS from array()*/ + $css_output .= astra_parse_css( $woo_product_css, astra_get_tablet_breakpoint( '', 1 ) ); + + /* + * global button settings not working for woocommerce button on shop and single page. + * check if the current user is existing user or new user. + * if new user load the CSS bty default if existing provide a filter + */ + if ( self::astra_global_btn_woo_comp() ) { + + $woo_global_button_css = array( + '.woocommerce a.button , .woocommerce button.button.alt ,.woocommerce-page table.cart td.actions .button, .woocommerce-page #content table.cart td.actions .button , .woocommerce a.button.alt ,.woocommerce .woocommerce-message a.button , .ast-site-header-cart .widget_shopping_cart .buttons .button.checkout, .woocommerce button.button.alt.disabled , .wc-block-grid__products .wc-block-grid__product .wp-block-button__link ' => array( + 'border' => 'solid', + 'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '0', + 'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '0', + 'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '0', + 'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '0', + 'border-color' => $btn_border_color ? $btn_border_color : $btn_bg_color, + ), + '.woocommerce a.button:hover , .woocommerce button.button.alt:hover , .woocommerce-page table.cart td.actions .button:hover, .woocommerce-page #content table.cart td.actions .button:hover, .woocommerce a.button.alt:hover ,.woocommerce .woocommerce-message a.button:hover , .ast-site-header-cart .widget_shopping_cart .buttons .button.checkout:hover , .woocommerce button.button.alt.disabled:hover , .wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array( + 'border-color' => $btn_border_h_color ? $btn_border_h_color : $btn_bg_h_color, + ), + ); + + $css_output .= astra_parse_css( $woo_global_button_css ); + } + + if ( ! is_shop() && ! is_product() ) { + + $css_output .= astra_parse_css( + array( + '.widget_product_search button' => array( + 'flex' => '0 0 auto', + 'padding' => '10px 20px;', + ), + ) + ); + } + + if ( $is_site_rtl ) { + $woo_product_lang_direction_css = array( + '.woocommerce.woocommerce-checkout form #customer_details.col2-set, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set' => array( + 'width' => '55%', + 'float' => 'right', + 'margin-left' => '4.347826087%', + ), + '.woocommerce.woocommerce-checkout form #order_review, .woocommerce.woocommerce-checkout form #order_review_heading, .woocommerce-page.woocommerce-checkout form #order_review, .woocommerce-page.woocommerce-checkout form #order_review_heading' => array( + 'width' => '40%', + 'float' => 'left', + 'margin-left' => '0', + 'clear' => 'left', + ), + ); + } else { + $woo_product_lang_direction_css = array( + '.woocommerce.woocommerce-checkout form #customer_details.col2-set, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set' => array( + 'width' => '55%', + 'float' => 'left', + 'margin-right' => '4.347826087%', + ), + '.woocommerce.woocommerce-checkout form #order_review, .woocommerce.woocommerce-checkout form #order_review_heading, .woocommerce-page.woocommerce-checkout form #order_review, .woocommerce-page.woocommerce-checkout form #order_review_heading' => array( + 'width' => '40%', + 'float' => 'right', + 'margin-right' => '0', + 'clear' => 'right', + ), + ); + } + + /* Parse CSS from array()*/ + $css_output .= astra_parse_css( $woo_product_lang_direction_css, astra_get_tablet_breakpoint( '', 1 ) ); + + wp_add_inline_style( 'woocommerce-general', apply_filters( 'astra_theme_woocommerce_dynamic_css', $css_output ) ); + + /** + * YITH WooCommerce Wishlist Style + */ + $yith_wcwl_main_style = array( + '.yes-js.js_active .ast-plain-container.ast-single-post #primary' => array( + 'margin' => esc_attr( '4em 0' ), + ), + '.js_active .ast-plain-container.ast-single-post .entry-header' => array( + 'margin-top' => esc_attr( '0' ), + ), + '.woocommerce table.wishlist_table' => array( + 'font-size' => esc_attr( '100%' ), + ), + '.woocommerce table.wishlist_table tbody td.product-name' => array( + 'font-weight' => esc_attr( '700' ), + ), + '.woocommerce table.wishlist_table thead th' => array( + 'border-top' => esc_attr( '0' ), + ), + '.woocommerce table.wishlist_table tr td.product-remove' => array( + 'padding' => esc_attr( '.7em 1em' ), + ), + '.woocommerce table.wishlist_table tbody td' => array( + 'border-right' => esc_attr( '0' ), + ), + '.woocommerce .wishlist_table td.product-add-to-cart a' => array( + 'display' => esc_attr( 'inherit !important' ), + ), + '.wishlist_table tr td, .wishlist_table tr th.wishlist-delete, .wishlist_table tr th.product-checkbox' => array( + 'text-align' => esc_attr( 'left' ), + ), + '.woocommerce #content table.wishlist_table.cart a.remove' => array( + 'display' => esc_attr( 'inline-block' ), + 'vertical-align' => esc_attr( 'middle' ), + 'font-size' => esc_attr( '18px' ), + 'font-weight' => esc_attr( 'normal' ), + 'width' => esc_attr( '24px' ), + 'height' => esc_attr( '24px' ), + 'line-height' => esc_attr( '21px' ), + 'color' => esc_attr( '#ccc !important' ), + 'text-align' => esc_attr( 'center' ), + 'border' => esc_attr( '1px solid #ccc' ), + ), + '.woocommerce #content table.wishlist_table.cart a.remove:hover' => array( + 'color' => esc_attr( $link_color . '!important' ), + 'border-color' => esc_attr( $link_color ), + 'background-color' => esc_attr( '#ffffff' ), + ), + ); + /* Parse CSS from array() */ + $yith_wcwl_main_style = astra_parse_css( $yith_wcwl_main_style ); + + $yith_wcwl_main_style_small = array( + '.yes-js.js_active .ast-plain-container.ast-single-post #primary' => array( + 'padding' => esc_attr( '1.5em 0' ), + 'margin' => esc_attr( '0' ), + ), + ); + /* Parse CSS from array()*/ + $yith_wcwl_main_style .= astra_parse_css( $yith_wcwl_main_style_small, '', astra_get_tablet_breakpoint() ); + + wp_add_inline_style( 'yith-wcwl-main', $yith_wcwl_main_style ); + } + + /** + * Register Customizer sections and panel for woocommerce + * + * @since 1.0.0 + * @param WP_Customize_Manager $wp_customize Theme Customizer object. + */ + public function customize_register( $wp_customize ) { + + // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + /** + * Register Sections & Panels + */ + require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/class-astra-customizer-register-woo-section.php'; + + /** + * Sections + */ + require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-container-configs.php'; + require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php'; + require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php'; + require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php'; + require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php'; + // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + + } + + /** + * Add Cart icon markup + * + * @param String $output Markup. + * @param String $section Section name. + * @param String $section_type Section selected option. + * @return Markup String. + * + * @since 1.0.0 + */ + public function astra_header_cart( $output, $section, $section_type ) { + + if ( 'woocommerce' === $section_type && apply_filters( 'astra_woo_header_cart_icon', true ) ) { + + $output = $this->woo_mini_cart_markup(); + } + + return $output; + } + + /** + * Woocommerce mini cart markup markup + * + * @since 1.2.2 + * @return html + */ + public function woo_mini_cart_markup() { + + if ( is_cart() ) { + $class = 'current-menu-item'; + } else { + $class = ''; + } + + $cart_menu_classes = apply_filters( 'astra_cart_in_menu_class', array( 'ast-menu-cart-with-border' ) ); + + ob_start(); + if ( is_customize_preview() && true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + Astra_Builder_UI_Controller::render_customizer_edit_button(); + } + ?> +
    +
    + astra_get_cart_link(); ?> +
    +
    + +
    +
    + + + + +
    + + cart ) { + echo WC()->cart->get_cart_contents_count(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } + ?> + +
    + +
    + astra_get_cart_link(); + $fragments['a.cart-container'] = ob_get_clean(); + + return $fragments; + } + + /** + * For existing users, do not load the wide/full width image CSS by default. + * + * @since 2.5.0 + * @return boolean false if it is an existing user , true if not. + */ + public static function astra_global_btn_woo_comp() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['global-btn-woo-css'] = isset( $astra_settings['global-btn-woo-css'] ) ? false : true; + return apply_filters( 'astra_global_btn_woo_comp', $astra_settings['global-btn-woo-css'] ); + } + } + +endif; + +if ( apply_filters( 'astra_enable_woocommerce_integration', true ) ) { + Astra_Woocommerce::get_instance(); +} diff --git a/inc/compatibility/woocommerce/customizer/class-astra-customizer-register-woo-section.php b/inc/compatibility/woocommerce/customizer/class-astra-customizer-register-woo-section.php index e075ba1..fe6df52 100644 --- a/inc/compatibility/woocommerce/customizer/class-astra-customizer-register-woo-section.php +++ b/inc/compatibility/woocommerce/customizer/class-astra-customizer-register-woo-section.php @@ -1,74 +1,74 @@ - 'section-woo-general', - 'title' => __( 'General', 'astra' ), - 'type' => 'section', - 'priority' => 10, - 'panel' => 'woocommerce', - ), - array( - 'name' => 'section-woo-shop', - 'title' => __( 'Shop', 'astra' ), - 'type' => 'section', - 'priority' => 20, - 'panel' => 'woocommerce', - ), - - array( - 'name' => 'section-woo-shop-single', - 'type' => 'section', - 'title' => __( 'Single Product', 'astra' ), - 'priority' => 12, - 'panel' => 'woocommerce', - ), - - array( - 'name' => 'section-woo-shop-cart', - 'type' => 'section', - 'title' => __( 'Cart', 'astra' ), - 'priority' => 20, - 'panel' => 'woocommerce', - ), - ); - - return array_merge( $configurations, $configs ); - } - } -} - - -new Astra_Customizer_Register_Woo_Section(); + 'section-woo-general', + 'title' => __( 'General', 'astra' ), + 'type' => 'section', + 'priority' => 10, + 'panel' => 'woocommerce', + ), + array( + 'name' => 'section-woo-shop', + 'title' => __( 'Shop', 'astra' ), + 'type' => 'section', + 'priority' => 20, + 'panel' => 'woocommerce', + ), + + array( + 'name' => 'section-woo-shop-single', + 'type' => 'section', + 'title' => __( 'Single Product', 'astra' ), + 'priority' => 12, + 'panel' => 'woocommerce', + ), + + array( + 'name' => 'section-woo-shop-cart', + 'type' => 'section', + 'title' => __( 'Cart', 'astra' ), + 'priority' => 20, + 'panel' => 'woocommerce', + ), + ); + + return array_merge( $configurations, $configs ); + } + } +} + + +new Astra_Customizer_Register_Woo_Section(); diff --git a/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-container-configs.php b/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-container-configs.php index a24d642..f82ded9 100644 --- a/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-container-configs.php +++ b/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-container-configs.php @@ -1,64 +1,64 @@ - ASTRA_THEME_SETTINGS . '[woocommerce-content-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'default' => astra_get_option( 'woocommerce-content-layout' ), - 'section' => 'section-container-layout', - 'priority' => 85, - 'title' => __( 'WooCommerce Layout', 'astra' ), - 'divider' => array( 'ast_class' => 'ast-top-divider' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'boxed-container' => __( 'Boxed', 'astra' ), - 'content-boxed-container' => __( 'Content Boxed', 'astra' ), - 'plain-container' => __( 'Full Width / Contained', 'astra' ), - 'page-builder' => __( 'Full Width / Stretched', 'astra' ), - ), - ), - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Woo_Shop_Container_Configs(); - + ASTRA_THEME_SETTINGS . '[woocommerce-content-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'default' => astra_get_option( 'woocommerce-content-layout' ), + 'section' => 'section-container-layout', + 'priority' => 85, + 'title' => __( 'WooCommerce Layout', 'astra' ), + 'divider' => array( 'ast_class' => 'ast-top-divider' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'boxed-container' => __( 'Boxed', 'astra' ), + 'content-boxed-container' => __( 'Content Boxed', 'astra' ), + 'plain-container' => __( 'Full Width / Contained', 'astra' ), + 'page-builder' => __( 'Full Width / Stretched', 'astra' ), + ), + ), + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Woo_Shop_Container_Configs(); + diff --git a/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php b/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php index 6534163..57f7ded 100644 --- a/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php +++ b/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php @@ -1,84 +1,84 @@ - ASTRA_THEME_SETTINGS . '[woocommerce-sidebar-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-sidebars', - 'default' => astra_get_option( 'woocommerce-sidebar-layout' ), - 'priority' => 5, - 'title' => __( 'WooCommerce', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'no-sidebar' => __( 'No Sidebar', 'astra' ), - 'left-sidebar' => __( 'Left Sidebar', 'astra' ), - 'right-sidebar' => __( 'Right Sidebar', 'astra' ), - ), - ), - - /** - * Option: Single Product - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[single-product-sidebar-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'default' => astra_get_option( 'single-product-sidebar-layout' ), - 'section' => 'section-sidebars', - 'priority' => 5, - 'title' => __( 'Single Product', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'no-sidebar' => __( 'No Sidebar', 'astra' ), - 'left-sidebar' => __( 'Left Sidebar', 'astra' ), - 'right-sidebar' => __( 'Right Sidebar', 'astra' ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Woo_Shop_Sidebar_Configs(); - - - + ASTRA_THEME_SETTINGS . '[woocommerce-sidebar-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-sidebars', + 'default' => astra_get_option( 'woocommerce-sidebar-layout' ), + 'priority' => 5, + 'title' => __( 'WooCommerce', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'no-sidebar' => __( 'No Sidebar', 'astra' ), + 'left-sidebar' => __( 'Left Sidebar', 'astra' ), + 'right-sidebar' => __( 'Right Sidebar', 'astra' ), + ), + ), + + /** + * Option: Single Product + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[single-product-sidebar-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'default' => astra_get_option( 'single-product-sidebar-layout' ), + 'section' => 'section-sidebars', + 'priority' => 5, + 'title' => __( 'Single Product', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'no-sidebar' => __( 'No Sidebar', 'astra' ), + 'left-sidebar' => __( 'Left Sidebar', 'astra' ), + 'right-sidebar' => __( 'Right Sidebar', 'astra' ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Woo_Shop_Sidebar_Configs(); + + + diff --git a/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php index 6c36a4f..694eb17 100644 --- a/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php +++ b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php @@ -1,57 +1,57 @@ - ASTRA_THEME_SETTINGS . '[enable-cart-upsells]', - 'section' => 'section-woo-shop-cart', - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'default' => astra_get_option( 'enable-cart-upsells' ), - 'title' => __( 'Enable Cross-sells', 'astra' ), - 'priority' => 10, - ), - ); - - return array_merge( $configurations, $_configs ); - } - } -} - -new Astra_Woo_Shop_Cart_Layout_Configs(); + ASTRA_THEME_SETTINGS . '[enable-cart-upsells]', + 'section' => 'section-woo-shop-cart', + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'default' => astra_get_option( 'enable-cart-upsells' ), + 'title' => __( 'Enable Cross-sells', 'astra' ), + 'priority' => 10, + ), + ); + + return array_merge( $configurations, $_configs ); + } + } +} + +new Astra_Woo_Shop_Cart_Layout_Configs(); diff --git a/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php index 77a0981..c515172 100644 --- a/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php +++ b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php @@ -1,158 +1,158 @@ - ASTRA_THEME_SETTINGS . '[shop-grids]', - 'type' => 'control', - 'control' => 'ast-responsive-slider', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), - 'section' => 'woocommerce_product_catalog', - 'default' => astra_get_option( - 'shop-grids', - array( - 'desktop' => 4, - 'tablet' => 3, - 'mobile' => 2, - ) - ), - 'priority' => 11, - 'title' => __( 'Shop Columns', 'astra' ), - 'input_attrs' => array( - 'step' => 1, - 'min' => 1, - 'max' => 6, - ), - ), - - /** - * Option: Products Per Page - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[shop-no-of-products]', - 'type' => 'control', - 'section' => 'woocommerce_product_catalog', - 'title' => __( 'Products Per Page', 'astra' ), - 'default' => astra_get_option( 'shop-no-of-products' ), - 'control' => 'number', - 'priority' => 15, - 'input_attrs' => array( - 'min' => 1, - 'step' => 1, - 'max' => 100, - ), - ), - - /** - * Option: Single Post Meta - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[shop-product-structure]', - 'type' => 'control', - 'control' => 'ast-sortable', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), - 'section' => 'woocommerce_product_catalog', - 'default' => astra_get_option( 'shop-product-structure' ), - 'priority' => 15, - 'title' => __( 'Shop Product Structure', 'astra' ), - 'choices' => array( - 'title' => __( 'Title', 'astra' ), - 'price' => __( 'Price', 'astra' ), - 'ratings' => __( 'Ratings', 'astra' ), - 'short_desc' => __( 'Short Description', 'astra' ), - 'add_cart' => __( 'Add To Cart', 'astra' ), - 'category' => __( 'Category', 'astra' ), - ), - ), - - /** - * Option: Shop Archive Content Width - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[shop-archive-width]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'woocommerce_product_catalog', - 'default' => astra_get_option( 'shop-archive-width' ), - 'priority' => 10, - 'title' => __( 'Shop Archive Content Width', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'custom' => __( 'Custom', 'astra' ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Enter Width - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[shop-archive-max-width]', - 'type' => 'control', - 'control' => 'ast-slider', - 'section' => 'woocommerce_product_catalog', - 'default' => astra_get_option( 'shop-archive-max-width' ), - 'priority' => 10, - 'title' => __( 'Custom Width', 'astra' ), - 'transport' => 'postMessage', - 'suffix' => 'px', - 'input_attrs' => array( - 'min' => 768, - 'step' => 1, - 'max' => 1920, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[shop-archive-width]', - 'operator' => '===', - 'value' => 'custom', - ), - ), - ), - ); - - $configurations = array_merge( $configurations, $_configs ); - - return $configurations; - - } - } -} - -new Astra_Woo_Shop_Layout_Configs(); - + ASTRA_THEME_SETTINGS . '[shop-grids]', + 'type' => 'control', + 'control' => 'ast-responsive-slider', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), + 'section' => 'woocommerce_product_catalog', + 'default' => astra_get_option( + 'shop-grids', + array( + 'desktop' => 4, + 'tablet' => 3, + 'mobile' => 2, + ) + ), + 'priority' => 11, + 'title' => __( 'Shop Columns', 'astra' ), + 'input_attrs' => array( + 'step' => 1, + 'min' => 1, + 'max' => 6, + ), + ), + + /** + * Option: Products Per Page + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[shop-no-of-products]', + 'type' => 'control', + 'section' => 'woocommerce_product_catalog', + 'title' => __( 'Products Per Page', 'astra' ), + 'default' => astra_get_option( 'shop-no-of-products' ), + 'control' => 'number', + 'priority' => 15, + 'input_attrs' => array( + 'min' => 1, + 'step' => 1, + 'max' => 100, + ), + ), + + /** + * Option: Single Post Meta + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[shop-product-structure]', + 'type' => 'control', + 'control' => 'ast-sortable', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), + 'section' => 'woocommerce_product_catalog', + 'default' => astra_get_option( 'shop-product-structure' ), + 'priority' => 15, + 'title' => __( 'Shop Product Structure', 'astra' ), + 'choices' => array( + 'title' => __( 'Title', 'astra' ), + 'price' => __( 'Price', 'astra' ), + 'ratings' => __( 'Ratings', 'astra' ), + 'short_desc' => __( 'Short Description', 'astra' ), + 'add_cart' => __( 'Add To Cart', 'astra' ), + 'category' => __( 'Category', 'astra' ), + ), + ), + + /** + * Option: Shop Archive Content Width + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[shop-archive-width]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'woocommerce_product_catalog', + 'default' => astra_get_option( 'shop-archive-width' ), + 'priority' => 10, + 'title' => __( 'Shop Archive Content Width', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'custom' => __( 'Custom', 'astra' ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Enter Width + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[shop-archive-max-width]', + 'type' => 'control', + 'control' => 'ast-slider', + 'section' => 'woocommerce_product_catalog', + 'default' => astra_get_option( 'shop-archive-max-width' ), + 'priority' => 10, + 'title' => __( 'Custom Width', 'astra' ), + 'transport' => 'postMessage', + 'suffix' => 'px', + 'input_attrs' => array( + 'min' => 768, + 'step' => 1, + 'max' => 1920, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[shop-archive-width]', + 'operator' => '===', + 'value' => 'custom', + ), + ), + ), + ); + + $configurations = array_merge( $configurations, $_configs ); + + return $configurations; + + } + } +} + +new Astra_Woo_Shop_Layout_Configs(); + diff --git a/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php index 5a02370..ca1b1d3 100644 --- a/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php +++ b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php @@ -1,80 +1,80 @@ - ASTRA_THEME_SETTINGS . '[single-product-breadcrumb-disable]', - 'section' => 'section-woo-shop-single', - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'default' => astra_get_option( 'single-product-breadcrumb-disable' ), - 'title' => __( 'Disable Breadcrumb', 'astra' ), - 'priority' => 16, - ), - - /** - * Option: Disable Transparent Header on WooCommerce Product pages - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-woo-products]', - 'default' => astra_get_option( 'transparent-header-disable-woo-products' ), - 'type' => 'control', - 'section' => 'section-transparent-header', - 'title' => __( 'Disable on WooCommerce Product Pages?', 'astra' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', - 'operator' => '==', - 'value' => '1', - ), - ), - 'priority' => 26, - 'control' => 'ast-toggle-control', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - ); - - return array_merge( $configurations, $_configs ); - - } - } -} - -new Astra_Woo_Shop_Single_Layout_Configs(); - - + ASTRA_THEME_SETTINGS . '[single-product-breadcrumb-disable]', + 'section' => 'section-woo-shop-single', + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'default' => astra_get_option( 'single-product-breadcrumb-disable' ), + 'title' => __( 'Disable Breadcrumb', 'astra' ), + 'priority' => 16, + ), + + /** + * Option: Disable Transparent Header on WooCommerce Product pages + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-woo-products]', + 'default' => astra_get_option( 'transparent-header-disable-woo-products' ), + 'type' => 'control', + 'section' => 'section-transparent-header', + 'title' => __( 'Disable on WooCommerce Product Pages?', 'astra' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]', + 'operator' => '==', + 'value' => '1', + ), + ), + 'priority' => 26, + 'control' => 'ast-toggle-control', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + ); + + return array_merge( $configurations, $_configs ); + + } + } +} + +new Astra_Woo_Shop_Single_Layout_Configs(); + + diff --git a/inc/compatibility/woocommerce/woocommerce-common-functions.php b/inc/compatibility/woocommerce/woocommerce-common-functions.php index 4921337..1a0995a 100644 --- a/inc/compatibility/woocommerce/woocommerce-common-functions.php +++ b/inc/compatibility/woocommerce/woocommerce-common-functions.php @@ -1,299 +1,299 @@ -'; - - echo '

    ' . esc_html( get_the_title() ) . '

    '; - - echo ''; - } - -endif; - -/** - * Shop page - Parent Category - */ -if ( ! function_exists( 'astra_woo_shop_parent_category' ) ) : - /** - * Add and/or Remove Categories from shop archive page. - * - * @hooked woocommerce_after_shop_loop_item - 9 - * - * @since 1.1.0 - */ - function astra_woo_shop_parent_category() { - if ( apply_filters( 'astra_woo_shop_parent_category', true ) ) : ?> - - get_categories( ';', '', '' ); - - $product_categories = htmlspecialchars_decode( wp_strip_all_tags( $product_categories ) ); - if ( $product_categories ) { - list( $parent_cat ) = explode( ';', $product_categories ); - echo apply_filters( 'astra_woo_shop_product_categories', esc_html( $parent_cat ), get_the_ID() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - - ?> - - - - - -
    - -
    - - get_availability(); - $stock_quantity = $product->get_stock_quantity(); - $availability = $product_avail['availability']; - $avail_class = $product_avail['class']; - if ( ! empty( $availability ) && $stock_quantity ) { - ob_start(); - ?> -

    - - -

    - '; - woocommerce_template_loop_product_title(); - echo ''; - } -} - -if ( ! function_exists( 'astra_woo_woocommerce_shop_product_content' ) ) { - - /** - * Show the product title in the product loop. By default this is an H2. - */ - function astra_woo_woocommerce_shop_product_content() { - - $shop_structure = apply_filters( 'astra_woo_shop_product_structure', astra_get_option( 'shop-product-structure' ) ); - if ( is_array( $shop_structure ) && ! empty( $shop_structure ) ) { - - do_action( 'astra_woo_shop_before_summary_wrap' ); - echo '
    '; - do_action( 'astra_woo_shop_summary_wrap_top' ); - - foreach ( $shop_structure as $value ) { - - switch ( $value ) { - case 'title': - /** - * Add Product Title on shop page for all products. - */ - do_action( 'astra_woo_shop_title_before' ); - astra_woo_woocommerce_template_loop_product_title(); - do_action( 'astra_woo_shop_title_after' ); - break; - case 'price': - /** - * Add Product Price on shop page for all products. - */ - do_action( 'astra_woo_shop_price_before' ); - woocommerce_template_loop_price(); - do_action( 'astra_woo_shop_price_after' ); - break; - case 'ratings': - /** - * Add rating on shop page for all products. - */ - do_action( 'astra_woo_shop_rating_before' ); - woocommerce_template_loop_rating(); - do_action( 'astra_woo_shop_rating_after' ); - break; - case 'short_desc': - do_action( 'astra_woo_shop_short_description_before' ); - astra_woo_shop_product_short_description(); - do_action( 'astra_woo_shop_short_description_after' ); - break; - case 'add_cart': - do_action( 'astra_woo_shop_add_to_cart_before' ); - woocommerce_template_loop_add_to_cart(); - do_action( 'astra_woo_shop_add_to_cart_after' ); - break; - case 'category': - /** - * Add and/or Remove Categories from shop archive page. - */ - do_action( 'astra_woo_shop_category_before' ); - astra_woo_shop_parent_category(); - do_action( 'astra_woo_shop_category_after' ); - break; - default: - break; - } - } - - do_action( 'astra_woo_shop_summary_wrap_bottom' ); - echo '
    '; - do_action( 'astra_woo_shop_after_summary_wrap' ); - } - } -} - -if ( ! function_exists( 'astra_woo_shop_thumbnail_wrap_start' ) ) { - - /** - * Thumbnail wrap start. - */ - function astra_woo_shop_thumbnail_wrap_start() { - - echo '
    '; - } -} - -if ( ! function_exists( 'astra_woo_shop_thumbnail_wrap_end' ) ) { - - /** - * Thumbnail wrap end. - */ - function astra_woo_shop_thumbnail_wrap_end() { - - echo '
    '; - } -} - - -/** - * Woocommerce filter - Widget Products Tags - */ -if ( ! function_exists( 'astra_widget_product_tag_cloud_args' ) ) { - - /** - * Woocommerce filter - Widget Products Tags - * - * @param array $args Tag arguments. - * @return array Modified tag arguments. - */ - function astra_widget_product_tag_cloud_args( $args = array() ) { - - $sidebar_link_font_size = astra_get_option( 'font-size-body' ); - $sidebar_link_font_size['desktop'] = ( '' != $sidebar_link_font_size['desktop'] ) ? $sidebar_link_font_size['desktop'] : 15; - - $args['smallest'] = intval( $sidebar_link_font_size['desktop'] ) - 2; - $args['largest'] = intval( $sidebar_link_font_size['desktop'] ) + 3; - $args['unit'] = 'px'; - - return apply_filters( 'astra_widget_product_tag_cloud_args', $args ); - } - add_filter( 'woocommerce_product_tag_cloud_widget_args', 'astra_widget_product_tag_cloud_args', 90 ); - -} - -/** - * Woocommerce shop/product div close tag. - */ -if ( ! function_exists( 'astra_woocommerce_div_wrapper_close' ) ) : - - /** - * Woocommerce shop/product div close tag. - * - * @return void - */ - function astra_woocommerce_div_wrapper_close() { - - echo ''; - - } - -endif; +'; + + echo '

    ' . esc_html( get_the_title() ) . '

    '; + + echo ''; + } + +endif; + +/** + * Shop page - Parent Category + */ +if ( ! function_exists( 'astra_woo_shop_parent_category' ) ) : + /** + * Add and/or Remove Categories from shop archive page. + * + * @hooked woocommerce_after_shop_loop_item - 9 + * + * @since 1.1.0 + */ + function astra_woo_shop_parent_category() { + if ( apply_filters( 'astra_woo_shop_parent_category', true ) ) : ?> + + get_categories( ';', '', '' ); + + $product_categories = htmlspecialchars_decode( wp_strip_all_tags( $product_categories ) ); + if ( $product_categories ) { + list( $parent_cat ) = explode( ';', $product_categories ); + echo apply_filters( 'astra_woo_shop_product_categories', esc_html( $parent_cat ), get_the_ID() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } + + ?> + + + + + +
    + +
    + + get_availability(); + $stock_quantity = $product->get_stock_quantity(); + $availability = $product_avail['availability']; + $avail_class = $product_avail['class']; + if ( ! empty( $availability ) && $stock_quantity ) { + ob_start(); + ?> +

    + + +

    + '; + woocommerce_template_loop_product_title(); + echo ''; + } +} + +if ( ! function_exists( 'astra_woo_woocommerce_shop_product_content' ) ) { + + /** + * Show the product title in the product loop. By default this is an H2. + */ + function astra_woo_woocommerce_shop_product_content() { + + $shop_structure = apply_filters( 'astra_woo_shop_product_structure', astra_get_option( 'shop-product-structure' ) ); + if ( is_array( $shop_structure ) && ! empty( $shop_structure ) ) { + + do_action( 'astra_woo_shop_before_summary_wrap' ); + echo '
    '; + do_action( 'astra_woo_shop_summary_wrap_top' ); + + foreach ( $shop_structure as $value ) { + + switch ( $value ) { + case 'title': + /** + * Add Product Title on shop page for all products. + */ + do_action( 'astra_woo_shop_title_before' ); + astra_woo_woocommerce_template_loop_product_title(); + do_action( 'astra_woo_shop_title_after' ); + break; + case 'price': + /** + * Add Product Price on shop page for all products. + */ + do_action( 'astra_woo_shop_price_before' ); + woocommerce_template_loop_price(); + do_action( 'astra_woo_shop_price_after' ); + break; + case 'ratings': + /** + * Add rating on shop page for all products. + */ + do_action( 'astra_woo_shop_rating_before' ); + woocommerce_template_loop_rating(); + do_action( 'astra_woo_shop_rating_after' ); + break; + case 'short_desc': + do_action( 'astra_woo_shop_short_description_before' ); + astra_woo_shop_product_short_description(); + do_action( 'astra_woo_shop_short_description_after' ); + break; + case 'add_cart': + do_action( 'astra_woo_shop_add_to_cart_before' ); + woocommerce_template_loop_add_to_cart(); + do_action( 'astra_woo_shop_add_to_cart_after' ); + break; + case 'category': + /** + * Add and/or Remove Categories from shop archive page. + */ + do_action( 'astra_woo_shop_category_before' ); + astra_woo_shop_parent_category(); + do_action( 'astra_woo_shop_category_after' ); + break; + default: + break; + } + } + + do_action( 'astra_woo_shop_summary_wrap_bottom' ); + echo '
    '; + do_action( 'astra_woo_shop_after_summary_wrap' ); + } + } +} + +if ( ! function_exists( 'astra_woo_shop_thumbnail_wrap_start' ) ) { + + /** + * Thumbnail wrap start. + */ + function astra_woo_shop_thumbnail_wrap_start() { + + echo '
    '; + } +} + +if ( ! function_exists( 'astra_woo_shop_thumbnail_wrap_end' ) ) { + + /** + * Thumbnail wrap end. + */ + function astra_woo_shop_thumbnail_wrap_end() { + + echo '
    '; + } +} + + +/** + * Woocommerce filter - Widget Products Tags + */ +if ( ! function_exists( 'astra_widget_product_tag_cloud_args' ) ) { + + /** + * Woocommerce filter - Widget Products Tags + * + * @param array $args Tag arguments. + * @return array Modified tag arguments. + */ + function astra_widget_product_tag_cloud_args( $args = array() ) { + + $sidebar_link_font_size = astra_get_option( 'font-size-body' ); + $sidebar_link_font_size['desktop'] = ( '' != $sidebar_link_font_size['desktop'] ) ? $sidebar_link_font_size['desktop'] : 15; + + $args['smallest'] = intval( $sidebar_link_font_size['desktop'] ) - 2; + $args['largest'] = intval( $sidebar_link_font_size['desktop'] ) + 3; + $args['unit'] = 'px'; + + return apply_filters( 'astra_widget_product_tag_cloud_args', $args ); + } + add_filter( 'woocommerce_product_tag_cloud_widget_args', 'astra_widget_product_tag_cloud_args', 90 ); + +} + +/** + * Woocommerce shop/product div close tag. + */ +if ( ! function_exists( 'astra_woocommerce_div_wrapper_close' ) ) : + + /** + * Woocommerce shop/product div close tag. + * + * @return void + */ + function astra_woocommerce_div_wrapper_close() { + + echo ''; + + } + +endif; diff --git a/inc/core/builder/class-astra-builder-options.php b/inc/core/builder/class-astra-builder-options.php index 4046448..f0cfc32 100644 --- a/inc/core/builder/class-astra-builder-options.php +++ b/inc/core/builder/class-astra-builder-options.php @@ -1045,7 +1045,7 @@ function prepare_button_defaults( $defaults, $index ) { $defaults[ 'header-' . $_prefix . '-text' ] = __( 'Button', 'astra' ); $defaults[ 'header-' . $_prefix . '-link-option' ] = array( - 'url' => apply_filters( 'astra_site_url', 'https://www.wpastra.com' ), + 'url' => apply_filters( 'astra_site_url', 'https://www.adelielinux.org/' ), 'new_tab' => false, 'link_rel' => '', ); @@ -1126,7 +1126,7 @@ function prepare_button_defaults( $defaults, $index ) { $defaults[ 'footer-' . $_prefix . '-text' ] = __( 'Button', 'astra' ); $defaults[ 'footer-' . $_prefix . '-link-option' ] = array( - 'url' => apply_filters( 'astra_site_url', 'https://www.wpastra.com' ), + 'url' => apply_filters( 'astra_site_url', 'https://www.adelielinux.org/' ), 'new_tab' => false, 'link_rel' => '', ); diff --git a/inc/core/class-astra-admin-helper.php b/inc/core/class-astra-admin-helper.php index ea35e7d..1763fff 100644 --- a/inc/core/class-astra-admin-helper.php +++ b/inc/core/class-astra-admin-helper.php @@ -1,87 +1,87 @@ - 'astra-sites-on-active', - 'type' => 'info', - 'message' => sprintf( - '
    -
    -
    -

    - %2$s -

    -

    %3$s

    - -
    ', - $image_path, - __( 'Thank you for installing Astra!', 'astra' ), - __( 'Did you know Astra comes with dozens of ready-to-use starter templates? Install the Starter Templates plugin to get started.', 'astra' ), - esc_attr( $ast_sites_notice_btn['class'] ), - 'href="' . astra_get_prop( $ast_sites_notice_btn, 'link', '' ) . '"', - 'data-slug="' . astra_get_prop( $ast_sites_notice_btn, 'data_slug', '' ) . '"', - 'data-init="' . astra_get_prop( $ast_sites_notice_btn, 'data_init', '' ) . '"', - 'data-settings-link-text="' . astra_get_prop( $ast_sites_notice_btn, 'data_settings_link_text', '' ) . '"', - 'data-settings-link="' . astra_get_prop( $ast_sites_notice_btn, 'data_settings_link', '' ) . '"', - 'data-activating-text="' . astra_get_prop( $ast_sites_notice_btn, 'activating_text', '' ) . '"', - esc_html( $ast_sites_notice_btn['button_text'] ) - ), - 'priority' => 5, - 'display-with-other-notices' => false, - 'show_if' => class_exists( 'Astra_Ext_White_Label_Markup' ) ? Astra_Ext_White_Label_Markup::show_branding() : true, - ); - - Astra_Notices::add_notice( - $astra_sites_notice_args - ); - } - } - - /** - * Display notice for minimun version for Astra addon. - * - * @since 2.0.0 - */ - public static function minimum_addon_version_notice() { - - if ( ! defined( 'ASTRA_EXT_VER' ) ) { - return; - } - - if ( version_compare( ASTRA_EXT_VER, ASTRA_EXT_MIN_VER ) < 0 ) { - - $message = sprintf( - /* translators: %1$1s: Theme Name, %2$2s: Minimum Required version of the addon */ - __( 'Please update the %1$1s to version %2$2s or higher. Ignore if already updated.', 'astra' ), - astra_get_addon_name(), - ASTRA_EXT_MIN_VER - ); - - $min_version = get_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice-min-ver', true ); - - if ( ! $min_version ) { - update_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice-min-ver', ASTRA_EXT_MIN_VER ); - } - - if ( version_compare( $min_version, ASTRA_EXT_MIN_VER, '!=' ) ) { - delete_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice' ); - update_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice-min-ver', ASTRA_EXT_MIN_VER ); - } - - $notice_args = array( - 'id' => 'ast-minimum-addon-version-notice', - 'type' => 'warning', - 'message' => $message, - 'show_if' => true, - 'repeat-notice-after' => false, - 'priority' => 18, - 'display-with-other-notices' => true, - ); - - Astra_Notices::add_notice( $notice_args ); - } - } - - /** - * Enqueue Astra Notices CSS. - * - * @since 2.0.0 - * - * @return void - */ - public static function notice_assets() { - if ( is_rtl() ) { - wp_enqueue_style( 'astra-notices-rtl', ASTRA_THEME_URI . 'inc/assets/css/astra-notices-rtl.css', array(), ASTRA_THEME_VERSION ); - } else { - wp_enqueue_style( 'astra-notices', ASTRA_THEME_URI . 'inc/assets/css/astra-notices.css', array(), ASTRA_THEME_VERSION ); - } - } - - /** - * Render button for Astra Site notices - * - * @since 1.6.5 - * @return array $ast_sites_notice_btn Rendered button - */ - public static function astra_sites_notice_button() { - - $ast_sites_notice_btn = array(); - - // Any of the Starter Templtes plugin - Active. - if ( is_plugin_active( 'astra-pro-sites/astra-pro-sites.php' ) || is_plugin_active( 'astra-sites/astra-sites.php' ) ) { - $ast_sites_notice_btn['class'] = 'active'; - $ast_sites_notice_btn['button_text'] = __( 'See Library »', 'astra' ); - $ast_sites_notice_btn['link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); - - return $ast_sites_notice_btn; - } - - // Starter Templates PRO Plugin - Installed but Inactive. - if ( file_exists( WP_PLUGIN_DIR . '/astra-pro-sites/astra-pro-sites.php' ) && is_plugin_inactive( 'astra-pro-sites/astra-pro-sites.php' ) ) { - $ast_sites_notice_btn['class'] = 'astra-activate-recommended-plugin'; - $ast_sites_notice_btn['button_text'] = __( 'Activate Importer Plugin', 'astra' ); - $ast_sites_notice_btn['data_slug'] = 'astra-pro-sites'; - $ast_sites_notice_btn['data_init'] = '/astra-pro-sites/astra-pro-sites.php'; - $ast_sites_notice_btn['data_settings_link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); - $ast_sites_notice_btn['data_settings_link_text'] = __( 'See Library »', 'astra' ); - $ast_sites_notice_btn['activating_text'] = __( 'Activating Importer Plugin ', 'astra' ) . '…'; - - return $ast_sites_notice_btn; - } - - // Starter Templates FREE Plugin - Installed but Inactive. - if ( file_exists( WP_PLUGIN_DIR . '/astra-sites/astra-sites.php' ) && is_plugin_inactive( 'astra-sites/astra-sites.php' ) ) { - $ast_sites_notice_btn['class'] = 'astra-activate-recommended-plugin'; - $ast_sites_notice_btn['button_text'] = __( 'Activate Importer Plugin', 'astra' ); - $ast_sites_notice_btn['data_slug'] = 'astra-sites'; - $ast_sites_notice_btn['data_init'] = '/astra-sites/astra-sites.php'; - $ast_sites_notice_btn['data_settings_link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); - $ast_sites_notice_btn['data_settings_link_text'] = __( 'See Library »', 'astra' ); - $ast_sites_notice_btn['activating_text'] = __( 'Activating Importer Plugin ', 'astra' ) . '…'; - - return $ast_sites_notice_btn; - } - - // Any of the Starter Templates plugin not available. - if ( ! file_exists( WP_PLUGIN_DIR . '/astra-sites/astra-sites.php' ) || ! file_exists( WP_PLUGIN_DIR . '/astra-pro-sites/astra-pro-sites.php' ) ) { - $ast_sites_notice_btn['class'] = 'astra-install-recommended-plugin'; - $ast_sites_notice_btn['button_text'] = __( 'Install Importer Plugin', 'astra' ); - $ast_sites_notice_btn['data_slug'] = 'astra-sites'; - $ast_sites_notice_btn['data_init'] = '/astra-sites/astra-sites.php'; - $ast_sites_notice_btn['data_settings_link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); - $ast_sites_notice_btn['data_settings_link_text'] = __( 'See Library »', 'astra' ); - $ast_sites_notice_btn['detail_link_class'] = 'plugin-detail thickbox open-plugin-details-modal astra-starter-sites-detail-link'; - $ast_sites_notice_btn['detail_link'] = network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=astra-sites&TB_iframe=true&width=772&height=400' ); - $ast_sites_notice_btn['detail_link_text'] = __( 'Details »', 'astra' ); - - return $ast_sites_notice_btn; - } - - $ast_sites_notice_btn['class'] = 'active'; - $ast_sites_notice_btn['button_text'] = __( 'See Library »', 'astra' ); - $ast_sites_notice_btn['link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); - - return $ast_sites_notice_btn; - } - - /** - * Check if installed Starter Sites plugin is new. - * - * @since 2.3.2 - */ - public static function get_starter_templates_slug() { - - if ( defined( 'ASTRA_PRO_SITES_VER' ) && version_compare( ASTRA_PRO_SITES_VER, '2.0.0', '>=' ) ) { - self::$starter_templates_slug = 'starter-templates'; - } - - if ( defined( 'ASTRA_SITES_VER' ) && version_compare( ASTRA_SITES_VER, '2.0.0', '>=' ) ) { - self::$starter_templates_slug = 'starter-templates'; - } - } - - /** - * Load the scripts and styles in the customizer controls. - * - * @since 1.2.1 - */ - public static function customizer_scripts() { - $color_palettes = wp_json_encode( astra_color_palette() ); - wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $color_palettes . ';' ); - } - - /** - * Register admin scripts. - * - * @param String $hook Screen name where the hook is fired. - * @return void - */ - public static function register_scripts( $hook ) { - - if ( in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) { - $post_types = get_post_types( array( 'public' => true ) ); - $screen = get_current_screen(); - $post_type = $screen->id; - - if ( in_array( $post_type, (array) $post_types ) ) { - - echo ''; - } - } - /* Add CSS for the Submenu for BSF plugins added in Appearance Menu */ - - if ( ! is_customize_preview() ) { - - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - wp_register_script( 'astra-admin-settings', ASTRA_THEME_URI . 'inc/assets/js/astra-admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), ASTRA_THEME_VERSION, false ); - - $localize = array( - 'ajaxUrl' => admin_url( 'admin-ajax.php' ), - 'btnActivating' => __( 'Activating Importer Plugin ', 'astra' ) . '…', - 'astraSitesLink' => admin_url( 'themes.php?page=' ), - 'astraSitesLinkTitle' => __( 'See Library »', 'astra' ), - 'recommendedPluiginActivatingText' => __( 'Activating', 'astra' ) . '…', - 'recommendedPluiginDeactivatingText' => __( 'Deactivating', 'astra' ) . '…', - 'recommendedPluiginActivateText' => __( 'Activate', 'astra' ), - 'recommendedPluiginDeactivateText' => __( 'Deactivate', 'astra' ), - 'recommendedPluiginSettingsText' => __( 'Settings', 'astra' ), - 'astraPluginManagerNonce' => wp_create_nonce( 'astra-recommended-plugin-nonce' ), - ); - - wp_localize_script( 'astra-admin-settings', 'astra', apply_filters( 'astra_theme_js_localize', $localize ) ); - } - } - - /** - * Enqueues the needed CSS/JS for the builder's admin settings page. - * - * @since 1.0 - */ - public static function styles_scripts() { - - // Styles. - if ( is_rtl() ) { - wp_enqueue_style( 'astra-admin-settings-rtl', ASTRA_THEME_URI . 'inc/assets/css/astra-admin-menu-settings-rtl.css', array(), ASTRA_THEME_VERSION ); - } else { - wp_enqueue_style( 'astra-admin-settings', ASTRA_THEME_URI . 'inc/assets/css/astra-admin-menu-settings.css', array(), ASTRA_THEME_VERSION ); - } - - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - wp_register_script( 'astra-admin-settings', ASTRA_THEME_URI . 'inc/assets/js/astra-admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), ASTRA_THEME_VERSION, false ); - - $localize = array( - 'ajaxUrl' => admin_url( 'admin-ajax.php' ), - 'btnActivating' => __( 'Activating Importer Plugin ', 'astra' ) . '…', - 'astraSitesLink' => admin_url( 'themes.php?page=' ), - 'astraSitesLinkTitle' => __( 'See Library »', 'astra' ), - 'recommendedPluiginActivatingText' => __( 'Activating', 'astra' ) . '…', - 'recommendedPluiginDeactivatingText' => __( 'Deactivating', 'astra' ) . '…', - 'recommendedPluiginActivateText' => __( 'Activate', 'astra' ), - 'recommendedPluiginDeactivateText' => __( 'Deactivate', 'astra' ), - 'recommendedPluiginSettingsText' => __( 'Settings', 'astra' ), - 'astraPluginManagerNonce' => wp_create_nonce( 'astra-recommended-plugin-nonce' ), - 'ajax_nonce' => wp_create_nonce( 'astra-builder-module-nonce' ), - 'old_header_footer' => __( 'Use Old Header/Footer', 'astra' ), - 'migrate_to_builder' => __( 'Use New Header/Footer Builder', 'astra' ), - ); - wp_localize_script( 'astra-admin-settings', 'astra', apply_filters( 'astra_theme_js_localize', $localize ) ); - - // Script. - wp_enqueue_script( 'astra-admin-settings' ); - - if ( ! file_exists( WP_PLUGIN_DIR . '/astra-sites/astra-sites.php' ) && is_plugin_inactive( 'astra-pro-sites/astra-pro-sites.php' ) ) { - // For starter site plugin popup detail "Details »" on Astra Options page. - wp_enqueue_script( 'plugin-install' ); - wp_enqueue_script( 'thickbox' ); - wp_enqueue_style( 'thickbox' ); - } - } - - - /** - * Get and return page URL - * - * @param string $menu_slug Menu name. - * @since 1.0 - * @return string page url - */ - public static function get_page_url( $menu_slug ) { - - $parent_page = self::$default_menu_position; - - if ( strpos( $parent_page, '?' ) !== false ) { - $query_var = '&page=' . self::$plugin_slug; - } else { - $query_var = '?page=' . self::$plugin_slug; - } - - $parent_page_url = admin_url( $parent_page . $query_var ); - - $url = $parent_page_url . '&action=' . $menu_slug; - - return esc_url( $url ); - } - - /** - * Add main menu - * - * @since 1.0 - */ - public static function add_admin_menu() { - - $parent_page = self::$default_menu_position; - $page_title = self::$menu_page_title; - $capability = 'manage_options'; - $page_menu_slug = self::$plugin_slug; - $page_menu_func = __CLASS__ . '::menu_callback'; - - if ( apply_filters( 'astra_dashboard_admin_menu', true ) ) { - add_theme_page( $page_title, $page_title, $capability, $page_menu_slug, $page_menu_func ); - } else { - do_action( 'asta_register_admin_menu', $parent_page, $page_title, $capability, $page_menu_slug, $page_menu_func ); - } - } - - /** - * Menu callback - * - * @since 1.0 - */ - public static function menu_callback() { - - $current_slug = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : self::$current_slug; // phpcs:ignore WordPress.Security.NonceVerification.Recommended - - $current_slug = str_replace( '-', '_', $current_slug ); - - $ast_icon = apply_filters( 'astra_page_top_icon', true ); - $ast_visit_site_url = apply_filters( 'astra_site_url', 'https://wpastra.com' ); - $ast_wrapper_class = apply_filters( 'astra_welcome_wrapper_class', array( $current_slug ) ); - - ?> -
    -
    -
    - - - - -
    -
    - - -
    - - -
    -

    - -

    -
    - -
    -
    - - - -
    -

    - - -

    - Starter Templates -
    -

    - ' . esc_html( $astra_starter_sites_doc_link_text ) . '' : - esc_html( $astra_starter_sites_doc_link_text ) - ); - ?> -

    -

    - -

    - %8$s ', - esc_attr( $ast_sites_notice_btn['class'] ), - 'href="' . esc_url( astra_get_prop( $ast_sites_notice_btn, 'link', '' ) ) . '"', - 'data-slug="' . esc_attr( astra_get_prop( $ast_sites_notice_btn, 'data_slug', '' ) ) . '"', - 'data-init="' . esc_attr( astra_get_prop( $ast_sites_notice_btn, 'data_init', '' ) ) . '"', - 'data-settings-link-text="' . esc_attr( astra_get_prop( $ast_sites_notice_btn, 'data_settings_link_text', '' ) ) . '"', - 'data-settings-link="' . esc_attr( astra_get_prop( $ast_sites_notice_btn, 'data_settings_link', '' ) ) . '"', - 'data-activating-text="' . esc_attr( astra_get_prop( $ast_sites_notice_btn, 'activating_text', '' ) ) . '"', - esc_html( $ast_sites_notice_btn['button_text'] ) - ); - printf( - ' %3$s ', - isset( $ast_sites_notice_btn['detail_link_class'] ) ? esc_attr( $ast_sites_notice_btn['detail_link_class'] ) : '', - isset( $ast_sites_notice_btn['detail_link'] ) ? 'href="' . esc_url( $ast_sites_notice_btn['detail_link'] ) . '"' : '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - isset( $ast_sites_notice_btn['detail_link_class'] ) ? esc_html( $ast_sites_notice_btn['detail_link_text'] ) : '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ); - ?> -
    -
    -
    -
    - - array( - 'title' => __( 'Header Options', 'astra' ), - 'dashicon' => 'dashicons-align-center', - 'quick_url' => admin_url( 'customize.php?autofocus[panel]=panel-header-group' ), - ), - 'logo-favicon' => array( - 'title' => __( 'Upload Logo', 'astra' ), - 'dashicon' => 'dashicons-format-image', - 'quick_url' => admin_url( 'customize.php?autofocus[control]=custom_logo' ), - ), - 'footer' => array( - 'title' => __( 'Footer Settings', 'astra' ), - 'dashicon' => 'dashicons-align-wide', - 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-footer-group' ), - ), - 'colors' => array( - 'title' => __( 'Set Colors', 'astra' ), - 'dashicon' => 'dashicons-admin-customizer', - 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-colors-background' ), - ), - 'layout' => array( - 'title' => __( 'Layout Options', 'astra' ), - 'dashicon' => 'dashicons-layout', - 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-container-layout' ), - ), - 'typography' => array( - 'title' => __( 'Customize Fonts', 'astra' ), - 'dashicon' => 'dashicons-editor-textcolor', - 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-typography' ), - ), - 'blog-layout' => array( - 'title' => __( 'Blog Layouts', 'astra' ), - 'dashicon' => 'dashicons-welcome-write-blog', - 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-blog-group' ), - ), - 'sidebars' => array( - 'title' => __( 'Sidebar Options', 'astra' ), - 'dashicon' => 'dashicons-align-left', - 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-sidebars' ), - ), - ) - ); - - $extensions = apply_filters( - 'astra_addon_list', - array( - 'colors-and-background' => array( - 'title' => __( 'Colors & Background', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/colors-background-module/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/colors-background-module/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'typography' => array( - 'title' => __( 'Typography', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/typography-module/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/typography-module/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'spacing' => array( - 'title' => __( 'Spacing', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/spacing-addon-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/spacing-addon-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'blog-pro' => array( - 'title' => __( 'Blog Pro', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/blog-pro-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/blog-pro-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'mobile-header' => array( - 'title' => __( 'Mobile Header', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/mobile-header-with-astra/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/mobile-header-with-astra/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'header-sections' => array( - 'title' => __( 'Header Sections', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/header-sections-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/header-sections-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'nav-menu' => array( - 'title' => __( 'Nav Menu', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/nav-menu-addon/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/nav-menu-addon/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'sticky-header' => array( - 'title' => __( 'Sticky Header', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/sticky-header-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/sticky-header-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'advanced-headers' => array( - 'title' => __( 'Page Headers', 'astra' ), - 'description' => __( 'Make your header layouts look more appealing and sexy!', 'astra' ), - 'manage_settings' => true, - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/page-headers-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/page-headers-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'advanced-hooks' => array( - 'title' => __( 'Custom Layouts', 'astra' ), - // 'icon' => ASTRA_THEME_URI . 'assets/img/astra-advanced-hooks.png', - 'description' => __( 'Add content conditionally in the various hook areas of the theme.', 'astra' ), - 'manage_settings' => true, - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/custom-layouts-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/custom-layouts-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'site-layouts' => array( - 'title' => __( 'Site Layouts', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/site-layout-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/site-layout-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'advanced-footer' => array( - 'title' => __( 'Footer Widgets', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/footer-widgets-astra-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/footer-widgets-astra-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'scroll-to-top' => array( - 'title' => __( 'Scroll To Top', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/scroll-to-top-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/scroll-to-top-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'woocommerce' => array( - 'title' => __( 'WooCommerce', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/woocommerce-module-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/woocommerce-module-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'edd' => array( - 'title' => __( 'Easy Digital Downloads', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/easy-digital-downloads-module-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/easy-digital-downloads-module-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'learndash' => array( - 'title' => __( 'LearnDash', 'astra' ), - 'description' => __( 'Supercharge your LearnDash website with amazing design features.', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/learndash-integration-in-astra-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/learndash-integration-in-astra-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'lifterlms' => array( - 'title' => __( 'LifterLMS', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/lifterlms-module-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/lifterlms-module-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - 'white-label' => array( - 'title' => __( 'White Label', 'astra' ), - 'class' => 'ast-addon', - 'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/how-to-white-label-astra/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'links' => array( - array( - 'link_class' => 'ast-learn-more', - 'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/how-to-white-label-astra/', 'astra-dashboard', 'learn-more', 'welcome-page' ), - 'link_text' => __( 'Learn More »', 'astra' ), - 'target_blank' => true, - ), - ), - ), - ) - ); - ?> -
    -

    -
    - - - -
    -
    - -
    -

    - -

    -
    - -
    -
      - $info ) { - $title_url = ( isset( $info['title_url'] ) && ! empty( $info['title_url'] ) ) ? 'href="' . esc_url( $info['title_url'] ) . '"' : ''; - $anchor_target = ( isset( $info['title_url'] ) && ! empty( $info['title_url'] ) ) ? "target='_blank' rel='noopener'" : ''; - - echo '
    • ' . esc_html( $info['title'] ) . '
    • '; - } - ?> -
    -
    - -
    -
    - - - array( - 'plugin-name' => __( 'Import / Export Customizer Settings', 'astra' ), - 'plugin-init' => 'astra-import-export/astra-import-export.php', - 'settings-link' => '', - 'settings-link-text' => 'Settings', - ), - 'reset-astra-customizer' => - array( - 'plugin-name' => __( 'Astra Customizer Reset', 'astra' ), - 'plugin-init' => 'reset-astra-customizer/class-astra-theme-customizer-reset.php', - 'settings-link' => admin_url( 'customize.php' ), - 'settings-link-text' => 'Settings', - ), - - 'customizer-search' => - array( - 'plugin-name' => __( 'Customizer Search', 'astra' ), - 'plugin-init' => 'customizer-search/customizer-search.php', - 'settings-link' => admin_url( 'customize.php' ), - 'settings-link-text' => 'Settings', - ), - - 'astra-bulk-edit' => - array( - 'plugin-name' => __( 'Astra Bulk Edit', 'astra' ), - 'plugin-init' => 'astra-bulk-edit/astra-bulk-edit.php', - 'settings-link' => '', - 'settings-link-text' => 'Settings', - ), - - 'astra-widgets' => - array( - 'plugin-name' => __( 'Astra Widgets', 'astra' ), - 'plugin-init' => 'astra-widgets/astra-widgets.php', - 'settings-link' => admin_url( 'widgets.php' ), - 'settings-link-text' => 'Settings', - ), - - 'custom-fonts' => - array( - 'plugin-name' => __( 'Custom Fonts', 'astra' ), - 'plugin-init' => 'custom-fonts/custom-fonts.php', - 'settings-link' => admin_url( 'edit-tags.php?taxonomy=bsf_custom_fonts' ), - 'settings-link-text' => 'Settings', - ), - - 'custom-typekit-fonts' => - array( - 'plugin-name' => __( 'Custom Typekit Fonts', 'astra' ), - 'plugin-init' => 'custom-typekit-fonts/custom-typekit-fonts.php', - 'settings-link' => admin_url( 'themes.php?page=custom-typekit-fonts' ), - 'settings-link-text' => 'Settings', - ), - - 'sidebar-manager' => - array( - 'plugin-name' => __( 'Sidebar Manager', 'astra' ), - 'plugin-init' => 'sidebar-manager/sidebar-manager.php', - 'settings-link' => admin_url( 'edit.php?post_type=bsf-sidebar' ), - 'settings-link-text' => 'Settings', - ), - - 'ultimate-addons-for-gutenberg' => - array( - 'plugin-name' => __( 'Ultimate Addons for Gutenberg', 'astra' ), - 'plugin-init' => 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php', - 'settings-link' => admin_url( 'options-general.php?page=uag' ), - 'settings-link-text' => 'Settings', - 'display' => function_exists( 'register_block_type' ), - ), - ) - ); - - if ( apply_filters( 'astra_show_free_extend_plugins', true ) ) { - ?> - -
    -

    -

    -
    - -
    - -
    - -
    -
    - - false, - 'message' => __( 'No plugin specified', 'astra' ), - ) - ); - } - - $plugin_init = ( isset( $_POST['init'] ) ) ? sanitize_text_field( wp_unslash( $_POST['init'] ) ) : ''; - - $activate = activate_plugin( $plugin_init, '', false, true ); - - if ( '/astra-pro-sites/astra-pro-sites.php' === $plugin_init || '/astra-sites/astra-sites.php' === $plugin_init ) { - self::get_starter_templates_slug(); - } - - if ( is_wp_error( $activate ) ) { - wp_send_json_error( - array( - 'success' => false, - 'message' => $activate->get_error_message(), - 'starter_template_slug' => self::$starter_templates_slug, - ) - ); - } - - wp_send_json_success( - array( - 'success' => true, - 'message' => __( 'Plugin Successfully Activated', 'astra' ), - 'starter_template_slug' => self::$starter_templates_slug, - ) - ); - } - - /** - * Required Plugin Activate - * - * @since 1.2.4 - */ - public static function required_plugin_deactivate() { - - $nonce = ( isset( $_POST['nonce'] ) ) ? sanitize_key( $_POST['nonce'] ) : ''; - - if ( false === wp_verify_nonce( $nonce, 'astra-recommended-plugin-nonce' ) ) { - wp_send_json_error( esc_html_e( 'WordPress Nonce not validated.', 'astra' ) ); - } - - if ( ! current_user_can( 'install_plugins' ) || ! isset( $_POST['init'] ) || ! sanitize_text_field( wp_unslash( $_POST['init'] ) ) ) { - wp_send_json_error( - array( - 'success' => false, - 'message' => __( 'No plugin specified', 'astra' ), - ) - ); - } - - $plugin_init = ( isset( $_POST['init'] ) ) ? sanitize_text_field( wp_unslash( $_POST['init'] ) ) : ''; - - $deactivate = deactivate_plugins( $plugin_init, '', false ); - - if ( is_wp_error( $deactivate ) ) { - wp_send_json_error( - array( - 'success' => false, - 'message' => $deactivate->get_error_message(), - ) - ); - } - - wp_send_json_success( - array( - 'success' => true, - 'message' => __( 'Plugin Successfully Deactivated', 'astra' ), - ) - ); - - } - - /** - * Astra Header Right Section Links - * - * @since 1.2.4 - */ - public static function top_header_right_section() { - - $top_links = apply_filters( - 'astra_header_top_links', - array( - 'astra-theme-info' => array( - 'title' => 'Astra Lightning Speed' . __( ' Lightning Fast & Fully Customizable WordPress theme!', 'astra' ), - ), - ) - ); - - if ( ! empty( $top_links ) ) { - ?> - - - #menu-appearance a[href^="edit.php?post_type=astra-"]:before, - #menu-appearance a[href^="themes.php?page=astra-"]:before, - #menu-appearance a[href^="edit.php?post_type=astra_"]:before, - #menu-appearance a[href^="edit-tags.php?taxonomy=bsf_custom_fonts"]:before, - #menu-appearance a[href^="themes.php?page=custom-typekit-fonts"]:before, - #menu-appearance a[href^="edit.php?post_type=bsf-sidebar"]:before { - content: "\21B3"; - margin-right: 0.5em; - opacity: 0.5; - } - '; - - } - } - - new Astra_Admin_Settings(); -} + 'astra-sites-on-active', + 'type' => 'info', + 'message' => sprintf( + '
    +
    +
    +

    + %2$s +

    +

    %3$s

    + +
    ', + $image_path, + __( 'Thank you for installing Adélie Linux WordPress Theme!', 'astra' ), + __( 'Did you know Astra comes with dozens of ready-to-use starter templates? Install the Starter Templates plugin to get started.', 'astra' ), + esc_attr( $ast_sites_notice_btn['class'] ), + 'href="' . astra_get_prop( $ast_sites_notice_btn, 'link', '' ) . '"', + 'data-slug="' . astra_get_prop( $ast_sites_notice_btn, 'data_slug', '' ) . '"', + 'data-init="' . astra_get_prop( $ast_sites_notice_btn, 'data_init', '' ) . '"', + 'data-settings-link-text="' . astra_get_prop( $ast_sites_notice_btn, 'data_settings_link_text', '' ) . '"', + 'data-settings-link="' . astra_get_prop( $ast_sites_notice_btn, 'data_settings_link', '' ) . '"', + 'data-activating-text="' . astra_get_prop( $ast_sites_notice_btn, 'activating_text', '' ) . '"', + esc_html( $ast_sites_notice_btn['button_text'] ) + ), + 'priority' => 5, + 'display-with-other-notices' => false, + 'show_if' => class_exists( 'Astra_Ext_White_Label_Markup' ) ? Astra_Ext_White_Label_Markup::show_branding() : true, + ); + + Astra_Notices::add_notice( + $astra_sites_notice_args + ); + } + } + + /** + * Display notice for minimun version for Astra addon. + * + * @since 2.0.0 + */ + public static function minimum_addon_version_notice() { + + if ( ! defined( 'ASTRA_EXT_VER' ) ) { + return; + } + + if ( version_compare( ASTRA_EXT_VER, ASTRA_EXT_MIN_VER ) < 0 ) { + + $message = sprintf( + /* translators: %1$1s: Theme Name, %2$2s: Minimum Required version of the addon */ + __( 'Please update the %1$1s to version %2$2s or higher. Ignore if already updated.', 'astra' ), + astra_get_addon_name(), + ASTRA_EXT_MIN_VER + ); + + $min_version = get_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice-min-ver', true ); + + if ( ! $min_version ) { + update_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice-min-ver', ASTRA_EXT_MIN_VER ); + } + + if ( version_compare( $min_version, ASTRA_EXT_MIN_VER, '!=' ) ) { + delete_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice' ); + update_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice-min-ver', ASTRA_EXT_MIN_VER ); + } + + $notice_args = array( + 'id' => 'ast-minimum-addon-version-notice', + 'type' => 'warning', + 'message' => $message, + 'show_if' => true, + 'repeat-notice-after' => false, + 'priority' => 18, + 'display-with-other-notices' => true, + ); + + Astra_Notices::add_notice( $notice_args ); + } + } + + /** + * Enqueue Astra Notices CSS. + * + * @since 2.0.0 + * + * @return void + */ + public static function notice_assets() { + if ( is_rtl() ) { + wp_enqueue_style( 'astra-notices-rtl', ASTRA_THEME_URI . 'inc/assets/css/astra-notices-rtl.css', array(), ASTRA_THEME_VERSION ); + } else { + wp_enqueue_style( 'astra-notices', ASTRA_THEME_URI . 'inc/assets/css/astra-notices.css', array(), ASTRA_THEME_VERSION ); + } + } + + /** + * Render button for Astra Site notices + * + * @since 1.6.5 + * @return array $ast_sites_notice_btn Rendered button + */ + public static function astra_sites_notice_button() { + + $ast_sites_notice_btn = array(); + + // Any of the Starter Templtes plugin - Active. + if ( is_plugin_active( 'astra-pro-sites/astra-pro-sites.php' ) || is_plugin_active( 'astra-sites/astra-sites.php' ) ) { + $ast_sites_notice_btn['class'] = 'active'; + $ast_sites_notice_btn['button_text'] = __( 'See Library »', 'astra' ); + $ast_sites_notice_btn['link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); + + return $ast_sites_notice_btn; + } + + // Starter Templates PRO Plugin - Installed but Inactive. + if ( file_exists( WP_PLUGIN_DIR . '/astra-pro-sites/astra-pro-sites.php' ) && is_plugin_inactive( 'astra-pro-sites/astra-pro-sites.php' ) ) { + $ast_sites_notice_btn['class'] = 'astra-activate-recommended-plugin'; + $ast_sites_notice_btn['button_text'] = __( 'Activate Importer Plugin', 'astra' ); + $ast_sites_notice_btn['data_slug'] = 'astra-pro-sites'; + $ast_sites_notice_btn['data_init'] = '/astra-pro-sites/astra-pro-sites.php'; + $ast_sites_notice_btn['data_settings_link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); + $ast_sites_notice_btn['data_settings_link_text'] = __( 'See Library »', 'astra' ); + $ast_sites_notice_btn['activating_text'] = __( 'Activating Importer Plugin ', 'astra' ) . '…'; + + return $ast_sites_notice_btn; + } + + // Starter Templates FREE Plugin - Installed but Inactive. + if ( file_exists( WP_PLUGIN_DIR . '/astra-sites/astra-sites.php' ) && is_plugin_inactive( 'astra-sites/astra-sites.php' ) ) { + $ast_sites_notice_btn['class'] = 'astra-activate-recommended-plugin'; + $ast_sites_notice_btn['button_text'] = __( 'Activate Importer Plugin', 'astra' ); + $ast_sites_notice_btn['data_slug'] = 'astra-sites'; + $ast_sites_notice_btn['data_init'] = '/astra-sites/astra-sites.php'; + $ast_sites_notice_btn['data_settings_link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); + $ast_sites_notice_btn['data_settings_link_text'] = __( 'See Library »', 'astra' ); + $ast_sites_notice_btn['activating_text'] = __( 'Activating Importer Plugin ', 'astra' ) . '…'; + + return $ast_sites_notice_btn; + } + + // Any of the Starter Templates plugin not available. + if ( ! file_exists( WP_PLUGIN_DIR . '/astra-sites/astra-sites.php' ) || ! file_exists( WP_PLUGIN_DIR . '/astra-pro-sites/astra-pro-sites.php' ) ) { + $ast_sites_notice_btn['class'] = 'astra-install-recommended-plugin'; + $ast_sites_notice_btn['button_text'] = __( 'Install Importer Plugin', 'astra' ); + $ast_sites_notice_btn['data_slug'] = 'astra-sites'; + $ast_sites_notice_btn['data_init'] = '/astra-sites/astra-sites.php'; + $ast_sites_notice_btn['data_settings_link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); + $ast_sites_notice_btn['data_settings_link_text'] = __( 'See Library »', 'astra' ); + $ast_sites_notice_btn['detail_link_class'] = 'plugin-detail thickbox open-plugin-details-modal astra-starter-sites-detail-link'; + $ast_sites_notice_btn['detail_link'] = network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=astra-sites&TB_iframe=true&width=772&height=400' ); + $ast_sites_notice_btn['detail_link_text'] = __( 'Details »', 'astra' ); + + return $ast_sites_notice_btn; + } + + $ast_sites_notice_btn['class'] = 'active'; + $ast_sites_notice_btn['button_text'] = __( 'See Library »', 'astra' ); + $ast_sites_notice_btn['link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); + + return $ast_sites_notice_btn; + } + + /** + * Check if installed Starter Sites plugin is new. + * + * @since 2.3.2 + */ + public static function get_starter_templates_slug() { + + if ( defined( 'ASTRA_PRO_SITES_VER' ) && version_compare( ASTRA_PRO_SITES_VER, '2.0.0', '>=' ) ) { + self::$starter_templates_slug = 'starter-templates'; + } + + if ( defined( 'ASTRA_SITES_VER' ) && version_compare( ASTRA_SITES_VER, '2.0.0', '>=' ) ) { + self::$starter_templates_slug = 'starter-templates'; + } + } + + /** + * Load the scripts and styles in the customizer controls. + * + * @since 1.2.1 + */ + public static function customizer_scripts() { + $color_palettes = wp_json_encode( astra_color_palette() ); + wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $color_palettes . ';' ); + } + + /** + * Register admin scripts. + * + * @param String $hook Screen name where the hook is fired. + * @return void + */ + public static function register_scripts( $hook ) { + + if ( in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) { + $post_types = get_post_types( array( 'public' => true ) ); + $screen = get_current_screen(); + $post_type = $screen->id; + + if ( in_array( $post_type, (array) $post_types ) ) { + + echo ''; + } + } + /* Add CSS for the Submenu for BSF plugins added in Appearance Menu */ + + if ( ! is_customize_preview() ) { + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + wp_register_script( 'astra-admin-settings', ASTRA_THEME_URI . 'inc/assets/js/astra-admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), ASTRA_THEME_VERSION, false ); + + $localize = array( + 'ajaxUrl' => admin_url( 'admin-ajax.php' ), + 'btnActivating' => __( 'Activating Importer Plugin ', 'astra' ) . '…', + 'astraSitesLink' => admin_url( 'themes.php?page=' ), + 'astraSitesLinkTitle' => __( 'See Library »', 'astra' ), + 'recommendedPluiginActivatingText' => __( 'Activating', 'astra' ) . '…', + 'recommendedPluiginDeactivatingText' => __( 'Deactivating', 'astra' ) . '…', + 'recommendedPluiginActivateText' => __( 'Activate', 'astra' ), + 'recommendedPluiginDeactivateText' => __( 'Deactivate', 'astra' ), + 'recommendedPluiginSettingsText' => __( 'Settings', 'astra' ), + 'astraPluginManagerNonce' => wp_create_nonce( 'astra-recommended-plugin-nonce' ), + ); + + wp_localize_script( 'astra-admin-settings', 'astra', apply_filters( 'astra_theme_js_localize', $localize ) ); + } + } + + /** + * Enqueues the needed CSS/JS for the builder's admin settings page. + * + * @since 1.0 + */ + public static function styles_scripts() { + + // Styles. + if ( is_rtl() ) { + wp_enqueue_style( 'astra-admin-settings-rtl', ASTRA_THEME_URI . 'inc/assets/css/astra-admin-menu-settings-rtl.css', array(), ASTRA_THEME_VERSION ); + } else { + wp_enqueue_style( 'astra-admin-settings', ASTRA_THEME_URI . 'inc/assets/css/astra-admin-menu-settings.css', array(), ASTRA_THEME_VERSION ); + } + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + wp_register_script( 'astra-admin-settings', ASTRA_THEME_URI . 'inc/assets/js/astra-admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), ASTRA_THEME_VERSION, false ); + + $localize = array( + 'ajaxUrl' => admin_url( 'admin-ajax.php' ), + 'btnActivating' => __( 'Activating Importer Plugin ', 'astra' ) . '…', + 'astraSitesLink' => admin_url( 'themes.php?page=' ), + 'astraSitesLinkTitle' => __( 'See Library »', 'astra' ), + 'recommendedPluiginActivatingText' => __( 'Activating', 'astra' ) . '…', + 'recommendedPluiginDeactivatingText' => __( 'Deactivating', 'astra' ) . '…', + 'recommendedPluiginActivateText' => __( 'Activate', 'astra' ), + 'recommendedPluiginDeactivateText' => __( 'Deactivate', 'astra' ), + 'recommendedPluiginSettingsText' => __( 'Settings', 'astra' ), + 'astraPluginManagerNonce' => wp_create_nonce( 'astra-recommended-plugin-nonce' ), + 'ajax_nonce' => wp_create_nonce( 'astra-builder-module-nonce' ), + 'old_header_footer' => __( 'Use Old Header/Footer', 'astra' ), + 'migrate_to_builder' => __( 'Use New Header/Footer Builder', 'astra' ), + ); + wp_localize_script( 'astra-admin-settings', 'astra', apply_filters( 'astra_theme_js_localize', $localize ) ); + + // Script. + wp_enqueue_script( 'astra-admin-settings' ); + + if ( ! file_exists( WP_PLUGIN_DIR . '/astra-sites/astra-sites.php' ) && is_plugin_inactive( 'astra-pro-sites/astra-pro-sites.php' ) ) { + // For starter site plugin popup detail "Details »" on Astra Options page. + wp_enqueue_script( 'plugin-install' ); + wp_enqueue_script( 'thickbox' ); + wp_enqueue_style( 'thickbox' ); + } + } + + + /** + * Get and return page URL + * + * @param string $menu_slug Menu name. + * @since 1.0 + * @return string page url + */ + public static function get_page_url( $menu_slug ) { + + $parent_page = self::$default_menu_position; + + if ( strpos( $parent_page, '?' ) !== false ) { + $query_var = '&page=' . self::$plugin_slug; + } else { + $query_var = '?page=' . self::$plugin_slug; + } + + $parent_page_url = admin_url( $parent_page . $query_var ); + + $url = $parent_page_url . '&action=' . $menu_slug; + + return esc_url( $url ); + } + + /** + * Add main menu + * + * @since 1.0 + */ + public static function add_admin_menu() { + + $parent_page = self::$default_menu_position; + $page_title = self::$menu_page_title; + $capability = 'manage_options'; + $page_menu_slug = self::$plugin_slug; + $page_menu_func = __CLASS__ . '::menu_callback'; + + if ( apply_filters( 'astra_dashboard_admin_menu', true ) ) { + add_theme_page( $page_title, $page_title, $capability, $page_menu_slug, $page_menu_func ); + } else { + do_action( 'asta_register_admin_menu', $parent_page, $page_title, $capability, $page_menu_slug, $page_menu_func ); + } + } + + /** + * Menu callback + * + * @since 1.0 + */ + public static function menu_callback() { + + $current_slug = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : self::$current_slug; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + + $current_slug = str_replace( '-', '_', $current_slug ); + + $ast_icon = apply_filters( 'astra_page_top_icon', true ); + $ast_visit_site_url = apply_filters( 'astra_site_url', 'https://www.adelielinux.org/' ); + $ast_wrapper_class = apply_filters( 'astra_welcome_wrapper_class', array( $current_slug ) ); + + ?> +
    +
    +
    + + + + +
    +
    + + +
    + + +
    +

    + +

    +
    + +
    +
    + + array( + 'title' => __( 'Header Options', 'astra' ), + 'dashicon' => 'dashicons-align-center', + 'quick_url' => admin_url( 'customize.php?autofocus[panel]=panel-header-group' ), + ), + 'logo-favicon' => array( + 'title' => __( 'Upload Logo', 'astra' ), + 'dashicon' => 'dashicons-format-image', + 'quick_url' => admin_url( 'customize.php?autofocus[control]=custom_logo' ), + ), + 'footer' => array( + 'title' => __( 'Footer Settings', 'astra' ), + 'dashicon' => 'dashicons-align-wide', + 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-footer-group' ), + ), + 'colors' => array( + 'title' => __( 'Set Colors', 'astra' ), + 'dashicon' => 'dashicons-admin-customizer', + 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-colors-background' ), + ), + 'layout' => array( + 'title' => __( 'Layout Options', 'astra' ), + 'dashicon' => 'dashicons-layout', + 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-container-layout' ), + ), + 'typography' => array( + 'title' => __( 'Customize Fonts', 'astra' ), + 'dashicon' => 'dashicons-editor-textcolor', + 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-typography' ), + ), + 'blog-layout' => array( + 'title' => __( 'Blog Layouts', 'astra' ), + 'dashicon' => 'dashicons-welcome-write-blog', + 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-blog-group' ), + ), + 'sidebars' => array( + 'title' => __( 'Sidebar Options', 'astra' ), + 'dashicon' => 'dashicons-align-left', + 'quick_url' => admin_url( 'customize.php?autofocus[section]=section-sidebars' ), + ), + ) + ); + + $extensions = apply_filters( + 'astra_addon_list', + array( + ) + ); + ?> +
    +

    +
    + + + +
    +
    + + false, + 'message' => __( 'No plugin specified', 'astra' ), + ) + ); + } + + $plugin_init = ( isset( $_POST['init'] ) ) ? sanitize_text_field( wp_unslash( $_POST['init'] ) ) : ''; + + $activate = activate_plugin( $plugin_init, '', false, true ); + + if ( '/astra-pro-sites/astra-pro-sites.php' === $plugin_init || '/astra-sites/astra-sites.php' === $plugin_init ) { + self::get_starter_templates_slug(); + } + + if ( is_wp_error( $activate ) ) { + wp_send_json_error( + array( + 'success' => false, + 'message' => $activate->get_error_message(), + 'starter_template_slug' => self::$starter_templates_slug, + ) + ); + } + + wp_send_json_success( + array( + 'success' => true, + 'message' => __( 'Plugin Successfully Activated', 'astra' ), + 'starter_template_slug' => self::$starter_templates_slug, + ) + ); + } + + /** + * Required Plugin Activate + * + * @since 1.2.4 + */ + public static function required_plugin_deactivate() { + + $nonce = ( isset( $_POST['nonce'] ) ) ? sanitize_key( $_POST['nonce'] ) : ''; + + if ( false === wp_verify_nonce( $nonce, 'astra-recommended-plugin-nonce' ) ) { + wp_send_json_error( esc_html_e( 'WordPress Nonce not validated.', 'astra' ) ); + } + + if ( ! current_user_can( 'install_plugins' ) || ! isset( $_POST['init'] ) || ! sanitize_text_field( wp_unslash( $_POST['init'] ) ) ) { + wp_send_json_error( + array( + 'success' => false, + 'message' => __( 'No plugin specified', 'astra' ), + ) + ); + } + + $plugin_init = ( isset( $_POST['init'] ) ) ? sanitize_text_field( wp_unslash( $_POST['init'] ) ) : ''; + + $deactivate = deactivate_plugins( $plugin_init, '', false ); + + if ( is_wp_error( $deactivate ) ) { + wp_send_json_error( + array( + 'success' => false, + 'message' => $deactivate->get_error_message(), + ) + ); + } + + wp_send_json_success( + array( + 'success' => true, + 'message' => __( 'Plugin Successfully Deactivated', 'astra' ), + ) + ); + + } + + /** + * Astra Header Right Section Links + * + * @since 1.2.4 + */ + public static function top_header_right_section() { + + if ( ! empty( $top_links ) ) { + ?> + + + #menu-appearance a[href^="edit.php?post_type=astra-"]:before, + #menu-appearance a[href^="themes.php?page=astra-"]:before, + #menu-appearance a[href^="edit.php?post_type=astra_"]:before, + #menu-appearance a[href^="edit-tags.php?taxonomy=bsf_custom_fonts"]:before, + #menu-appearance a[href^="themes.php?page=custom-typekit-fonts"]:before, + #menu-appearance a[href^="edit.php?post_type=bsf-sidebar"]:before { + content: "\21B3"; + margin-right: 0.5em; + opacity: 0.5; + } + '; + + } + } + + new Astra_Admin_Settings(); +} diff --git a/inc/core/class-astra-attr.php b/inc/core/class-astra-attr.php index 2f55e46..9154c47 100644 --- a/inc/core/class-astra-attr.php +++ b/inc/core/class-astra-attr.php @@ -1,115 +1,115 @@ -astra_parse_attr( $context, $attributes, $args ); - - $output = ''; - - // Cycle through attributes, build tag attribute string. - foreach ( $attributes as $key => $value ) { - - if ( ! $value ) { - continue; - } - - if ( true === $value ) { - $output .= esc_html( $key ) . ' '; - } else { - $output .= sprintf( '%s="%s" ', esc_html( $key ), esc_attr( $value ) ); - } - } - - $output = apply_filters( "astra_attr_{$context}_output", $output, $attributes, $context, $args ); - - return trim( $output ); - } - - /** - * Merge array of attributes with defaults, and apply contextual filter on array. - * - * The contextual filter is of the form `astra_attr_{context}`. - * - * @since 1.6.2 - * - * @param string $context The context, to build filter name. - * @param array $attributes Optional. Extra attributes to merge with defaults. - * @param array $args Optional. Custom data to pass to filter. - * @return array Merged and filtered attributes. - */ - public function astra_parse_attr( $context, $attributes = array(), $args = array() ) { - - $defaults = array( - 'class' => sanitize_html_class( $context ), - ); - - $attributes = wp_parse_args( $attributes, $defaults ); - - // Contextual filter. - return apply_filters( "astra_attr_{$context}", $attributes, $context, $args ); - } - - } - -endif; - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_Attr::get_instance(); +astra_parse_attr( $context, $attributes, $args ); + + $output = ''; + + // Cycle through attributes, build tag attribute string. + foreach ( $attributes as $key => $value ) { + + if ( ! $value ) { + continue; + } + + if ( true === $value ) { + $output .= esc_html( $key ) . ' '; + } else { + $output .= sprintf( '%s="%s" ', esc_html( $key ), esc_attr( $value ) ); + } + } + + $output = apply_filters( "astra_attr_{$context}_output", $output, $attributes, $context, $args ); + + return trim( $output ); + } + + /** + * Merge array of attributes with defaults, and apply contextual filter on array. + * + * The contextual filter is of the form `astra_attr_{context}`. + * + * @since 1.6.2 + * + * @param string $context The context, to build filter name. + * @param array $attributes Optional. Extra attributes to merge with defaults. + * @param array $args Optional. Custom data to pass to filter. + * @return array Merged and filtered attributes. + */ + public function astra_parse_attr( $context, $attributes = array(), $args = array() ) { + + $defaults = array( + 'class' => sanitize_html_class( $context ), + ); + + $attributes = wp_parse_args( $attributes, $defaults ); + + // Contextual filter. + return apply_filters( "astra_attr_{$context}", $attributes, $context, $args ); + } + + } + +endif; + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_Attr::get_instance(); diff --git a/inc/core/class-astra-enqueue-scripts.php b/inc/core/class-astra-enqueue-scripts.php index c249445..9772037 100644 --- a/inc/core/class-astra-enqueue-scripts.php +++ b/inc/core/class-astra-enqueue-scripts.php @@ -1,389 +1,389 @@ - - - tag in admin page - * - * @param String $classes body classes returned from the filter. - * @return String body classes to be added to tag in admin page - */ - public function admin_body_class( $classes ) { - - global $pagenow; - $screen = get_current_screen(); - - if ( ( ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) && ( defined( 'ASTRA_ADVANCED_HOOKS_POST_TYPE' ) && ASTRA_ADVANCED_HOOKS_POST_TYPE == $screen->post_type ) ) || 'widgets.php' == $pagenow ) { - return; - } - - $post_id = get_the_ID(); - - if ( $post_id ) { - $meta_content_layout = get_post_meta( $post_id, 'site-content-layout', true ); - } - - if ( ( isset( $meta_content_layout ) && ! empty( $meta_content_layout ) ) && 'default' !== $meta_content_layout ) { - $content_layout = $meta_content_layout; - } else { - $content_layout = astra_get_option( 'site-content-layout' ); - } - - if ( 'content-boxed-container' == $content_layout ) { - $classes .= ' ast-separate-container'; - } elseif ( 'boxed-container' == $content_layout ) { - $classes .= ' ast-separate-container ast-two-container'; - } elseif ( 'page-builder' == $content_layout ) { - $classes .= ' ast-page-builder-template'; - } elseif ( 'plain-container' == $content_layout ) { - $classes .= ' ast-plain-container'; - } - - $site_layout = astra_get_option( 'site-layout' ); - if ( 'ast-box-layout' === $site_layout ) { - $classes .= ' ast-max-width-layout'; - } - - $classes .= ' ast-' . astra_page_layout(); - - return $classes; - } - - /** - * List of all assets. - * - * @return array assets array. - */ - public static function theme_assets() { - - $default_assets = array( - // handle => location ( in /assets/js/ ) ( without .js ext). - 'js' => array( - 'astra-theme-js' => 'style', - ), - // handle => location ( in /assets/css/ ) ( without .css ext). - 'css' => array( - 'astra-theme-css' => Astra_Builder_Helper::apply_flex_based_css() ? 'style-flex' : 'style', - ), - ); - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - $default_assets = array( - // handle => location ( in /assets/js/ ) ( without .js ext). - 'js' => array( - 'astra-theme-js' => 'frontend', - ), - // handle => location ( in /assets/css/ ) ( without .css ext). - 'css' => array( - 'astra-theme-css' => Astra_Builder_Helper::apply_flex_based_css() ? 'main' : 'frontend', - ), - ); - - if ( Astra_Builder_Helper::is_component_loaded( 'edd-cart', 'header' ) || - Astra_Builder_Helper::is_component_loaded( 'woo-cart', 'header' ) ) { - $default_assets['js']['astra-mobile-cart'] = 'mobile-cart'; - } - } - return apply_filters( 'astra_theme_assets', $default_assets ); - } - - /** - * Add Fonts - */ - public function add_fonts() { - - $font_family = astra_get_option( 'body-font-family' ); - $font_weight = astra_get_option( 'body-font-weight' ); - $font_variant = astra_get_option( 'body-font-variant' ); - - Astra_Fonts::add_font( $font_family, $font_weight ); - Astra_Fonts::add_font( $font_family, $font_variant ); - - // Render headings font. - $heading_font_family = astra_get_option( 'headings-font-family' ); - $heading_font_weight = astra_get_option( 'headings-font-weight' ); - $heading_font_variant = astra_get_option( 'headings-font-variant' ); - - Astra_Fonts::add_font( $heading_font_family, $heading_font_weight ); - Astra_Fonts::add_font( $heading_font_family, $heading_font_variant ); - } - - /** - * Enqueue Scripts - */ - public function enqueue_scripts() { - - if ( false === self::enqueue_theme_assets() ) { - return; - } - - /* Directory and Extension */ - $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; - $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; - - $js_uri = ASTRA_THEME_URI . 'assets/js/' . $dir_name . '/'; - $css_uri = ASTRA_THEME_URI . 'assets/css/' . $dir_name . '/'; - - /** - * IE Only Js and CSS Files. - */ - // Flexibility.js for flexbox IE10 support. - wp_enqueue_script( 'astra-flexibility', $js_uri . 'flexibility' . $file_prefix . '.js', array(), ASTRA_THEME_VERSION, false ); - wp_add_inline_script( 'astra-flexibility', 'flexibility(document.documentElement);' ); - wp_script_add_data( 'astra-flexibility', 'conditional', 'IE' ); - - // Polyfill for CustomEvent for IE. - wp_register_script( 'astra-customevent', $js_uri . 'custom-events-polyfill' . $file_prefix . '.js', array(), ASTRA_THEME_VERSION, false ); - wp_register_style( 'astra-galleries-css', $css_uri . 'galleries' . $file_prefix . '.css', array(), ASTRA_THEME_VERSION, 'all' ); - // All assets. - $all_assets = self::theme_assets(); - $styles = $all_assets['css']; - $scripts = $all_assets['js']; - - if ( is_array( $styles ) && ! empty( $styles ) ) { - // Register & Enqueue Styles. - foreach ( $styles as $key => $style ) { - - $dependency = array(); - - // Add dynamic CSS dependency for all styles except for theme's style.css. - if ( 'astra-theme-css' !== $key && class_exists( 'Astra_Cache_Base' ) ) { - if ( ! Astra_Cache_Base::inline_assets() ) { - $dependency[] = 'astra-theme-dynamic'; - } - } - - // Generate CSS URL. - $css_file = $css_uri . $style . $file_prefix . '.css'; - - // Register. - wp_register_style( $key, $css_file, $dependency, ASTRA_THEME_VERSION, 'all' ); - - // Enqueue. - wp_enqueue_style( $key ); - - // RTL support. - wp_style_add_data( $key, 'rtl', 'replace' ); - } - } - - // Fonts - Render Fonts. - Astra_Fonts::render_fonts(); - - /** - * Inline styles - */ - - add_filter( 'astra_dynamic_theme_css', array( 'Astra_Dynamic_CSS', 'return_output' ) ); - add_filter( 'astra_dynamic_theme_css', array( 'Astra_Dynamic_CSS', 'return_meta_output' ) ); - - $menu_animation = astra_get_option( 'header-main-submenu-container-animation' ); - - // Submenu Container Animation for header builder. - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - for ( $index = 1; $index <= Astra_Builder_Helper::$component_limit; $index++ ) { - - $menu_animation_enable = astra_get_option( 'header-menu' . $index . '-submenu-container-animation' ); - - if ( Astra_Builder_Helper::is_component_loaded( 'menu-' . $index, 'header' ) && ! empty( $menu_animation_enable ) ) { - $menu_animation = 'is_animated'; - break; - } - } - } - - $rtl = ( is_rtl() ) ? '-rtl' : ''; - - if ( ! empty( $menu_animation ) || is_customize_preview() ) { - if ( class_exists( 'Astra_Cache' ) ) { - Astra_Cache::add_css_file( ASTRA_THEME_DIR . 'assets/css/' . $dir_name . '/menu-animation' . $rtl . $file_prefix . '.css' ); - } else { - wp_register_style( 'astra-menu-animation', $css_uri . 'menu-animation' . $file_prefix . '.css', null, ASTRA_THEME_VERSION, 'all' ); - wp_enqueue_style( 'astra-menu-animation' ); - } - } - - if ( ! class_exists( 'Astra_Cache' ) ) { - $theme_css_data = apply_filters( 'astra_dynamic_theme_css', '' ); - wp_add_inline_style( 'astra-theme-css', $theme_css_data ); - } - - if ( astra_is_amp_endpoint() ) { - return; - } - - // Comment assets. - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { - wp_enqueue_script( 'comment-reply' ); - } - - if ( is_array( $scripts ) && ! empty( $scripts ) ) { - - // Register & Enqueue Scripts. - foreach ( $scripts as $key => $script ) { - - // Register. - wp_register_script( $key, $js_uri . $script . $file_prefix . '.js', array(), ASTRA_THEME_VERSION, true ); - - // Enqueue. - wp_enqueue_script( $key ); - } - } - - $astra_localize = array( - 'break_point' => astra_header_break_point(), // Header Break Point. - 'isRtl' => is_rtl(), - ); - - wp_localize_script( 'astra-theme-js', 'astra', apply_filters( 'astra_theme_js_localize', $astra_localize ) ); - } - - /** - * Trim CSS - * - * @since 1.0.0 - * @param string $css CSS content to trim. - * @return string - */ - public static function trim_css( $css = '' ) { - - // Trim white space for faster page loading. - if ( ! empty( $css ) ) { - $css = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css ); - $css = str_replace( array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' ' ), '', $css ); - $css = str_replace( ', ', ',', $css ); - } - - return $css; - } - - /** - * Enqueue Gutenberg assets. - * - * @since 1.5.2 - * - * @return void - */ - public function gutenberg_assets() { - /* Directory and Extension */ - $rtl = ''; - if ( is_rtl() ) { - $rtl = '-rtl'; - } - - $css_uri = ASTRA_THEME_URI . 'inc/assets/css/block-editor-styles' . $rtl . '.css'; - $js_uri = ASTRA_THEME_URI . 'inc/assets/js/block-editor-script.js'; - - wp_enqueue_style( 'astra-block-editor-styles', $css_uri, false, ASTRA_THEME_VERSION, 'all' ); - wp_enqueue_script( 'astra-block-editor-script', $js_uri, false, ASTRA_THEME_VERSION, 'all' ); - - // Render fonts in Gutenberg layout. - Astra_Fonts::render_fonts(); - - wp_add_inline_style( 'astra-block-editor-styles', apply_filters( 'astra_block_editor_dynamic_css', Gutenberg_Editor_CSS::get_css() ) ); - } - - /** - * Function to check if enqueuing of Astra assets are disabled. - * - * @since 2.1.0 - * @return boolean - */ - public static function enqueue_theme_assets() { - return apply_filters( 'astra_enqueue_theme_assets', true ); - } - - /** - * Enqueue galleries relates CSS on gallery_style filter. - * - * @param string $gallery_style gallery style and div. - * @since 3.5.0 - * @return string - */ - public function enqueue_galleries_style( $gallery_style ) { - wp_enqueue_style( 'astra-galleries-css' ); - return $gallery_style; - } - - } - - new Astra_Enqueue_Scripts(); -} + + + tag in admin page + * + * @param String $classes body classes returned from the filter. + * @return String body classes to be added to tag in admin page + */ + public function admin_body_class( $classes ) { + + global $pagenow; + $screen = get_current_screen(); + + if ( ( ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) && ( defined( 'ASTRA_ADVANCED_HOOKS_POST_TYPE' ) && ASTRA_ADVANCED_HOOKS_POST_TYPE == $screen->post_type ) ) || 'widgets.php' == $pagenow ) { + return; + } + + $post_id = get_the_ID(); + + if ( $post_id ) { + $meta_content_layout = get_post_meta( $post_id, 'site-content-layout', true ); + } + + if ( ( isset( $meta_content_layout ) && ! empty( $meta_content_layout ) ) && 'default' !== $meta_content_layout ) { + $content_layout = $meta_content_layout; + } else { + $content_layout = astra_get_option( 'site-content-layout' ); + } + + if ( 'content-boxed-container' == $content_layout ) { + $classes .= ' ast-separate-container'; + } elseif ( 'boxed-container' == $content_layout ) { + $classes .= ' ast-separate-container ast-two-container'; + } elseif ( 'page-builder' == $content_layout ) { + $classes .= ' ast-page-builder-template'; + } elseif ( 'plain-container' == $content_layout ) { + $classes .= ' ast-plain-container'; + } + + $site_layout = astra_get_option( 'site-layout' ); + if ( 'ast-box-layout' === $site_layout ) { + $classes .= ' ast-max-width-layout'; + } + + $classes .= ' ast-' . astra_page_layout(); + + return $classes; + } + + /** + * List of all assets. + * + * @return array assets array. + */ + public static function theme_assets() { + + $default_assets = array( + // handle => location ( in /assets/js/ ) ( without .js ext). + 'js' => array( + 'astra-theme-js' => 'style', + ), + // handle => location ( in /assets/css/ ) ( without .css ext). + 'css' => array( + 'astra-theme-css' => Astra_Builder_Helper::apply_flex_based_css() ? 'style-flex' : 'style', + ), + ); + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + $default_assets = array( + // handle => location ( in /assets/js/ ) ( without .js ext). + 'js' => array( + 'astra-theme-js' => 'frontend', + ), + // handle => location ( in /assets/css/ ) ( without .css ext). + 'css' => array( + 'astra-theme-css' => Astra_Builder_Helper::apply_flex_based_css() ? 'main' : 'frontend', + ), + ); + + if ( Astra_Builder_Helper::is_component_loaded( 'edd-cart', 'header' ) || + Astra_Builder_Helper::is_component_loaded( 'woo-cart', 'header' ) ) { + $default_assets['js']['astra-mobile-cart'] = 'mobile-cart'; + } + } + return apply_filters( 'astra_theme_assets', $default_assets ); + } + + /** + * Add Fonts + */ + public function add_fonts() { + + $font_family = astra_get_option( 'body-font-family' ); + $font_weight = astra_get_option( 'body-font-weight' ); + $font_variant = astra_get_option( 'body-font-variant' ); + + Astra_Fonts::add_font( $font_family, $font_weight ); + Astra_Fonts::add_font( $font_family, $font_variant ); + + // Render headings font. + $heading_font_family = astra_get_option( 'headings-font-family' ); + $heading_font_weight = astra_get_option( 'headings-font-weight' ); + $heading_font_variant = astra_get_option( 'headings-font-variant' ); + + Astra_Fonts::add_font( $heading_font_family, $heading_font_weight ); + Astra_Fonts::add_font( $heading_font_family, $heading_font_variant ); + } + + /** + * Enqueue Scripts + */ + public function enqueue_scripts() { + + if ( false === self::enqueue_theme_assets() ) { + return; + } + + /* Directory and Extension */ + $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; + $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; + + $js_uri = ASTRA_THEME_URI . 'assets/js/' . $dir_name . '/'; + $css_uri = ASTRA_THEME_URI . 'assets/css/' . $dir_name . '/'; + + /** + * IE Only Js and CSS Files. + */ + // Flexibility.js for flexbox IE10 support. + wp_enqueue_script( 'astra-flexibility', $js_uri . 'flexibility' . $file_prefix . '.js', array(), ASTRA_THEME_VERSION, false ); + wp_add_inline_script( 'astra-flexibility', 'flexibility(document.documentElement);' ); + wp_script_add_data( 'astra-flexibility', 'conditional', 'IE' ); + + // Polyfill for CustomEvent for IE. + wp_register_script( 'astra-customevent', $js_uri . 'custom-events-polyfill' . $file_prefix . '.js', array(), ASTRA_THEME_VERSION, false ); + wp_register_style( 'astra-galleries-css', $css_uri . 'galleries' . $file_prefix . '.css', array(), ASTRA_THEME_VERSION, 'all' ); + // All assets. + $all_assets = self::theme_assets(); + $styles = $all_assets['css']; + $scripts = $all_assets['js']; + + if ( is_array( $styles ) && ! empty( $styles ) ) { + // Register & Enqueue Styles. + foreach ( $styles as $key => $style ) { + + $dependency = array(); + + // Add dynamic CSS dependency for all styles except for theme's style.css. + if ( 'astra-theme-css' !== $key && class_exists( 'Astra_Cache_Base' ) ) { + if ( ! Astra_Cache_Base::inline_assets() ) { + $dependency[] = 'astra-theme-dynamic'; + } + } + + // Generate CSS URL. + $css_file = $css_uri . $style . $file_prefix . '.css'; + + // Register. + wp_register_style( $key, $css_file, $dependency, ASTRA_THEME_VERSION, 'all' ); + + // Enqueue. + wp_enqueue_style( $key ); + + // RTL support. + wp_style_add_data( $key, 'rtl', 'replace' ); + } + } + + // Fonts - Render Fonts. + Astra_Fonts::render_fonts(); + + /** + * Inline styles + */ + + add_filter( 'astra_dynamic_theme_css', array( 'Astra_Dynamic_CSS', 'return_output' ) ); + add_filter( 'astra_dynamic_theme_css', array( 'Astra_Dynamic_CSS', 'return_meta_output' ) ); + + $menu_animation = astra_get_option( 'header-main-submenu-container-animation' ); + + // Submenu Container Animation for header builder. + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + for ( $index = 1; $index <= Astra_Builder_Helper::$component_limit; $index++ ) { + + $menu_animation_enable = astra_get_option( 'header-menu' . $index . '-submenu-container-animation' ); + + if ( Astra_Builder_Helper::is_component_loaded( 'menu-' . $index, 'header' ) && ! empty( $menu_animation_enable ) ) { + $menu_animation = 'is_animated'; + break; + } + } + } + + $rtl = ( is_rtl() ) ? '-rtl' : ''; + + if ( ! empty( $menu_animation ) || is_customize_preview() ) { + if ( class_exists( 'Astra_Cache' ) ) { + Astra_Cache::add_css_file( ASTRA_THEME_DIR . 'assets/css/' . $dir_name . '/menu-animation' . $rtl . $file_prefix . '.css' ); + } else { + wp_register_style( 'astra-menu-animation', $css_uri . 'menu-animation' . $file_prefix . '.css', null, ASTRA_THEME_VERSION, 'all' ); + wp_enqueue_style( 'astra-menu-animation' ); + } + } + + if ( ! class_exists( 'Astra_Cache' ) ) { + $theme_css_data = apply_filters( 'astra_dynamic_theme_css', '' ); + wp_add_inline_style( 'astra-theme-css', $theme_css_data ); + } + + if ( astra_is_amp_endpoint() ) { + return; + } + + // Comment assets. + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { + wp_enqueue_script( 'comment-reply' ); + } + + if ( is_array( $scripts ) && ! empty( $scripts ) ) { + + // Register & Enqueue Scripts. + foreach ( $scripts as $key => $script ) { + + // Register. + wp_register_script( $key, $js_uri . $script . $file_prefix . '.js', array(), ASTRA_THEME_VERSION, true ); + + // Enqueue. + wp_enqueue_script( $key ); + } + } + + $astra_localize = array( + 'break_point' => astra_header_break_point(), // Header Break Point. + 'isRtl' => is_rtl(), + ); + + wp_localize_script( 'astra-theme-js', 'astra', apply_filters( 'astra_theme_js_localize', $astra_localize ) ); + } + + /** + * Trim CSS + * + * @since 1.0.0 + * @param string $css CSS content to trim. + * @return string + */ + public static function trim_css( $css = '' ) { + + // Trim white space for faster page loading. + if ( ! empty( $css ) ) { + $css = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css ); + $css = str_replace( array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' ' ), '', $css ); + $css = str_replace( ', ', ',', $css ); + } + + return $css; + } + + /** + * Enqueue Gutenberg assets. + * + * @since 1.5.2 + * + * @return void + */ + public function gutenberg_assets() { + /* Directory and Extension */ + $rtl = ''; + if ( is_rtl() ) { + $rtl = '-rtl'; + } + + $css_uri = ASTRA_THEME_URI . 'inc/assets/css/block-editor-styles' . $rtl . '.css'; + $js_uri = ASTRA_THEME_URI . 'inc/assets/js/block-editor-script.js'; + + wp_enqueue_style( 'astra-block-editor-styles', $css_uri, false, ASTRA_THEME_VERSION, 'all' ); + wp_enqueue_script( 'astra-block-editor-script', $js_uri, false, ASTRA_THEME_VERSION, 'all' ); + + // Render fonts in Gutenberg layout. + Astra_Fonts::render_fonts(); + + wp_add_inline_style( 'astra-block-editor-styles', apply_filters( 'astra_block_editor_dynamic_css', Gutenberg_Editor_CSS::get_css() ) ); + } + + /** + * Function to check if enqueuing of Astra assets are disabled. + * + * @since 2.1.0 + * @return boolean + */ + public static function enqueue_theme_assets() { + return apply_filters( 'astra_enqueue_theme_assets', true ); + } + + /** + * Enqueue galleries relates CSS on gallery_style filter. + * + * @param string $gallery_style gallery style and div. + * @since 3.5.0 + * @return string + */ + public function enqueue_galleries_style( $gallery_style ) { + wp_enqueue_style( 'astra-galleries-css' ); + return $gallery_style; + } + + } + + new Astra_Enqueue_Scripts(); +} diff --git a/inc/core/class-astra-theme-options.php b/inc/core/class-astra-theme-options.php index 3521399..3bac1e6 100644 --- a/inc/core/class-astra-theme-options.php +++ b/inc/core/class-astra-theme-options.php @@ -1,530 +1,530 @@ - array( - 'single-image', - 'single-title-meta', - ), - - 'blog-single-width' => 'default', - 'blog-single-max-width' => 1200, - 'blog-single-meta' => array( - 'comments', - 'category', - 'author', - ), - // Blog. - 'blog-post-structure' => array( - 'image', - 'title-meta', - ), - 'blog-width' => 'default', - 'blog-max-width' => 1200, - 'blog-post-content' => 'excerpt', - 'blog-meta' => array( - 'comments', - 'category', - 'author', - ), - // Colors. - 'text-color' => '#3a3a3a', - 'link-color' => '#0170B9', - 'theme-color' => '#0170B9', - 'link-h-color' => '#3a3a3a', - - // Footer Bar Background. - 'footer-bg-obj' => array( - 'background-color' => '', - 'background-image' => '', - 'background-repeat' => 'repeat', - 'background-position' => 'center center', - 'background-size' => 'auto', - 'background-attachment' => 'scroll', - 'background-type' => '', - 'background-media' => '', - ), - 'footer-color' => '', - 'footer-link-color' => '', - 'footer-link-h-color' => '', - - // Footer Widgets Background. - 'footer-adv-bg-obj' => array( - 'background-color' => '', - 'background-image' => '', - 'background-repeat' => 'repeat', - 'background-position' => 'center center', - 'background-size' => 'auto', - 'background-attachment' => 'scroll', - 'background-type' => '', - 'background-media' => '', - ), - 'footer-adv-text-color' => '', - 'footer-adv-link-color' => '', - 'footer-adv-link-h-color' => '', - 'footer-adv-wgt-title-color' => '', - - // Buttons. - 'button-color' => '', - 'button-h-color' => '', - 'button-bg-color' => '', - 'button-bg-h-color' => '', - 'theme-button-padding' => array( - 'desktop' => array( - 'top' => $apply_new_default_values ? 15 : 10, - 'right' => $apply_new_default_values ? 30 : 40, - 'bottom' => $apply_new_default_values ? 15 : 10, - 'left' => $apply_new_default_values ? 30 : 40, - ), - 'tablet' => array( - 'top' => $apply_new_default_values ? 14 : '', - 'right' => $apply_new_default_values ? 28 : '', - 'bottom' => $apply_new_default_values ? 14 : '', - 'left' => $apply_new_default_values ? 28 : '', - ), - 'mobile' => array( - 'top' => $apply_new_default_values ? 12 : '', - 'right' => $apply_new_default_values ? 24 : '', - 'bottom' => $apply_new_default_values ? 12 : '', - 'left' => $apply_new_default_values ? 24 : '', - ), - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'button-radius' => 2, - 'theme-button-border-group-border-size' => array( - 'top' => '', - 'right' => '', - 'bottom' => '', - 'left' => '', - ), - // Footer - Small. - 'footer-sml-layout' => 'footer-sml-layout-1', - 'footer-sml-section-1' => 'custom', - 'footer-sml-section-1-credit' => __( 'Copyright © [current_year] [site_title] | Powered by [theme_author]', 'astra' ), - 'footer-sml-section-2' => '', - 'footer-sml-section-2-credit' => __( 'Copyright © [current_year] [site_title] | Powered by [theme_author]', 'astra' ), - 'footer-sml-dist-equal-align' => true, - 'footer-sml-divider' => 1, - 'footer-sml-divider-color' => '#7a7a7a', - 'footer-layout-width' => 'content', - // General. - 'ast-header-retina-logo' => '', - 'ast-header-logo-width' => '', - 'ast-header-responsive-logo-width' => array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - ), - 'header-color-site-title' => '', - 'header-color-h-site-title' => '', - 'header-color-site-tagline' => '', - 'display-site-title-responsive' => array( - 'desktop' => 1, - 'tablet' => 1, - 'mobile' => 1, - ), - 'display-site-tagline-responsive' => array( - 'desktop' => 0, - 'tablet' => 0, - 'mobile' => 0, - ), - 'logo-title-inline' => 1, - // Header - Primary. - 'disable-primary-nav' => false, - 'header-layouts' => 'header-main-layout-1', - 'header-main-rt-section' => 'none', - 'header-display-outside-menu' => false, - 'header-main-rt-section-html' => '', - 'header-main-rt-section-button-text' => __( 'Button', 'astra' ), - 'header-main-rt-section-button-link' => apply_filters( 'astra_site_url', 'https://www.wpastra.com' ), - 'header-main-rt-section-button-link-option' => array( - 'url' => apply_filters( 'astra_site_url', 'https://www.wpastra.com' ), - 'new_tab' => false, - 'link_rel' => '', - ), - 'header-main-rt-section-button-style' => 'theme-button', - 'header-main-rt-section-button-text-color' => '', - 'header-main-rt-section-button-back-color' => '', - 'header-main-rt-section-button-text-h-color' => '', - 'header-main-rt-section-button-back-h-color' => '', - 'header-main-rt-section-button-padding' => array( - 'desktop' => array( - 'top' => '', - 'right' => '', - 'bottom' => '', - 'left' => '', - ), - 'tablet' => array( - 'top' => '', - 'right' => '', - 'bottom' => '', - 'left' => '', - ), - 'mobile' => array( - 'top' => '', - 'right' => '', - 'bottom' => '', - 'left' => '', - ), - ), - 'header-main-rt-section-button-border-size' => array( - 'top' => '', - 'right' => '', - 'bottom' => '', - 'left' => '', - ), - 'header-main-sep' => 1, - 'header-main-sep-color' => '', - 'header-main-layout-width' => 'content', - // Header - Sub menu Border. - 'primary-submenu-border' => array( - 'top' => '2', - 'right' => '0', - 'bottom' => '0', - 'left' => '0', - ), - 'primary-submenu-item-border' => false, - 'primary-submenu-b-color' => '', - 'primary-submenu-item-b-color' => '', - - // Primary header button typo options. - 'primary-header-button-font-family' => 'inherit', - 'primary-header-button-font-weight' => 'inherit', - 'primary-header-button-font-size' => array( - 'desktop' => '', - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'primary-header-button-text-transform' => '', - 'primary-header-button-line-height' => 1, - 'primary-header-button-letter-spacing' => '', - - 'header-main-menu-label' => '', - 'header-main-menu-align' => 'inline', - 'header-main-submenu-container-animation' => '', - 'mobile-header-breakpoint' => '', - 'mobile-header-logo' => '', - 'mobile-header-logo-width' => '', - // Site Layout. - 'site-layout' => 'ast-full-width-layout', - 'site-content-width' => 1200, - 'site-layout-outside-bg-obj-responsive' => array( - 'desktop' => array( - 'background-color' => '', - 'background-image' => '', - 'background-repeat' => 'repeat', - 'background-position' => 'center center', - 'background-size' => 'auto', - 'background-attachment' => 'scroll', - 'background-type' => '', - 'background-media' => '', - ), - 'tablet' => array( - 'background-color' => '', - 'background-image' => '', - 'background-repeat' => 'repeat', - 'background-position' => 'center center', - 'background-size' => 'auto', - 'background-attachment' => 'scroll', - 'background-type' => '', - 'background-media' => '', - ), - 'mobile' => array( - 'background-color' => '', - 'background-image' => '', - 'background-repeat' => 'repeat', - 'background-position' => 'center center', - 'background-size' => 'auto', - 'background-attachment' => 'scroll', - 'background-type' => '', - 'background-media' => '', - ), - ), - // Container. - 'site-content-layout' => 'content-boxed-container', - 'single-page-content-layout' => 'default', - 'single-post-content-layout' => 'default', - 'archive-post-content-layout' => 'default', - // Typography. - 'body-font-family' => 'inherit', - 'body-font-variant' => '', - 'body-font-weight' => 'inherit', - 'font-size-body' => array( - 'desktop' => 15, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - - 'body-line-height' => '', - 'para-margin-bottom' => '', - 'underline-content-links' => true, - 'body-text-transform' => '', - 'headings-font-family' => 'inherit', - 'headings-font-weight' => 'inherit', - 'headings-text-transform' => '', - 'headings-line-height' => '', - 'font-size-site-title' => array( - 'desktop' => 35, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'font-size-site-tagline' => array( - 'desktop' => 15, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'font-size-entry-title' => array( - 'desktop' => 30, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'font-size-archive-summary-title' => array( - 'desktop' => 40, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'font-size-page-title' => array( - 'desktop' => 30, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'font-size-h1' => array( - 'desktop' => 40, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'font-size-h2' => array( - 'desktop' => 30, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'font-size-h3' => array( - 'desktop' => 25, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'font-size-h4' => array( - 'desktop' => 20, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'font-size-h5' => array( - 'desktop' => 18, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - 'font-size-h6' => array( - 'desktop' => 15, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ), - - // Sidebar. - 'site-sidebar-layout' => 'right-sidebar', - 'site-sidebar-width' => 30, - 'single-page-sidebar-layout' => 'default', - 'single-post-sidebar-layout' => 'default', - 'archive-post-sidebar-layout' => 'default', - - // Sidebar. - 'footer-adv' => 'disabled', - 'footer-adv-border-width' => '', - 'footer-adv-border-color' => '#7a7a7a', - - // toogle menu style. - 'mobile-header-toggle-btn-style' => 'minimal', - 'hide-custom-menu-mobile' => 1, - - // toogle menu target. - 'mobile-header-toggle-target' => 'icon', - - // Performance. - 'load-google-fonts-locally' => false, - 'preload-local-fonts' => false, - ) - ); - - return self::$defaults; - } - - /** - * Get theme options from static array() - * - * @return array Return array of theme options. - */ - public static function get_options() { - return self::$db_options; - } - - /** - * Update theme static option array. - */ - public static function refresh() { - self::$db_options = wp_parse_args( - self::get_db_options(), - self::defaults() - ); - } - - /** - * Get theme options from static array() from database - * - * @return array Return array of theme options from database. - */ - public static function get_db_options() { - self::$db_options_no_defaults = get_option( ASTRA_THEME_SETTINGS ); - return self::$db_options_no_defaults; - } - } -} -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_Theme_Options::get_instance(); + array( + 'single-image', + 'single-title-meta', + ), + + 'blog-single-width' => 'default', + 'blog-single-max-width' => 1200, + 'blog-single-meta' => array( + 'comments', + 'category', + 'author', + ), + // Blog. + 'blog-post-structure' => array( + 'image', + 'title-meta', + ), + 'blog-width' => 'default', + 'blog-max-width' => 1200, + 'blog-post-content' => 'excerpt', + 'blog-meta' => array( + 'comments', + 'category', + 'author', + ), + // Colors. + 'text-color' => '#3a3a3a', + 'link-color' => '#0170B9', + 'theme-color' => '#0170B9', + 'link-h-color' => '#3a3a3a', + + // Footer Bar Background. + 'footer-bg-obj' => array( + 'background-color' => '', + 'background-image' => '', + 'background-repeat' => 'repeat', + 'background-position' => 'center center', + 'background-size' => 'auto', + 'background-attachment' => 'scroll', + 'background-type' => '', + 'background-media' => '', + ), + 'footer-color' => '', + 'footer-link-color' => '', + 'footer-link-h-color' => '', + + // Footer Widgets Background. + 'footer-adv-bg-obj' => array( + 'background-color' => '', + 'background-image' => '', + 'background-repeat' => 'repeat', + 'background-position' => 'center center', + 'background-size' => 'auto', + 'background-attachment' => 'scroll', + 'background-type' => '', + 'background-media' => '', + ), + 'footer-adv-text-color' => '', + 'footer-adv-link-color' => '', + 'footer-adv-link-h-color' => '', + 'footer-adv-wgt-title-color' => '', + + // Buttons. + 'button-color' => '', + 'button-h-color' => '', + 'button-bg-color' => '', + 'button-bg-h-color' => '', + 'theme-button-padding' => array( + 'desktop' => array( + 'top' => $apply_new_default_values ? 15 : 10, + 'right' => $apply_new_default_values ? 30 : 40, + 'bottom' => $apply_new_default_values ? 15 : 10, + 'left' => $apply_new_default_values ? 30 : 40, + ), + 'tablet' => array( + 'top' => $apply_new_default_values ? 14 : '', + 'right' => $apply_new_default_values ? 28 : '', + 'bottom' => $apply_new_default_values ? 14 : '', + 'left' => $apply_new_default_values ? 28 : '', + ), + 'mobile' => array( + 'top' => $apply_new_default_values ? 12 : '', + 'right' => $apply_new_default_values ? 24 : '', + 'bottom' => $apply_new_default_values ? 12 : '', + 'left' => $apply_new_default_values ? 24 : '', + ), + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'button-radius' => 2, + 'theme-button-border-group-border-size' => array( + 'top' => '', + 'right' => '', + 'bottom' => '', + 'left' => '', + ), + // Footer - Small. + 'footer-sml-layout' => 'footer-sml-layout-1', + 'footer-sml-section-1' => 'custom', + 'footer-sml-section-1-credit' => __( 'Copyright © [current_year] [site_title] | Powered by [theme_author]', 'astra' ), + 'footer-sml-section-2' => '', + 'footer-sml-section-2-credit' => __( 'Copyright © [current_year] [site_title] | Powered by [theme_author]', 'astra' ), + 'footer-sml-dist-equal-align' => true, + 'footer-sml-divider' => 1, + 'footer-sml-divider-color' => '#7a7a7a', + 'footer-layout-width' => 'content', + // General. + 'ast-header-retina-logo' => '', + 'ast-header-logo-width' => '', + 'ast-header-responsive-logo-width' => array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + ), + 'header-color-site-title' => '', + 'header-color-h-site-title' => '', + 'header-color-site-tagline' => '', + 'display-site-title-responsive' => array( + 'desktop' => 1, + 'tablet' => 1, + 'mobile' => 1, + ), + 'display-site-tagline-responsive' => array( + 'desktop' => 0, + 'tablet' => 0, + 'mobile' => 0, + ), + 'logo-title-inline' => 1, + // Header - Primary. + 'disable-primary-nav' => false, + 'header-layouts' => 'header-main-layout-1', + 'header-main-rt-section' => 'none', + 'header-display-outside-menu' => false, + 'header-main-rt-section-html' => '', + 'header-main-rt-section-button-text' => __( 'Button', 'astra' ), + 'header-main-rt-section-button-link' => apply_filters( 'astra_site_url', 'https://www.adelielinux.org/' ), + 'header-main-rt-section-button-link-option' => array( + 'url' => apply_filters( 'astra_site_url', 'https://www.adelielinux.org/' ), + 'new_tab' => false, + 'link_rel' => '', + ), + 'header-main-rt-section-button-style' => 'theme-button', + 'header-main-rt-section-button-text-color' => '', + 'header-main-rt-section-button-back-color' => '', + 'header-main-rt-section-button-text-h-color' => '', + 'header-main-rt-section-button-back-h-color' => '', + 'header-main-rt-section-button-padding' => array( + 'desktop' => array( + 'top' => '', + 'right' => '', + 'bottom' => '', + 'left' => '', + ), + 'tablet' => array( + 'top' => '', + 'right' => '', + 'bottom' => '', + 'left' => '', + ), + 'mobile' => array( + 'top' => '', + 'right' => '', + 'bottom' => '', + 'left' => '', + ), + ), + 'header-main-rt-section-button-border-size' => array( + 'top' => '', + 'right' => '', + 'bottom' => '', + 'left' => '', + ), + 'header-main-sep' => 1, + 'header-main-sep-color' => '', + 'header-main-layout-width' => 'content', + // Header - Sub menu Border. + 'primary-submenu-border' => array( + 'top' => '2', + 'right' => '0', + 'bottom' => '0', + 'left' => '0', + ), + 'primary-submenu-item-border' => false, + 'primary-submenu-b-color' => '', + 'primary-submenu-item-b-color' => '', + + // Primary header button typo options. + 'primary-header-button-font-family' => 'inherit', + 'primary-header-button-font-weight' => 'inherit', + 'primary-header-button-font-size' => array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'primary-header-button-text-transform' => '', + 'primary-header-button-line-height' => 1, + 'primary-header-button-letter-spacing' => '', + + 'header-main-menu-label' => '', + 'header-main-menu-align' => 'inline', + 'header-main-submenu-container-animation' => '', + 'mobile-header-breakpoint' => '', + 'mobile-header-logo' => '', + 'mobile-header-logo-width' => '', + // Site Layout. + 'site-layout' => 'ast-full-width-layout', + 'site-content-width' => 1200, + 'site-layout-outside-bg-obj-responsive' => array( + 'desktop' => array( + 'background-color' => '', + 'background-image' => '', + 'background-repeat' => 'repeat', + 'background-position' => 'center center', + 'background-size' => 'auto', + 'background-attachment' => 'scroll', + 'background-type' => '', + 'background-media' => '', + ), + 'tablet' => array( + 'background-color' => '', + 'background-image' => '', + 'background-repeat' => 'repeat', + 'background-position' => 'center center', + 'background-size' => 'auto', + 'background-attachment' => 'scroll', + 'background-type' => '', + 'background-media' => '', + ), + 'mobile' => array( + 'background-color' => '', + 'background-image' => '', + 'background-repeat' => 'repeat', + 'background-position' => 'center center', + 'background-size' => 'auto', + 'background-attachment' => 'scroll', + 'background-type' => '', + 'background-media' => '', + ), + ), + // Container. + 'site-content-layout' => 'content-boxed-container', + 'single-page-content-layout' => 'default', + 'single-post-content-layout' => 'default', + 'archive-post-content-layout' => 'default', + // Typography. + 'body-font-family' => 'inherit', + 'body-font-variant' => '', + 'body-font-weight' => 'inherit', + 'font-size-body' => array( + 'desktop' => 15, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + + 'body-line-height' => '', + 'para-margin-bottom' => '', + 'underline-content-links' => true, + 'body-text-transform' => '', + 'headings-font-family' => 'inherit', + 'headings-font-weight' => 'inherit', + 'headings-text-transform' => '', + 'headings-line-height' => '', + 'font-size-site-title' => array( + 'desktop' => 35, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'font-size-site-tagline' => array( + 'desktop' => 15, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'font-size-entry-title' => array( + 'desktop' => 30, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'font-size-archive-summary-title' => array( + 'desktop' => 40, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'font-size-page-title' => array( + 'desktop' => 30, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'font-size-h1' => array( + 'desktop' => 40, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'font-size-h2' => array( + 'desktop' => 30, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'font-size-h3' => array( + 'desktop' => 25, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'font-size-h4' => array( + 'desktop' => 20, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'font-size-h5' => array( + 'desktop' => 18, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + 'font-size-h6' => array( + 'desktop' => 15, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ), + + // Sidebar. + 'site-sidebar-layout' => 'right-sidebar', + 'site-sidebar-width' => 30, + 'single-page-sidebar-layout' => 'default', + 'single-post-sidebar-layout' => 'default', + 'archive-post-sidebar-layout' => 'default', + + // Sidebar. + 'footer-adv' => 'disabled', + 'footer-adv-border-width' => '', + 'footer-adv-border-color' => '#7a7a7a', + + // toogle menu style. + 'mobile-header-toggle-btn-style' => 'minimal', + 'hide-custom-menu-mobile' => 1, + + // toogle menu target. + 'mobile-header-toggle-target' => 'icon', + + // Performance. + 'load-google-fonts-locally' => false, + 'preload-local-fonts' => false, + ) + ); + + return self::$defaults; + } + + /** + * Get theme options from static array() + * + * @return array Return array of theme options. + */ + public static function get_options() { + return self::$db_options; + } + + /** + * Update theme static option array. + */ + public static function refresh() { + self::$db_options = wp_parse_args( + self::get_db_options(), + self::defaults() + ); + } + + /** + * Get theme options from static array() from database + * + * @return array Return array of theme options from database. + */ + public static function get_db_options() { + self::$db_options_no_defaults = get_option( ASTRA_THEME_SETTINGS ); + return self::$db_options_no_defaults; + } + } +} +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_Theme_Options::get_instance(); diff --git a/inc/core/class-astra-walker-page.php b/inc/core/class-astra-walker-page.php index b4d0082..ecaf99c 100644 --- a/inc/core/class-astra-walker-page.php +++ b/inc/core/class-astra-walker-page.php @@ -1,137 +1,137 @@ -{$n}"; - $output = apply_filters( 'astra_caret_wrap_filter', $output, $args['sort_column'] ); - - } - - /** - * Outputs the beginning of the current element in the tree. - * - * @see Walker::start_el() - * @since 1.7.2 - * - * @param string $output Used to append additional content. Passed by reference. - * @param WP_Post $page Page data object. - * @param int $depth Optional. Depth of page. Used for padding. Default 0. - * @param array $args Optional. Array of arguments. Default empty array. - * @param int $current_page Optional. Page ID. Default 0. - */ - public function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) { - $css_class = array( 'page_item', 'page-item-' . $page->ID ); - $icon = ''; - $mobile_icon = ''; - - if ( isset( $args['pages_with_children'][ $page->ID ] ) ) { - $css_class[] = 'menu-item-has-children'; - $icon = Astra_Icons::get_icons( 'arrow' ); - $icon = '' . $icon . ''; - // Add toggle button if menu is from Astra. - if ( true === is_object( $args ) ) { - if ( isset( $args->theme_location ) && - ( 'primary' === $args->theme_location || - 'above_header_menu' === $args->theme_location || - 'below_header_menu' === $args->theme_location ) - ) { - $mobile_icon = ''; - } - } else { - if ( isset( $page->post_parent ) && 0 === $page->post_parent ) { - $mobile_icon = ''; - } - } - } - - if ( ! empty( $current_page ) ) { - $_current_page = get_post( $current_page ); - if ( $_current_page && in_array( $page->ID, $_current_page->ancestors ) ) { - $css_class[] = 'current-menu-ancestor'; - } - if ( $page->ID == $current_page ) { - $css_class[] = 'current-menu-item'; - } elseif ( $_current_page && $page->ID == $_current_page->post_parent ) { - $css_class[] = 'current-menu-parent'; - } - } elseif ( get_option( 'page_for_posts' ) == $page->ID ) { - $css_class[] = 'current-menu-parent'; - } - - $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) ); - - $args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before']; - $args['link_after'] = empty( $args['link_after'] ) ? '' : $args['link_after']; - - $output .= sprintf( - '
  • %s%s%s%s%s', - $css_classes, - get_permalink( $page->ID ), - $args['link_before'], - apply_filters( 'the_title', $page->post_title, $page->ID ), - $args['link_after'], - $icon, - $mobile_icon - ); - } - } - -} +{$n}"; + $output = apply_filters( 'astra_caret_wrap_filter', $output, $args['sort_column'] ); + + } + + /** + * Outputs the beginning of the current element in the tree. + * + * @see Walker::start_el() + * @since 1.7.2 + * + * @param string $output Used to append additional content. Passed by reference. + * @param WP_Post $page Page data object. + * @param int $depth Optional. Depth of page. Used for padding. Default 0. + * @param array $args Optional. Array of arguments. Default empty array. + * @param int $current_page Optional. Page ID. Default 0. + */ + public function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) { + $css_class = array( 'page_item', 'page-item-' . $page->ID ); + $icon = ''; + $mobile_icon = ''; + + if ( isset( $args['pages_with_children'][ $page->ID ] ) ) { + $css_class[] = 'menu-item-has-children'; + $icon = Astra_Icons::get_icons( 'arrow' ); + $icon = '' . $icon . ''; + // Add toggle button if menu is from Astra. + if ( true === is_object( $args ) ) { + if ( isset( $args->theme_location ) && + ( 'primary' === $args->theme_location || + 'above_header_menu' === $args->theme_location || + 'below_header_menu' === $args->theme_location ) + ) { + $mobile_icon = ''; + } + } else { + if ( isset( $page->post_parent ) && 0 === $page->post_parent ) { + $mobile_icon = ''; + } + } + } + + if ( ! empty( $current_page ) ) { + $_current_page = get_post( $current_page ); + if ( $_current_page && in_array( $page->ID, $_current_page->ancestors ) ) { + $css_class[] = 'current-menu-ancestor'; + } + if ( $page->ID == $current_page ) { + $css_class[] = 'current-menu-item'; + } elseif ( $_current_page && $page->ID == $_current_page->post_parent ) { + $css_class[] = 'current-menu-parent'; + } + } elseif ( get_option( 'page_for_posts' ) == $page->ID ) { + $css_class[] = 'current-menu-parent'; + } + + $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) ); + + $args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before']; + $args['link_after'] = empty( $args['link_after'] ) ? '' : $args['link_after']; + + $output .= sprintf( + '
  • %s%s%s%s%s', + $css_classes, + get_permalink( $page->ID ), + $args['link_before'], + apply_filters( 'the_title', $page->post_title, $page->ID ), + $args['link_after'], + $icon, + $mobile_icon + ); + } + } + +} diff --git a/inc/core/class-gutenberg-editor-css.php b/inc/core/class-gutenberg-editor-css.php index c77182b..6a681b4 100644 --- a/inc/core/class-gutenberg-editor-css.php +++ b/inc/core/class-gutenberg-editor-css.php @@ -1,1116 +1,1116 @@ - array( - 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 6.25, '%' ), - ), - 'a' => array( - 'color' => esc_attr( $link_color ), - ), - - // Global selection CSS. - '.block-editor-block-list__layout .block-editor-block-list__block ::selection,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .editor-block-list__block-edit:before' => array( - 'background-color' => esc_attr( $theme_color ), - ), - '.block-editor-block-list__layout .block-editor-block-list__block ::selection,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .editor-block-list__block-edit' => array( - 'color' => esc_attr( $selection_text_color ), - ), - '.ast-separate-container .edit-post-visual-editor, .ast-page-builder-template .edit-post-visual-editor, .ast-plain-container .edit-post-visual-editor, .ast-separate-container #wpwrap #editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $box_bg_obj, 'desktop' ), - '.editor-post-title__block,.editor-default-block-appender,.block-editor-block-list__block' => array( - 'max-width' => astra_get_css_value( $site_content_width, 'px' ), - ), - '.block-editor-block-list__block[data-align=wide]' => array( - 'max-width' => astra_get_css_value( $site_content_width + 200, 'px' ), - ), - '.editor-post-title__block .editor-post-title__input, .edit-post-visual-editor .block-editor-block-list__block h1, .edit-post-visual-editor .block-editor-block-list__block h2, .edit-post-visual-editor .block-editor-block-list__block h3, .edit-post-visual-editor .block-editor-block-list__block h4, .edit-post-visual-editor .block-editor-block-list__block h5, .edit-post-visual-editor .block-editor-block-list__block h6' => array( - 'font-family' => astra_get_css_value( $headings_font_family, 'font' ), - 'font-weight' => astra_get_css_value( $headings_font_weight, 'font' ), - 'text-transform' => esc_attr( $headings_text_transform ), - ), - '.edit-post-visual-editor h1, .edit-post-visual-editor h2, .edit-post-visual-editor h3, .edit-post-visual-editor h4, .edit-post-visual-editor h5, .edit-post-visual-editor h6' => array( - 'line-height' => esc_attr( $headings_line_height ), - ), - '.edit-post-visual-editor.editor-styles-wrapper p,.block-editor-block-list__block p, .block-editor-block-list__layout, .editor-post-title' => array( - 'font-size' => astra_responsive_font( $body_font_size, 'desktop' ), - ), - '.edit-post-visual-editor.editor-styles-wrapper p,.block-editor-block-list__block p, .wp-block-latest-posts a,.editor-default-block-appender textarea.editor-default-block-appender__content, .block-editor-block-list__block, .block-editor-block-list__block h1, .block-editor-block-list__block h2, .block-editor-block-list__block h3, .block-editor-block-list__block h4, .block-editor-block-list__block h5, .block-editor-block-list__block h6, .edit-post-visual-editor .editor-styles-wrapper' => array( - 'font-family' => astra_get_font_family( $body_font_family ), - 'font-weight' => esc_attr( $body_font_weight ), - 'font-size' => astra_responsive_font( $body_font_size, 'desktop' ), - 'line-height' => esc_attr( $body_line_height ), - 'text-transform' => esc_attr( $body_text_transform ), - 'margin-bottom' => astra_get_css_value( $para_margin_bottom, 'em' ), - ), - '.editor-post-title__block .editor-post-title__input' => array( - 'font-family' => ( 'inherit' === $headings_font_family ) ? astra_get_font_family( $body_font_family ) : astra_get_font_family( $headings_font_family ), - 'font-size' => astra_responsive_font( $single_post_title_font_size, 'desktop' ), - 'font-weight' => 'normal', - ), - '.block-editor-block-list__block' => array( - 'color' => esc_attr( $text_color ), - ), - /** - * Content base heading color. - */ - '.editor-post-title__block .editor-post-title__input, .wc-block-grid__product-title, .edit-post-visual-editor .block-editor-block-list__block h1, .edit-post-visual-editor .block-editor-block-list__block h2, .edit-post-visual-editor .block-editor-block-list__block h3, .edit-post-visual-editor .block-editor-block-list__block h4, .edit-post-visual-editor .block-editor-block-list__block h5, .edit-post-visual-editor .block-editor-block-list__block h6, .edit-post-visual-editor .wp-block-heading, .edit-post-visual-editor .wp-block-uagb-advanced-heading h1, .edit-post-visual-editor .wp-block-uagb-advanced-heading h2, .edit-post-visual-editor .wp-block-uagb-advanced-heading h3, .edit-post-visual-editor .wp-block-uagb-advanced-heading h4, .edit-post-visual-editor .wp-block-uagb-advanced-heading h5, .edit-post-visual-editor .wp-block-uagb-advanced-heading h6' => array( - 'color' => esc_attr( $heading_base_color ), - ), - // Blockquote Text Color. - 'blockquote' => array( - 'color' => astra_adjust_brightness( $text_color, 75, 'darken' ), - ), - 'blockquote .editor-rich-text__tinymce a' => array( - 'color' => astra_hex_to_rgba( $link_color, 1 ), - ), - 'blockquote' => array( - 'border-color' => astra_hex_to_rgba( $link_color, 0.05 ), - ), - '.block-editor-block-list__block .wp-block-quote:not(.is-large):not(.is-style-large), .edit-post-visual-editor .wp-block-pullquote blockquote' => array( - 'border-color' => astra_hex_to_rgba( $link_color, 0.15 ), - ), - - // Heading H1 - H6 font size. - '.edit-post-visual-editor .block-editor-block-list__block h1, .wp-block-heading h1, .wp-block-freeform.block-library-rich-text__tinymce h1, .edit-post-visual-editor .wp-block-heading h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1, .edit-post-visual-editor h1.block-editor-block-list__block' => array( - 'font-size' => astra_responsive_font( $heading_h1_font_size, 'desktop' ), - 'font-family' => astra_get_css_value( $h1_font_family, 'font' ), - 'font-weight' => astra_get_css_value( $h1_font_weight, 'font' ), - 'line-height' => esc_attr( $h1_line_height ), - 'text-transform' => esc_attr( $h1_text_transform ), - ), - '.edit-post-visual-editor .block-editor-block-list__block h2, .wp-block-heading h2, .wp-block-freeform.block-library-rich-text__tinymce h2, .edit-post-visual-editor .wp-block-heading h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2, .edit-post-visual-editor h2.block-editor-block-list__block' => array( - 'font-size' => astra_responsive_font( $heading_h2_font_size, 'desktop' ), - 'font-family' => astra_get_css_value( $h2_font_family, 'font' ), - 'font-weight' => astra_get_css_value( $h2_font_weight, 'font' ), - 'line-height' => esc_attr( $h2_line_height ), - 'text-transform' => esc_attr( $h2_text_transform ), - ), - '.edit-post-visual-editor .block-editor-block-list__block h3, .wp-block-heading h3, .wp-block-freeform.block-library-rich-text__tinymce h3, .edit-post-visual-editor .wp-block-heading h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3, .edit-post-visual-editor h3.block-editor-block-list__block' => array( - 'font-size' => astra_responsive_font( $heading_h3_font_size, 'desktop' ), - 'font-family' => astra_get_css_value( $h3_font_family, 'font' ), - 'font-weight' => astra_get_css_value( $h3_font_weight, 'font' ), - 'line-height' => esc_attr( $h3_line_height ), - 'text-transform' => esc_attr( $h3_text_transform ), - ), - '.edit-post-visual-editor .block-editor-block-list__block h4, .wp-block-heading h4, .wp-block-freeform.block-library-rich-text__tinymce h4, .edit-post-visual-editor .wp-block-heading h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4, .edit-post-visual-editor h4.block-editor-block-list__block' => array( - 'font-size' => astra_responsive_font( $heading_h4_font_size, 'desktop' ), - 'line-height' => esc_attr( $h4_line_height ), - ), - '.edit-post-visual-editor .block-editor-block-list__block h5, .wp-block-heading h5, .wp-block-freeform.block-library-rich-text__tinymce h5, .edit-post-visual-editor .wp-block-heading h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5, .edit-post-visual-editor h5.block-editor-block-list__block' => array( - 'font-size' => astra_responsive_font( $heading_h5_font_size, 'desktop' ), - 'line-height' => esc_attr( $h5_line_height ), - ), - '.edit-post-visual-editor .block-editor-block-list__block h6, .wp-block-heading h6, .wp-block-freeform.block-library-rich-text__tinymce h6, .edit-post-visual-editor .wp-block-heading h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6, .edit-post-visual-editor h6.block-editor-block-list__block' => array( - 'font-size' => astra_responsive_font( $heading_h6_font_size, 'desktop' ), - 'line-height' => esc_attr( $h6_line_height ), - ), - /** - * WooCommerce Grid Products compatibility. - */ - '.wc-block-grid__product-title' => array( - 'color' => esc_attr( $text_color ), - ), - '.wc-block-grid__product .wc-block-grid__product-onsale' => array( - 'background-color' => $theme_color, - 'color' => astra_get_foreground_color( $theme_color ), - ), - '.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wp-block-button__link, .wc-block-grid__product-onsale' => array( - 'color' => $btn_color, - 'border-color' => $btn_bg_color, - 'background-color' => $btn_bg_color, - ), - '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array( - 'color' => $btn_h_color, - 'border-color' => $btn_bg_h_color, - 'background-color' => $btn_bg_h_color, - ), - '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( - 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), - ), - ); - - if ( astra_wp_version_compare( '5.7', '>=' ) ) { - $base_background_color = astra_get_responsive_background_obj( $box_bg_obj, 'desktop' ); - if ( empty( $base_background_color ) ) { - $background_style_data = array( - 'background-color' => '#ffffff', - ); - } else { - $background_style_data = $base_background_color; - } - - $desktop_css['.edit-post-visual-editor'] = array( - 'padding' => '20px', - 'padding-top' => 'calc(2em + 20px)', - ); - $desktop_css['.ast-page-builder-template .edit-post-visual-editor'] = array( - 'padding' => '0', - 'padding-top' => '2em', - ); - $desktop_css['.ast-separate-container .editor-post-title'] = array( - 'margin-top' => '0', - ); - $desktop_css['.editor-styles-wrapper .block-editor-writing-flow'] = array( - 'height' => '100%', - 'padding' => '10px', - ); - $desktop_css['.edit-post-visual-editor .editor-styles-wrapper'] = array( - 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), - 'width' => '100%', - 'margin' => '0 auto', - 'padding' => '0', - ); - $desktop_css['.ast-page-builder-template .edit-post-visual-editor .editor-styles-wrapper'] = array( - 'max-width' => '100%', - ); - $desktop_css['.ast-separate-container .edit-post-visual-editor .block-editor-block-list__layout .wp-block[data-align="full"] figure.wp-block-image, .ast-separate-container .edit-post-visual-editor .wp-block[data-align="full"] .wp-block-cover'] = array( - 'margin-left' => 'calc(-4.8em - 10px)', - 'margin-right' => 'calc(-4.8em - 10px)', - ); - $desktop_css['.ast-page-builder-template .editor-styles-wrapper .block-editor-writing-flow, .ast-plain-container .editor-styles-wrapper .block-editor-writing-flow, #editor .edit-post-visual-editor'] = $background_style_data; - } - - if ( ( ( ! in_array( 'single-title-meta', $single_post_title ) ) && ( 'post' === get_post_type() ) ) || ( 'disabled' === $title_enabled_from_meta ) ) { - $destop_title_css = array( - '.editor-post-title__block' => array( - 'opacity' => '0.2', - ), - ); - $css .= astra_parse_css( $destop_title_css ); - } - - $content_links_underline = astra_get_option( 'underline-content-links' ); - - if ( $content_links_underline ) { - $desktop_css['.edit-post-visual-editor a'] = array( - 'text-decoration' => 'underline', - ); - } - - $css .= astra_parse_css( $desktop_css ); - - /** - * Global button CSS - Tablet. - */ - $css_prod_button_tablet = array( - '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), - ), - ); - - if ( astra_wp_version_compare( '5.7', '>=' ) ) { - $css_prod_button_tablet['.ast-page-builder-template .editor-styles-wrapper .block-editor-writing-flow, .ast-plain-container .editor-styles-wrapper .block-editor-writing-flow'] = astra_get_responsive_background_obj( $box_bg_obj, 'tablet' ); - } - - $css .= astra_parse_css( $css_prod_button_tablet, '', astra_get_tablet_breakpoint() ); - - /** - * Global button CSS - Mobile. - */ - $css_prod_button_mobile = array( - '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), - ), - ); - - if ( astra_wp_version_compare( '5.7', '>=' ) ) { - $css_prod_button_mobile['.ast-page-builder-template .editor-styles-wrapper .block-editor-writing-flow, .ast-plain-container .editor-styles-wrapper .block-editor-writing-flow'] = astra_get_responsive_background_obj( $box_bg_obj, 'mobile' ); - } - - $css .= astra_parse_css( $css_prod_button_mobile, '', astra_get_mobile_breakpoint() ); - - $theme_btn_top_border = ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '1px'; - $theme_btn_right_border = ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '1px'; - $theme_btn_left_border = ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '1px'; - $theme_btn_bottom_border = ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '1px'; - - if ( Astra_Dynamic_CSS::page_builder_button_style_css() ) { - - $is_support_wp_5_8 = Astra_Dynamic_CSS::is_block_editor_support_enabled(); - $search_button_selector = $is_support_wp_5_8 ? ', .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' : ''; - $search_button_hover_selector = $is_support_wp_5_8 ? ', .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover, .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:focus' : ''; - - $button_desktop_css = array( - /** - * Gutenberg button compatibility for default styling. - */ - '.wp-block-button .wp-block-button__link' . $search_button_selector => array( - 'border-style' => 'solid', - 'border-top-width' => $theme_btn_top_border, - 'border-right-width' => $theme_btn_right_border, - 'border-left-width' => $theme_btn_left_border, - 'border-bottom-width' => $theme_btn_bottom_border, - 'color' => esc_attr( $btn_color ), - 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), - 'background-color' => esc_attr( $btn_bg_color ), - 'font-family' => astra_get_font_family( $theme_btn_font_family ), - 'font-weight' => esc_attr( $theme_btn_font_weight ), - 'line-height' => esc_attr( $theme_btn_line_height ), - 'text-transform' => esc_attr( $theme_btn_text_transform ), - 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), - 'font-size' => astra_responsive_font( $theme_btn_font_size, 'desktop' ), - 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), - ), - '.wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' . $search_button_hover_selector => array( - 'color' => esc_attr( $btn_h_color ), - 'background-color' => esc_attr( $btn_bg_h_color ), - 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_h_color ) : esc_attr( $btn_border_h_color ), - ), - ); - - if ( $is_support_wp_5_8 ) { - $button_desktop_css['.wp-block-search .wp-block-search__input, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper'] = array( - 'border-color' => '#eaeaea', - 'background' => '#fafafa', - ); - $button_desktop_css['.block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__input'] = array( - 'padding' => '15px', - ); - $button_desktop_css['.wp-block-search__button svg'] = array( - 'fill' => 'currentColor', - ); - } - - $css .= astra_parse_css( $button_desktop_css ); - - /** - * Global button CSS - Tablet. - */ - $css_global_button_tablet = array( - '.wp-block-button .wp-block-button__link' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), - ), - ); - - $css .= astra_parse_css( $css_global_button_tablet, '', astra_get_tablet_breakpoint() ); - - /** - * Global button CSS - Mobile. - */ - $css_global_button_mobile = array( - '.wp-block-button .wp-block-button__link' => array( - 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), - 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), - 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), - 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), - ), - ); - - $css .= astra_parse_css( $css_global_button_mobile, '', astra_get_mobile_breakpoint() ); - } - - if ( Astra_Dynamic_CSS::gutenberg_core_patterns_compat() ) { - - $link_hover_color = astra_get_option( 'link-h-color' ); - $btn_text_hover_color = astra_get_option( 'button-h-color' ); - if ( empty( $btn_text_hover_color ) ) { - $btn_text_hover_color = astra_get_foreground_color( $link_hover_color ); - } - - /** - * When supporting GB button outline patterns in v3.3.0 we have given 2px as default border for GB outline button, where we restrict button border for flat type buttons. - * But now while reverting this change there is no need of default border because whatever customizer border will set it should behave accordingly. Although it is empty ('') WP applying 2px as default border for outline buttons. - * - * @since 3.6.3 - */ - $default_border_size = '2px'; - if ( ! astra_button_default_padding_updated() ) { - $default_border_size = ''; - } - - // Outline Gutenberg button compatibility CSS. - $theme_btn_top_border = ( isset( $global_custom_button_border_size['top'] ) && ( '' !== $global_custom_button_border_size['top'] && '0' !== $global_custom_button_border_size['top'] ) ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : $default_border_size; - $theme_btn_right_border = ( isset( $global_custom_button_border_size['right'] ) && ( '' !== $global_custom_button_border_size['right'] && '0' !== $global_custom_button_border_size['right'] ) ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : $default_border_size; - $theme_btn_left_border = ( isset( $global_custom_button_border_size['left'] ) && ( '' !== $global_custom_button_border_size['left'] && '0' !== $global_custom_button_border_size['left'] ) ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : $default_border_size; - $theme_btn_bottom_border = ( isset( $global_custom_button_border_size['bottom'] ) && ( '' !== $global_custom_button_border_size['bottom'] && '0' !== $global_custom_button_border_size['bottom'] ) ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : $default_border_size; - - // Added CSS compatibility support for Gutenberg pattern. - $button_patterns_compat_css = array( - '.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color), .wp-block-button.wp-block-button__link.is-style-outline:not(.has-text-color)' => array( - 'color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), - ), - '.wp-block-button.is-style-outline .wp-block-button__link:hover, .wp-block-button.is-style-outline .wp-block-button__link:focus' => array( - 'color' => esc_attr( $btn_text_hover_color ) . ' !important', - ), - '.wp-block-button.is-style-outline .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' => array( - 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_h_color ) : esc_attr( $btn_border_h_color ), - ), - ); - - if ( ! astra_button_default_padding_updated() ) { - $button_patterns_compat_css['.wp-block-button .wp-block-button__link'] = array( - 'border' => 'none', - 'padding' => '15px 30px', - ); - $button_patterns_compat_css['.wp-block-button.is-style-outline .wp-block-button__link'] = array( - 'border-style' => 'solid', - 'border-top-width' => esc_attr( $theme_btn_top_border ), - 'border-right-width' => esc_attr( $theme_btn_right_border ), - 'border-bottom-width' => esc_attr( $theme_btn_bottom_border ), - 'border-left-width' => esc_attr( $theme_btn_left_border ), - 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), - 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', - 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', - 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', - 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', - ); - } - - $css .= astra_parse_css( $button_patterns_compat_css ); - - if ( ! astra_button_default_padding_updated() ) { - // Tablet CSS. - $button_patterns_tablet_compat_css = array( - '.wp-block-button .wp-block-button__link' => array( - 'border' => 'none', - 'padding' => '15px 30px', - ), - '.wp-block-button.is-style-outline .wp-block-button__link' => array( - 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', - 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', - 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', - 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', - ), - ); - - $css .= astra_parse_css( $button_patterns_tablet_compat_css, '', astra_get_tablet_breakpoint() ); - - // Mobile CSS. - $button_patterns_mobile_compat_css = array( - '.wp-block-button .wp-block-button__link' => array( - 'border' => 'none', - 'padding' => '15px 30px', - ), - '.wp-block-button.is-style-outline .wp-block-button__link' => array( - 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', - 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', - 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', - 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', - ), - ); - - $css .= astra_parse_css( $button_patterns_mobile_compat_css, '', astra_get_mobile_breakpoint() ); - } - - if ( $is_site_rtl ) { - $gb_patterns_min_mobile_css = array( - '.editor-styles-wrapper .alignleft' => array( - 'margin-left' => '20px', - ), - '.editor-styles-wrapper .alignright' => array( - 'margin-right' => '20px', - ), - ); - } else { - $gb_patterns_min_mobile_css = array( - '.editor-styles-wrapper .alignleft' => array( - 'margin-right' => '20px', - ), - '.editor-styles-wrapper .alignright' => array( - 'margin-left' => '20px', - ), - ); - } - - if ( ! astra_button_default_padding_updated() ) { - $gb_patterns_min_mobile_css['.editor-styles-wrapper p.has-background'] = array( - 'padding' => '20px', - ); - } - - /* Parse CSS from array() -> min-width: (mobile-breakpoint) px CSS */ - $css .= astra_parse_css( $gb_patterns_min_mobile_css ); - } - - if ( Astra_Dynamic_CSS::gutenberg_core_blocks_css_comp() ) { - - $desktop_screen_gb_css = array( - '.wp-block-columns' => array( - 'margin-bottom' => 'unset', - ), - 'figure.size-full' => array( - 'margin' => '2rem 0', - ), - '.wp-block-gallery' => array( - 'margin-bottom' => '1.6em', - ), - '.wp-block-group' => array( - 'padding-top' => '4em', - 'padding-bottom' => '4em', - ), - '.wp-block-group__inner-container:last-child, .wp-block-table table' => array( - 'margin-bottom' => '0', - ), - '.blocks-gallery-grid' => array( - 'width' => '100%', - ), - '.wp-block-navigation-link__content' => array( - 'padding' => '5px 0', - ), - '.wp-block-group .wp-block-group .has-text-align-center, .wp-block-group .wp-block-column .has-text-align-center' => array( - 'max-width' => '100%', - ), - '.has-text-align-center' => array( - 'margin' => '0 auto', - ), - ); - - /* Parse CSS from array() -> Desktop CSS */ - $css .= astra_parse_css( $desktop_screen_gb_css ); - - $middle_screen_min_gb_css = array( - '.wp-block-cover__inner-container, .alignwide .wp-block-group__inner-container, .alignfull .wp-block-group__inner-container' => array( - 'max-width' => '1200px', - 'margin' => '0 auto', - ), - '.wp-block-group.alignnone, .wp-block-group.aligncenter, .wp-block-group.alignleft, .wp-block-group.alignright, .wp-block-group.alignwide, .wp-block-columns.alignwide' => array( - 'margin' => '2rem 0 1rem 0', - ), - ); - - /* Parse CSS from array() -> min-width: (1200)px CSS */ - $css .= astra_parse_css( $middle_screen_min_gb_css, '1200' ); - - $middle_screen_max_gb_css = array( - '.wp-block-group' => array( - 'padding' => '3em', - ), - '.wp-block-group .wp-block-group' => array( - 'padding' => '1.5em', - ), - '.wp-block-columns, .wp-block-column' => array( - 'margin' => '1rem 0', - ), - ); - - /* Parse CSS from array() -> max-width: (1200)px CSS */ - $css .= astra_parse_css( $middle_screen_max_gb_css, '', '1200' ); - - $tablet_screen_min_gb_css = array( - '.wp-block-columns .wp-block-group' => array( - 'padding' => '2em', - ), - ); - - /* Parse CSS from array() -> min-width: (tablet-breakpoint)px CSS */ - $css .= astra_parse_css( $tablet_screen_min_gb_css, astra_get_tablet_breakpoint() ); - - $mobile_screen_max_gb_css = array( - '.wp-block-media-text .wp-block-media-text__content' => array( - 'padding' => '3em 2em', - ), - '.wp-block-cover-image .wp-block-cover__inner-container, .wp-block-cover .wp-block-cover__inner-container' => array( - 'width' => 'unset', - ), - '.wp-block-cover, .wp-block-cover-image' => array( - 'padding' => '2em 0', - ), - '.wp-block-group, .wp-block-cover' => array( - 'padding' => '2em', - ), - '.wp-block-media-text__media img, .wp-block-media-text__media video' => array( - 'width' => 'unset', - 'max-width' => '100%', - ), - '.wp-block-media-text.has-background .wp-block-media-text__content' => array( - 'padding' => '1em', - ), - ); - - /* Parse CSS from array() -> max-width: (mobile-breakpoint)px CSS */ - $css .= astra_parse_css( $mobile_screen_max_gb_css, '', astra_get_mobile_breakpoint() ); - } - - if ( Astra_Dynamic_CSS::gutenberg_core_patterns_compat() ) { - - // Added CSS compatibility support for Gutenberg Editor's Media & Text block pattern. - if ( $is_site_rtl ) { - $gb_editor_block_pattern_css = array( - '.wp-block-media-text .wp-block-media-text__content .wp-block-group__inner-container' => array( - 'padding' => '0 8% 0 0', - ), - '.ast-separate-container .block-editor-block-list__layout .wp-block[data-align="full"] .wp-block[data-align="center"] > .wp-block-image' => array( - 'margin-right' => 'auto', - 'margin-left' => 'auto', - ), - ); - } else { - $gb_editor_block_pattern_css = array( - '.wp-block-media-text .wp-block-media-text__content .wp-block-group__inner-container' => array( - 'padding' => '0 0 0 8%', - ), - '.ast-separate-container .block-editor-block-list__layout .wp-block[data-align="full"] .wp-block[data-align="center"] > .wp-block-image' => array( - 'margin-right' => 'auto', - 'margin-left' => 'auto', - ), - ); - } - - $gb_editor_block_pattern_css['.block-editor-block-list__layout * .block-editor-block-list__block'] = array( - 'padding-left' => '20px', - 'padding-right' => '20px', - ); - - $css .= astra_parse_css( $gb_editor_block_pattern_css ); - } - - $tablet_css = array( - '.editor-post-title__block .editor-post-title__input' => array( - 'font-size' => astra_responsive_font( $single_post_title_font_size, 'tablet', 30 ), - ), - // Heading H1 - H6 font size. - '.edit-post-visual-editor h1, .wp-block-heading h1, .wp-block-freeform.block-library-rich-text__tinymce h1, .edit-post-visual-editor .wp-block-heading h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1' => array( - 'font-size' => astra_responsive_font( $heading_h1_font_size, 'tablet', 30 ), - ), - '.edit-post-visual-editor h2, .wp-block-heading h2, .wp-block-freeform.block-library-rich-text__tinymce h2, .edit-post-visual-editor .wp-block-heading h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2' => array( - 'font-size' => astra_responsive_font( $heading_h2_font_size, 'tablet', 25 ), - ), - '.edit-post-visual-editor h3, .wp-block-heading h3, .wp-block-freeform.block-library-rich-text__tinymce h3, .edit-post-visual-editor .wp-block-heading h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3' => array( - 'font-size' => astra_responsive_font( $heading_h3_font_size, 'tablet', 20 ), - ), - '.edit-post-visual-editor h4, .wp-block-heading h4, .wp-block-freeform.block-library-rich-text__tinymce h4, .edit-post-visual-editor .wp-block-heading h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4' => array( - 'font-size' => astra_responsive_font( $heading_h4_font_size, 'tablet' ), - ), - '.edit-post-visual-editor h5, .wp-block-heading h5, .wp-block-freeform.block-library-rich-text__tinymce h5, .edit-post-visual-editor .wp-block-heading h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5' => array( - 'font-size' => astra_responsive_font( $heading_h5_font_size, 'tablet' ), - ), - '.edit-post-visual-editor h6, .wp-block-heading h6, .wp-block-freeform.block-library-rich-text__tinymce h6, .edit-post-visual-editor .wp-block-heading h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6' => array( - 'font-size' => astra_responsive_font( $heading_h6_font_size, 'tablet' ), - ), - '.ast-separate-container .edit-post-visual-editor, .ast-page-builder-template .edit-post-visual-editor, .ast-plain-container .edit-post-visual-editor, .ast-separate-container #wpwrap #editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $box_bg_obj, 'tablet' ), - ); - - $css .= astra_parse_css( $tablet_css, '', astra_get_tablet_breakpoint() ); - - $mobile_css = array( - '.editor-post-title__block .editor-post-title__input' => array( - 'font-size' => astra_responsive_font( $single_post_title_font_size, 'mobile', 30 ), - ), - - // Heading H1 - H6 font size. - '.edit-post-visual-editor h1, .wp-block-heading h1, .wp-block-freeform.block-library-rich-text__tinymce h1, .edit-post-visual-editor .wp-block-heading h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1' => array( - 'font-size' => astra_responsive_font( $heading_h1_font_size, 'mobile', 30 ), - ), - '.edit-post-visual-editor h2, .wp-block-heading h2, .wp-block-freeform.block-library-rich-text__tinymce h2, .edit-post-visual-editor .wp-block-heading h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2' => array( - 'font-size' => astra_responsive_font( $heading_h2_font_size, 'mobile', 25 ), - ), - '.edit-post-visual-editor h3, .wp-block-heading h3, .wp-block-freeform.block-library-rich-text__tinymce h3, .edit-post-visual-editor .wp-block-heading h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3' => array( - 'font-size' => astra_responsive_font( $heading_h3_font_size, 'mobile', 20 ), - ), - '.edit-post-visual-editor h4, .wp-block-heading h4, .wp-block-freeform.block-library-rich-text__tinymce h4, .edit-post-visual-editor .wp-block-heading h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4' => array( - 'font-size' => astra_responsive_font( $heading_h4_font_size, 'mobile' ), - ), - '.edit-post-visual-editor h5, .wp-block-heading h5, .wp-block-freeform.block-library-rich-text__tinymce h5, .edit-post-visual-editor .wp-block-heading h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5' => array( - 'font-size' => astra_responsive_font( $heading_h5_font_size, 'mobile' ), - ), - '.edit-post-visual-editor h6, .wp-block-heading h6, .wp-block-freeform.block-library-rich-text__tinymce h6, .edit-post-visual-editor .wp-block-heading h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6' => array( - 'font-size' => astra_responsive_font( $heading_h6_font_size, 'mobile' ), - ), - '.ast-separate-container .edit-post-visual-editor, .ast-page-builder-template .edit-post-visual-editor, .ast-plain-container .edit-post-visual-editor, .ast-separate-container #wpwrap #editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $box_bg_obj, 'mobile' ), - ); - - $css .= astra_parse_css( $mobile_css, '', astra_get_mobile_breakpoint() ); - - if ( is_callable( 'Astra_Woocommerce::astra_global_btn_woo_comp' ) && Astra_Woocommerce::astra_global_btn_woo_comp() ) { - - $woo_global_button_css = array( - '.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( - 'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '0', - 'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '0', - 'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '0', - 'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '0', - 'border-color' => $btn_border_color ? $btn_border_color : $btn_bg_color, - ), - '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array( - 'border-color' => $btn_bg_h_color, - ), - ); - $css .= astra_parse_css( $woo_global_button_css ); - } - - if ( astra_wp_version_compare( '5.4.99', '>=' ) ) { - - $page_builder_css = array( - '.ast-page-builder-template .editor-post-title__block, .ast-page-builder-template .editor-default-block-appender' => array( - 'width' => '100%', - 'max-width' => '100%', - ), - '.ast-page-builder-template .wp-block[data-align="right"] > *' => array( - 'max-width' => 'unset', - 'width' => 'unset', - ), - '.ast-page-builder-template .block-editor-block-list__layout' => array( - 'padding-left' => 0, - 'padding-right' => 0, - ), - '.ast-page-builder-template .editor-block-list__block-edit' => array( - 'padding-left' => '20px', - 'padding-right' => '20px', - ), - '.ast-page-builder-template .editor-block-list__block-edit .editor-block-list__block-edit' => array( - 'padding-left' => '0', - 'padding-right' => '0', - ), - ); - - } else { - - $page_builder_css = array( - '.ast-page-builder-template .editor-post-title__block, .ast-page-builder-template .editor-default-block-appender, .ast-page-builder-template .block-editor-block-list__block' => array( - 'width' => '100%', - 'max-width' => '100%', - ), - '.ast-page-builder-template .block-editor-block-list__layout' => array( - 'padding-left' => 0, - 'padding-right' => 0, - ), - '.ast-page-builder-template .editor-block-list__block-edit' => array( - 'padding-left' => '20px', - 'padding-right' => '20px', - ), - '.ast-page-builder-template .editor-block-list__block-edit .editor-block-list__block-edit' => array( - 'padding-left' => '0', - 'padding-right' => '0', - ), - ); - } - - $css .= astra_parse_css( $page_builder_css ); - - $aligned_full_content_css = array( - '.ast-page-builder-template .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit, .ast-plain-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit' => array( - 'margin-left' => '0', - 'margin-right' => '0', - ), - '.ast-page-builder-template .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"], .ast-plain-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"]' => array( - 'margin-left' => '0', - 'margin-right' => '0', - ), - ); - - $css .= astra_parse_css( $aligned_full_content_css ); - - $boxed_container = array( - '.ast-separate-container .block-editor-writing-flow, .ast-two-container .block-editor-writing-flow' => array( - 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), - 'margin' => '0 auto', - 'background-color' => '#fff', - ), - '.ast-separate-container .gutenberg__editor, .ast-two-container .gutenberg__editor' => array( - 'background-color' => '#f5f5f5', - ), - - '.ast-separate-container .block-editor-block-list__layout, .ast-two-container .editor-block-list__layout' => array( - 'padding-top' => '0', - ), - - '.ast-two-container .editor-post-title, .ast-separate-container .block-editor-block-list__layout, .ast-two-container .editor-post-title' => array( - 'padding-top' => 'calc( 5.34em - 19px)', - 'padding-bottom' => '5.34em', - 'padding-left' => 'calc( 6.67em - 28px )', - 'padding-right' => 'calc( 6.67em - 28px )', - ), - '.ast-separate-container .block-editor-block-list__layout' => array( - 'padding-top' => '0', - 'padding-bottom' => '5.34em', - 'padding-left' => 'calc( 6.67em - 28px )', - 'padding-right' => 'calc( 6.67em - 28px )', - ), - '.ast-separate-container .editor-post-title' => array( - 'padding-top' => 'calc( 5.34em - 19px)', - 'padding-bottom' => '5.34em', - 'padding-left' => 'calc( 6.67em - 28px )', - 'padding-right' => 'calc( 6.67em - 28px )', - ), - - '.ast-separate-container .editor-post-title, .ast-two-container .editor-post-title' => array( - 'padding-bottom' => '0', - ), - '.ast-separate-container .editor-block-list__block, .ast-two-container .editor-block-list__block' => array( - 'max-width' => 'calc(' . astra_get_css_value( $site_content_width, 'px' ) . ' - 6.67em)', - ), - '.ast-separate-container .editor-block-list__block[data-align=wide], .ast-two-container .editor-block-list__block[data-align=wide]' => array( - 'margin-left' => '-20px', - 'margin-right' => '-20px', - ), - '.ast-separate-container .editor-block-list__block[data-align=full], .ast-two-container .editor-block-list__block[data-align=full]' => array( - 'margin-left' => '-6.67em', - 'margin-right' => '-6.67em', - ), - '.ast-separate-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"], .ast-separate-container .block-editor-block-list__layout .editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit, .ast-two-container .block-editor-block-list__layout .editor-block-list__block[data-align="full"], .ast-two-container .block-editor-block-list__layout .editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit' => array( - 'margin-left' => '0', - 'margin-right' => '0', - ), - ); - - $css .= astra_parse_css( $boxed_container ); - - // Manage the extra padding applied in the block inster preview of blocks. - $block_inserter_css = array( - '.ast-separate-container .block-editor-inserter__preview .block-editor-block-list__layout' => array( - 'padding-top' => '0px', - 'padding-bottom' => '0px', - 'padding-left' => '0px', - 'padding-right' => '0px', - ), - ); - - $css .= astra_parse_css( $block_inserter_css ); - - // WP 5.5 compatibility fix the extra padding applied for the block patterns in the editor view. - if ( astra_wp_version_compare( '5.4.99', '>=' ) ) { - - $block_pattern_css = array( - '.ast-separate-container .block-editor-inserter__panel-content .block-editor-block-list__layout' => array( - 'padding-top' => '0px', - 'padding-bottom' => '0px', - 'padding-left' => '0px', - 'padding-right' => '0px', - - ), - '.block-editor-inserter__panel-content .block-editor-block-list__layout' => array( - 'margin-left' => '60px', - 'margin-right' => '60px', - ), - '.block-editor-inserter__panel-content .block-editor-block-list__layout .block-editor-block-list__layout' => array( - 'margin-left' => '0px', - 'margin-right' => '0px', - ), - '.ast-page-builder-template .block-editor-inserter__panel-content .block-editor-block-list__layout' => array( - 'margin-left' => '0px', - 'margin-right' => '0px', - ), - ); - - $css .= astra_parse_css( $block_pattern_css ); - } else { - $full_width_streched_css = array( - '.ast-page-builder-template .block-editor-block-list__layout' => array( - 'margin-left' => '60px', - 'margin-right' => '60px', - ), - '.ast-page-builder-template .block-editor-block-list__layout .block-editor-block-list__layout' => array( - 'margin-left' => '0px', - 'margin-right' => '0px', - ), - ); - - $css .= astra_parse_css( $full_width_streched_css ); - } - - $ast_gtn_mobile_css = array( - '.ast-separate-container .editor-post-title' => array( - 'padding-top' => 'calc( 2.34em - 19px)', - 'padding-left' => 'calc( 3.67em - 28px )', - 'padding-right' => 'calc( 3.67em - 28px )', - ), - '.ast-separate-container .block-editor-block-list__layout' => array( - 'padding-bottom' => '2.34em', - 'padding-left' => 'calc( 3.67em - 28px )', - 'padding-right' => 'calc( 3.67em - 28px )', - ), - '.ast-page-builder-template .block-editor-block-list__layout' => array( - 'margin-left' => '30px', - 'margin-right' => '30px', - ), - '.ast-plain-container .block-editor-block-list__layout' => array( - 'padding-left' => '30px', - 'padding-right' => '30px', - ), - ); - - $css .= astra_parse_css( $ast_gtn_mobile_css, '', astra_get_mobile_breakpoint() ); - - if ( astra_wp_version_compare( '5.4.99', '>=' ) ) { - $gtn_full_wide_image_css = array( - '.wp-block[data-align="left"], .wp-block[data-align="right"], .wp-block[data-align="center"]' => array( - 'max-width' => '100%', - 'width' => '100%', - ), - '.ast-separate-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > .wp-block[data-align="full"], .ast-plain-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > .wp-block[data-align="full"]' => array( - 'margin-left' => 'auto', - 'margin-right' => 'auto', - ), - '.ast-separate-container .block-editor-block-list__layout .wp-block[data-align="full"] figure.wp-block-image' => array( - 'margin-left' => '-4.8em', - 'margin-right' => '-4.81em', - 'max-width' => 'unset', - 'width' => 'unset', - ), - '.ast-separate-container .wp-block[data-align="full"] .wp-block-cover' => array( - 'margin-left' => '-4.8em', - 'margin-right' => '-4.81em', - 'max-width' => 'unset', - 'width' => 'unset', - ), - '.ast-plain-container .wp-block[data-align="left"], .ast-plain-container .wp-block[data-align="right"], .ast-plain-container .wp-block[data-align="center"], .ast-plain-container .wp-block[data-align="full"]' => array( - 'max-width' => astra_get_css_value( $site_content_width, 'px' ), - ), - '.ast-plain-container .wp-block[data-align="wide"]' => array( - 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), - ), - ); - } else { - $gtn_full_wide_image_css = array( - '.ast-separate-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] figure.wp-block-image' => array( - 'margin-left' => '-4.8em', - 'margin-right' => '-4.81em', - 'max-width' => 'unset', - 'width' => 'unset', - ), - '.ast-separate-container .block-editor-block-list__block[data-align="full"] .wp-block-cover' => array( - 'margin-left' => '-4.8em', - 'margin-right' => '-4.81em', - 'max-width' => 'unset', - 'width' => 'unset', - ), - ); - } - - $css .= astra_parse_css( $gtn_full_wide_image_css ); - - if ( in_array( $pagenow, array( 'post-new.php' ) ) && ! isset( $post ) ) { - - $boxed_container = array( - '.block-editor-writing-flow' => array( - 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), - 'margin' => '0 auto', - 'background-color' => '#fff', - ), - '.gutenberg__editor' => array( - 'background-color' => '#f5f5f5', - ), - '.block-editor-block-list__layout, .editor-post-title' => array( - 'padding-top' => 'calc( 5.34em - 19px)', - 'padding-bottom' => '5.34em', - 'padding-left' => 'calc( 6.67em - 28px )', - 'padding-right' => 'calc( 6.67em - 28px )', - ), - '.block-editor-block-list__layout' => array( - 'padding-top' => '0', - ), - '.editor-post-title' => array( - 'padding-bottom' => '0', - ), - '.block-editor-block-list__block' => array( - 'max-width' => 'calc(' . astra_get_css_value( $site_content_width, 'px' ) . ' - 6.67em)', - ), - '.block-editor-block-list__block[data-align=wide]' => array( - 'margin-left' => '-20px', - 'margin-right' => '-20px', - ), - '.block-editor-block-list__block[data-align=full]' => array( - 'margin-left' => '-6.67em', - 'margin-right' => '-6.67em', - ), - '.block-editor-block-list__layout .block-editor-block-list__block[data-align="full"], .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] > .editor-block-list__block-edit' => array( - 'margin-left' => '0', - 'margin-right' => '0', - ), - ); - - $css .= astra_parse_css( $boxed_container ); - - } - - return $css; - } - } - -endif; + array( + 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 6.25, '%' ), + ), + 'a' => array( + 'color' => esc_attr( $link_color ), + ), + + // Global selection CSS. + '.block-editor-block-list__layout .block-editor-block-list__block ::selection,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .editor-block-list__block-edit:before' => array( + 'background-color' => esc_attr( $theme_color ), + ), + '.block-editor-block-list__layout .block-editor-block-list__block ::selection,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .editor-block-list__block-edit' => array( + 'color' => esc_attr( $selection_text_color ), + ), + '.ast-separate-container .edit-post-visual-editor, .ast-page-builder-template .edit-post-visual-editor, .ast-plain-container .edit-post-visual-editor, .ast-separate-container #wpwrap #editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $box_bg_obj, 'desktop' ), + '.editor-post-title__block,.editor-default-block-appender,.block-editor-block-list__block' => array( + 'max-width' => astra_get_css_value( $site_content_width, 'px' ), + ), + '.block-editor-block-list__block[data-align=wide]' => array( + 'max-width' => astra_get_css_value( $site_content_width + 200, 'px' ), + ), + '.editor-post-title__block .editor-post-title__input, .edit-post-visual-editor .block-editor-block-list__block h1, .edit-post-visual-editor .block-editor-block-list__block h2, .edit-post-visual-editor .block-editor-block-list__block h3, .edit-post-visual-editor .block-editor-block-list__block h4, .edit-post-visual-editor .block-editor-block-list__block h5, .edit-post-visual-editor .block-editor-block-list__block h6' => array( + 'font-family' => astra_get_css_value( $headings_font_family, 'font' ), + 'font-weight' => astra_get_css_value( $headings_font_weight, 'font' ), + 'text-transform' => esc_attr( $headings_text_transform ), + ), + '.edit-post-visual-editor h1, .edit-post-visual-editor h2, .edit-post-visual-editor h3, .edit-post-visual-editor h4, .edit-post-visual-editor h5, .edit-post-visual-editor h6' => array( + 'line-height' => esc_attr( $headings_line_height ), + ), + '.edit-post-visual-editor.editor-styles-wrapper p,.block-editor-block-list__block p, .block-editor-block-list__layout, .editor-post-title' => array( + 'font-size' => astra_responsive_font( $body_font_size, 'desktop' ), + ), + '.edit-post-visual-editor.editor-styles-wrapper p,.block-editor-block-list__block p, .wp-block-latest-posts a,.editor-default-block-appender textarea.editor-default-block-appender__content, .block-editor-block-list__block, .block-editor-block-list__block h1, .block-editor-block-list__block h2, .block-editor-block-list__block h3, .block-editor-block-list__block h4, .block-editor-block-list__block h5, .block-editor-block-list__block h6, .edit-post-visual-editor .editor-styles-wrapper' => array( + 'font-family' => astra_get_font_family( $body_font_family ), + 'font-weight' => esc_attr( $body_font_weight ), + 'font-size' => astra_responsive_font( $body_font_size, 'desktop' ), + 'line-height' => esc_attr( $body_line_height ), + 'text-transform' => esc_attr( $body_text_transform ), + 'margin-bottom' => astra_get_css_value( $para_margin_bottom, 'em' ), + ), + '.editor-post-title__block .editor-post-title__input' => array( + 'font-family' => ( 'inherit' === $headings_font_family ) ? astra_get_font_family( $body_font_family ) : astra_get_font_family( $headings_font_family ), + 'font-size' => astra_responsive_font( $single_post_title_font_size, 'desktop' ), + 'font-weight' => 'normal', + ), + '.block-editor-block-list__block' => array( + 'color' => esc_attr( $text_color ), + ), + /** + * Content base heading color. + */ + '.editor-post-title__block .editor-post-title__input, .wc-block-grid__product-title, .edit-post-visual-editor .block-editor-block-list__block h1, .edit-post-visual-editor .block-editor-block-list__block h2, .edit-post-visual-editor .block-editor-block-list__block h3, .edit-post-visual-editor .block-editor-block-list__block h4, .edit-post-visual-editor .block-editor-block-list__block h5, .edit-post-visual-editor .block-editor-block-list__block h6, .edit-post-visual-editor .wp-block-heading, .edit-post-visual-editor .wp-block-uagb-advanced-heading h1, .edit-post-visual-editor .wp-block-uagb-advanced-heading h2, .edit-post-visual-editor .wp-block-uagb-advanced-heading h3, .edit-post-visual-editor .wp-block-uagb-advanced-heading h4, .edit-post-visual-editor .wp-block-uagb-advanced-heading h5, .edit-post-visual-editor .wp-block-uagb-advanced-heading h6' => array( + 'color' => esc_attr( $heading_base_color ), + ), + // Blockquote Text Color. + 'blockquote' => array( + 'color' => astra_adjust_brightness( $text_color, 75, 'darken' ), + ), + 'blockquote .editor-rich-text__tinymce a' => array( + 'color' => astra_hex_to_rgba( $link_color, 1 ), + ), + 'blockquote' => array( + 'border-color' => astra_hex_to_rgba( $link_color, 0.05 ), + ), + '.block-editor-block-list__block .wp-block-quote:not(.is-large):not(.is-style-large), .edit-post-visual-editor .wp-block-pullquote blockquote' => array( + 'border-color' => astra_hex_to_rgba( $link_color, 0.15 ), + ), + + // Heading H1 - H6 font size. + '.edit-post-visual-editor .block-editor-block-list__block h1, .wp-block-heading h1, .wp-block-freeform.block-library-rich-text__tinymce h1, .edit-post-visual-editor .wp-block-heading h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1, .edit-post-visual-editor h1.block-editor-block-list__block' => array( + 'font-size' => astra_responsive_font( $heading_h1_font_size, 'desktop' ), + 'font-family' => astra_get_css_value( $h1_font_family, 'font' ), + 'font-weight' => astra_get_css_value( $h1_font_weight, 'font' ), + 'line-height' => esc_attr( $h1_line_height ), + 'text-transform' => esc_attr( $h1_text_transform ), + ), + '.edit-post-visual-editor .block-editor-block-list__block h2, .wp-block-heading h2, .wp-block-freeform.block-library-rich-text__tinymce h2, .edit-post-visual-editor .wp-block-heading h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2, .edit-post-visual-editor h2.block-editor-block-list__block' => array( + 'font-size' => astra_responsive_font( $heading_h2_font_size, 'desktop' ), + 'font-family' => astra_get_css_value( $h2_font_family, 'font' ), + 'font-weight' => astra_get_css_value( $h2_font_weight, 'font' ), + 'line-height' => esc_attr( $h2_line_height ), + 'text-transform' => esc_attr( $h2_text_transform ), + ), + '.edit-post-visual-editor .block-editor-block-list__block h3, .wp-block-heading h3, .wp-block-freeform.block-library-rich-text__tinymce h3, .edit-post-visual-editor .wp-block-heading h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3, .edit-post-visual-editor h3.block-editor-block-list__block' => array( + 'font-size' => astra_responsive_font( $heading_h3_font_size, 'desktop' ), + 'font-family' => astra_get_css_value( $h3_font_family, 'font' ), + 'font-weight' => astra_get_css_value( $h3_font_weight, 'font' ), + 'line-height' => esc_attr( $h3_line_height ), + 'text-transform' => esc_attr( $h3_text_transform ), + ), + '.edit-post-visual-editor .block-editor-block-list__block h4, .wp-block-heading h4, .wp-block-freeform.block-library-rich-text__tinymce h4, .edit-post-visual-editor .wp-block-heading h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4, .edit-post-visual-editor h4.block-editor-block-list__block' => array( + 'font-size' => astra_responsive_font( $heading_h4_font_size, 'desktop' ), + 'line-height' => esc_attr( $h4_line_height ), + ), + '.edit-post-visual-editor .block-editor-block-list__block h5, .wp-block-heading h5, .wp-block-freeform.block-library-rich-text__tinymce h5, .edit-post-visual-editor .wp-block-heading h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5, .edit-post-visual-editor h5.block-editor-block-list__block' => array( + 'font-size' => astra_responsive_font( $heading_h5_font_size, 'desktop' ), + 'line-height' => esc_attr( $h5_line_height ), + ), + '.edit-post-visual-editor .block-editor-block-list__block h6, .wp-block-heading h6, .wp-block-freeform.block-library-rich-text__tinymce h6, .edit-post-visual-editor .wp-block-heading h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6, .edit-post-visual-editor h6.block-editor-block-list__block' => array( + 'font-size' => astra_responsive_font( $heading_h6_font_size, 'desktop' ), + 'line-height' => esc_attr( $h6_line_height ), + ), + /** + * WooCommerce Grid Products compatibility. + */ + '.wc-block-grid__product-title' => array( + 'color' => esc_attr( $text_color ), + ), + '.wc-block-grid__product .wc-block-grid__product-onsale' => array( + 'background-color' => $theme_color, + 'color' => astra_get_foreground_color( $theme_color ), + ), + '.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wp-block-button__link, .wc-block-grid__product-onsale' => array( + 'color' => $btn_color, + 'border-color' => $btn_bg_color, + 'background-color' => $btn_bg_color, + ), + '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array( + 'color' => $btn_h_color, + 'border-color' => $btn_bg_h_color, + 'background-color' => $btn_bg_h_color, + ), + '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( + 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), + ), + ); + + if ( astra_wp_version_compare( '5.7', '>=' ) ) { + $base_background_color = astra_get_responsive_background_obj( $box_bg_obj, 'desktop' ); + if ( empty( $base_background_color ) ) { + $background_style_data = array( + 'background-color' => '#ffffff', + ); + } else { + $background_style_data = $base_background_color; + } + + $desktop_css['.edit-post-visual-editor'] = array( + 'padding' => '20px', + 'padding-top' => 'calc(2em + 20px)', + ); + $desktop_css['.ast-page-builder-template .edit-post-visual-editor'] = array( + 'padding' => '0', + 'padding-top' => '2em', + ); + $desktop_css['.ast-separate-container .editor-post-title'] = array( + 'margin-top' => '0', + ); + $desktop_css['.editor-styles-wrapper .block-editor-writing-flow'] = array( + 'height' => '100%', + 'padding' => '10px', + ); + $desktop_css['.edit-post-visual-editor .editor-styles-wrapper'] = array( + 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), + 'width' => '100%', + 'margin' => '0 auto', + 'padding' => '0', + ); + $desktop_css['.ast-page-builder-template .edit-post-visual-editor .editor-styles-wrapper'] = array( + 'max-width' => '100%', + ); + $desktop_css['.ast-separate-container .edit-post-visual-editor .block-editor-block-list__layout .wp-block[data-align="full"] figure.wp-block-image, .ast-separate-container .edit-post-visual-editor .wp-block[data-align="full"] .wp-block-cover'] = array( + 'margin-left' => 'calc(-4.8em - 10px)', + 'margin-right' => 'calc(-4.8em - 10px)', + ); + $desktop_css['.ast-page-builder-template .editor-styles-wrapper .block-editor-writing-flow, .ast-plain-container .editor-styles-wrapper .block-editor-writing-flow, #editor .edit-post-visual-editor'] = $background_style_data; + } + + if ( ( ( ! in_array( 'single-title-meta', $single_post_title ) ) && ( 'post' === get_post_type() ) ) || ( 'disabled' === $title_enabled_from_meta ) ) { + $destop_title_css = array( + '.editor-post-title__block' => array( + 'opacity' => '0.2', + ), + ); + $css .= astra_parse_css( $destop_title_css ); + } + + $content_links_underline = astra_get_option( 'underline-content-links' ); + + if ( $content_links_underline ) { + $desktop_css['.edit-post-visual-editor a'] = array( + 'text-decoration' => 'underline', + ); + } + + $css .= astra_parse_css( $desktop_css ); + + /** + * Global button CSS - Tablet. + */ + $css_prod_button_tablet = array( + '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), + ), + ); + + if ( astra_wp_version_compare( '5.7', '>=' ) ) { + $css_prod_button_tablet['.ast-page-builder-template .editor-styles-wrapper .block-editor-writing-flow, .ast-plain-container .editor-styles-wrapper .block-editor-writing-flow'] = astra_get_responsive_background_obj( $box_bg_obj, 'tablet' ); + } + + $css .= astra_parse_css( $css_prod_button_tablet, '', astra_get_tablet_breakpoint() ); + + /** + * Global button CSS - Mobile. + */ + $css_prod_button_mobile = array( + '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), + ), + ); + + if ( astra_wp_version_compare( '5.7', '>=' ) ) { + $css_prod_button_mobile['.ast-page-builder-template .editor-styles-wrapper .block-editor-writing-flow, .ast-plain-container .editor-styles-wrapper .block-editor-writing-flow'] = astra_get_responsive_background_obj( $box_bg_obj, 'mobile' ); + } + + $css .= astra_parse_css( $css_prod_button_mobile, '', astra_get_mobile_breakpoint() ); + + $theme_btn_top_border = ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '1px'; + $theme_btn_right_border = ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '1px'; + $theme_btn_left_border = ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '1px'; + $theme_btn_bottom_border = ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '1px'; + + if ( Astra_Dynamic_CSS::page_builder_button_style_css() ) { + + $is_support_wp_5_8 = Astra_Dynamic_CSS::is_block_editor_support_enabled(); + $search_button_selector = $is_support_wp_5_8 ? ', .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' : ''; + $search_button_hover_selector = $is_support_wp_5_8 ? ', .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover, .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:focus' : ''; + + $button_desktop_css = array( + /** + * Gutenberg button compatibility for default styling. + */ + '.wp-block-button .wp-block-button__link' . $search_button_selector => array( + 'border-style' => 'solid', + 'border-top-width' => $theme_btn_top_border, + 'border-right-width' => $theme_btn_right_border, + 'border-left-width' => $theme_btn_left_border, + 'border-bottom-width' => $theme_btn_bottom_border, + 'color' => esc_attr( $btn_color ), + 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), + 'background-color' => esc_attr( $btn_bg_color ), + 'font-family' => astra_get_font_family( $theme_btn_font_family ), + 'font-weight' => esc_attr( $theme_btn_font_weight ), + 'line-height' => esc_attr( $theme_btn_line_height ), + 'text-transform' => esc_attr( $theme_btn_text_transform ), + 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), + 'font-size' => astra_responsive_font( $theme_btn_font_size, 'desktop' ), + 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ), + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), + ), + '.wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' . $search_button_hover_selector => array( + 'color' => esc_attr( $btn_h_color ), + 'background-color' => esc_attr( $btn_bg_h_color ), + 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_h_color ) : esc_attr( $btn_border_h_color ), + ), + ); + + if ( $is_support_wp_5_8 ) { + $button_desktop_css['.wp-block-search .wp-block-search__input, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper'] = array( + 'border-color' => '#eaeaea', + 'background' => '#fafafa', + ); + $button_desktop_css['.block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__input'] = array( + 'padding' => '15px', + ); + $button_desktop_css['.wp-block-search__button svg'] = array( + 'fill' => 'currentColor', + ); + } + + $css .= astra_parse_css( $button_desktop_css ); + + /** + * Global button CSS - Tablet. + */ + $css_global_button_tablet = array( + '.wp-block-button .wp-block-button__link' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), + ), + ); + + $css .= astra_parse_css( $css_global_button_tablet, '', astra_get_tablet_breakpoint() ); + + /** + * Global button CSS - Mobile. + */ + $css_global_button_mobile = array( + '.wp-block-button .wp-block-button__link' => array( + 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), + 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), + 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), + 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), + ), + ); + + $css .= astra_parse_css( $css_global_button_mobile, '', astra_get_mobile_breakpoint() ); + } + + if ( Astra_Dynamic_CSS::gutenberg_core_patterns_compat() ) { + + $link_hover_color = astra_get_option( 'link-h-color' ); + $btn_text_hover_color = astra_get_option( 'button-h-color' ); + if ( empty( $btn_text_hover_color ) ) { + $btn_text_hover_color = astra_get_foreground_color( $link_hover_color ); + } + + /** + * When supporting GB button outline patterns in v3.3.0 we have given 2px as default border for GB outline button, where we restrict button border for flat type buttons. + * But now while reverting this change there is no need of default border because whatever customizer border will set it should behave accordingly. Although it is empty ('') WP applying 2px as default border for outline buttons. + * + * @since 3.6.3 + */ + $default_border_size = '2px'; + if ( ! astra_button_default_padding_updated() ) { + $default_border_size = ''; + } + + // Outline Gutenberg button compatibility CSS. + $theme_btn_top_border = ( isset( $global_custom_button_border_size['top'] ) && ( '' !== $global_custom_button_border_size['top'] && '0' !== $global_custom_button_border_size['top'] ) ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : $default_border_size; + $theme_btn_right_border = ( isset( $global_custom_button_border_size['right'] ) && ( '' !== $global_custom_button_border_size['right'] && '0' !== $global_custom_button_border_size['right'] ) ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : $default_border_size; + $theme_btn_left_border = ( isset( $global_custom_button_border_size['left'] ) && ( '' !== $global_custom_button_border_size['left'] && '0' !== $global_custom_button_border_size['left'] ) ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : $default_border_size; + $theme_btn_bottom_border = ( isset( $global_custom_button_border_size['bottom'] ) && ( '' !== $global_custom_button_border_size['bottom'] && '0' !== $global_custom_button_border_size['bottom'] ) ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : $default_border_size; + + // Added CSS compatibility support for Gutenberg pattern. + $button_patterns_compat_css = array( + '.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color), .wp-block-button.wp-block-button__link.is-style-outline:not(.has-text-color)' => array( + 'color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), + ), + '.wp-block-button.is-style-outline .wp-block-button__link:hover, .wp-block-button.is-style-outline .wp-block-button__link:focus' => array( + 'color' => esc_attr( $btn_text_hover_color ) . ' !important', + ), + '.wp-block-button.is-style-outline .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' => array( + 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_h_color ) : esc_attr( $btn_border_h_color ), + ), + ); + + if ( ! astra_button_default_padding_updated() ) { + $button_patterns_compat_css['.wp-block-button .wp-block-button__link'] = array( + 'border' => 'none', + 'padding' => '15px 30px', + ); + $button_patterns_compat_css['.wp-block-button.is-style-outline .wp-block-button__link'] = array( + 'border-style' => 'solid', + 'border-top-width' => esc_attr( $theme_btn_top_border ), + 'border-right-width' => esc_attr( $theme_btn_right_border ), + 'border-bottom-width' => esc_attr( $theme_btn_bottom_border ), + 'border-left-width' => esc_attr( $theme_btn_left_border ), + 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), + 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', + 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', + 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', + 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', + ); + } + + $css .= astra_parse_css( $button_patterns_compat_css ); + + if ( ! astra_button_default_padding_updated() ) { + // Tablet CSS. + $button_patterns_tablet_compat_css = array( + '.wp-block-button .wp-block-button__link' => array( + 'border' => 'none', + 'padding' => '15px 30px', + ), + '.wp-block-button.is-style-outline .wp-block-button__link' => array( + 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', + 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', + 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', + 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', + ), + ); + + $css .= astra_parse_css( $button_patterns_tablet_compat_css, '', astra_get_tablet_breakpoint() ); + + // Mobile CSS. + $button_patterns_mobile_compat_css = array( + '.wp-block-button .wp-block-button__link' => array( + 'border' => 'none', + 'padding' => '15px 30px', + ), + '.wp-block-button.is-style-outline .wp-block-button__link' => array( + 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', + 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', + 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', + 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', + ), + ); + + $css .= astra_parse_css( $button_patterns_mobile_compat_css, '', astra_get_mobile_breakpoint() ); + } + + if ( $is_site_rtl ) { + $gb_patterns_min_mobile_css = array( + '.editor-styles-wrapper .alignleft' => array( + 'margin-left' => '20px', + ), + '.editor-styles-wrapper .alignright' => array( + 'margin-right' => '20px', + ), + ); + } else { + $gb_patterns_min_mobile_css = array( + '.editor-styles-wrapper .alignleft' => array( + 'margin-right' => '20px', + ), + '.editor-styles-wrapper .alignright' => array( + 'margin-left' => '20px', + ), + ); + } + + if ( ! astra_button_default_padding_updated() ) { + $gb_patterns_min_mobile_css['.editor-styles-wrapper p.has-background'] = array( + 'padding' => '20px', + ); + } + + /* Parse CSS from array() -> min-width: (mobile-breakpoint) px CSS */ + $css .= astra_parse_css( $gb_patterns_min_mobile_css ); + } + + if ( Astra_Dynamic_CSS::gutenberg_core_blocks_css_comp() ) { + + $desktop_screen_gb_css = array( + '.wp-block-columns' => array( + 'margin-bottom' => 'unset', + ), + 'figure.size-full' => array( + 'margin' => '2rem 0', + ), + '.wp-block-gallery' => array( + 'margin-bottom' => '1.6em', + ), + '.wp-block-group' => array( + 'padding-top' => '4em', + 'padding-bottom' => '4em', + ), + '.wp-block-group__inner-container:last-child, .wp-block-table table' => array( + 'margin-bottom' => '0', + ), + '.blocks-gallery-grid' => array( + 'width' => '100%', + ), + '.wp-block-navigation-link__content' => array( + 'padding' => '5px 0', + ), + '.wp-block-group .wp-block-group .has-text-align-center, .wp-block-group .wp-block-column .has-text-align-center' => array( + 'max-width' => '100%', + ), + '.has-text-align-center' => array( + 'margin' => '0 auto', + ), + ); + + /* Parse CSS from array() -> Desktop CSS */ + $css .= astra_parse_css( $desktop_screen_gb_css ); + + $middle_screen_min_gb_css = array( + '.wp-block-cover__inner-container, .alignwide .wp-block-group__inner-container, .alignfull .wp-block-group__inner-container' => array( + 'max-width' => '1200px', + 'margin' => '0 auto', + ), + '.wp-block-group.alignnone, .wp-block-group.aligncenter, .wp-block-group.alignleft, .wp-block-group.alignright, .wp-block-group.alignwide, .wp-block-columns.alignwide' => array( + 'margin' => '2rem 0 1rem 0', + ), + ); + + /* Parse CSS from array() -> min-width: (1200)px CSS */ + $css .= astra_parse_css( $middle_screen_min_gb_css, '1200' ); + + $middle_screen_max_gb_css = array( + '.wp-block-group' => array( + 'padding' => '3em', + ), + '.wp-block-group .wp-block-group' => array( + 'padding' => '1.5em', + ), + '.wp-block-columns, .wp-block-column' => array( + 'margin' => '1rem 0', + ), + ); + + /* Parse CSS from array() -> max-width: (1200)px CSS */ + $css .= astra_parse_css( $middle_screen_max_gb_css, '', '1200' ); + + $tablet_screen_min_gb_css = array( + '.wp-block-columns .wp-block-group' => array( + 'padding' => '2em', + ), + ); + + /* Parse CSS from array() -> min-width: (tablet-breakpoint)px CSS */ + $css .= astra_parse_css( $tablet_screen_min_gb_css, astra_get_tablet_breakpoint() ); + + $mobile_screen_max_gb_css = array( + '.wp-block-media-text .wp-block-media-text__content' => array( + 'padding' => '3em 2em', + ), + '.wp-block-cover-image .wp-block-cover__inner-container, .wp-block-cover .wp-block-cover__inner-container' => array( + 'width' => 'unset', + ), + '.wp-block-cover, .wp-block-cover-image' => array( + 'padding' => '2em 0', + ), + '.wp-block-group, .wp-block-cover' => array( + 'padding' => '2em', + ), + '.wp-block-media-text__media img, .wp-block-media-text__media video' => array( + 'width' => 'unset', + 'max-width' => '100%', + ), + '.wp-block-media-text.has-background .wp-block-media-text__content' => array( + 'padding' => '1em', + ), + ); + + /* Parse CSS from array() -> max-width: (mobile-breakpoint)px CSS */ + $css .= astra_parse_css( $mobile_screen_max_gb_css, '', astra_get_mobile_breakpoint() ); + } + + if ( Astra_Dynamic_CSS::gutenberg_core_patterns_compat() ) { + + // Added CSS compatibility support for Gutenberg Editor's Media & Text block pattern. + if ( $is_site_rtl ) { + $gb_editor_block_pattern_css = array( + '.wp-block-media-text .wp-block-media-text__content .wp-block-group__inner-container' => array( + 'padding' => '0 8% 0 0', + ), + '.ast-separate-container .block-editor-block-list__layout .wp-block[data-align="full"] .wp-block[data-align="center"] > .wp-block-image' => array( + 'margin-right' => 'auto', + 'margin-left' => 'auto', + ), + ); + } else { + $gb_editor_block_pattern_css = array( + '.wp-block-media-text .wp-block-media-text__content .wp-block-group__inner-container' => array( + 'padding' => '0 0 0 8%', + ), + '.ast-separate-container .block-editor-block-list__layout .wp-block[data-align="full"] .wp-block[data-align="center"] > .wp-block-image' => array( + 'margin-right' => 'auto', + 'margin-left' => 'auto', + ), + ); + } + + $gb_editor_block_pattern_css['.block-editor-block-list__layout * .block-editor-block-list__block'] = array( + 'padding-left' => '20px', + 'padding-right' => '20px', + ); + + $css .= astra_parse_css( $gb_editor_block_pattern_css ); + } + + $tablet_css = array( + '.editor-post-title__block .editor-post-title__input' => array( + 'font-size' => astra_responsive_font( $single_post_title_font_size, 'tablet', 30 ), + ), + // Heading H1 - H6 font size. + '.edit-post-visual-editor h1, .wp-block-heading h1, .wp-block-freeform.block-library-rich-text__tinymce h1, .edit-post-visual-editor .wp-block-heading h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1' => array( + 'font-size' => astra_responsive_font( $heading_h1_font_size, 'tablet', 30 ), + ), + '.edit-post-visual-editor h2, .wp-block-heading h2, .wp-block-freeform.block-library-rich-text__tinymce h2, .edit-post-visual-editor .wp-block-heading h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2' => array( + 'font-size' => astra_responsive_font( $heading_h2_font_size, 'tablet', 25 ), + ), + '.edit-post-visual-editor h3, .wp-block-heading h3, .wp-block-freeform.block-library-rich-text__tinymce h3, .edit-post-visual-editor .wp-block-heading h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3' => array( + 'font-size' => astra_responsive_font( $heading_h3_font_size, 'tablet', 20 ), + ), + '.edit-post-visual-editor h4, .wp-block-heading h4, .wp-block-freeform.block-library-rich-text__tinymce h4, .edit-post-visual-editor .wp-block-heading h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4' => array( + 'font-size' => astra_responsive_font( $heading_h4_font_size, 'tablet' ), + ), + '.edit-post-visual-editor h5, .wp-block-heading h5, .wp-block-freeform.block-library-rich-text__tinymce h5, .edit-post-visual-editor .wp-block-heading h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5' => array( + 'font-size' => astra_responsive_font( $heading_h5_font_size, 'tablet' ), + ), + '.edit-post-visual-editor h6, .wp-block-heading h6, .wp-block-freeform.block-library-rich-text__tinymce h6, .edit-post-visual-editor .wp-block-heading h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6' => array( + 'font-size' => astra_responsive_font( $heading_h6_font_size, 'tablet' ), + ), + '.ast-separate-container .edit-post-visual-editor, .ast-page-builder-template .edit-post-visual-editor, .ast-plain-container .edit-post-visual-editor, .ast-separate-container #wpwrap #editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $box_bg_obj, 'tablet' ), + ); + + $css .= astra_parse_css( $tablet_css, '', astra_get_tablet_breakpoint() ); + + $mobile_css = array( + '.editor-post-title__block .editor-post-title__input' => array( + 'font-size' => astra_responsive_font( $single_post_title_font_size, 'mobile', 30 ), + ), + + // Heading H1 - H6 font size. + '.edit-post-visual-editor h1, .wp-block-heading h1, .wp-block-freeform.block-library-rich-text__tinymce h1, .edit-post-visual-editor .wp-block-heading h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1' => array( + 'font-size' => astra_responsive_font( $heading_h1_font_size, 'mobile', 30 ), + ), + '.edit-post-visual-editor h2, .wp-block-heading h2, .wp-block-freeform.block-library-rich-text__tinymce h2, .edit-post-visual-editor .wp-block-heading h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2' => array( + 'font-size' => astra_responsive_font( $heading_h2_font_size, 'mobile', 25 ), + ), + '.edit-post-visual-editor h3, .wp-block-heading h3, .wp-block-freeform.block-library-rich-text__tinymce h3, .edit-post-visual-editor .wp-block-heading h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3' => array( + 'font-size' => astra_responsive_font( $heading_h3_font_size, 'mobile', 20 ), + ), + '.edit-post-visual-editor h4, .wp-block-heading h4, .wp-block-freeform.block-library-rich-text__tinymce h4, .edit-post-visual-editor .wp-block-heading h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4' => array( + 'font-size' => astra_responsive_font( $heading_h4_font_size, 'mobile' ), + ), + '.edit-post-visual-editor h5, .wp-block-heading h5, .wp-block-freeform.block-library-rich-text__tinymce h5, .edit-post-visual-editor .wp-block-heading h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5' => array( + 'font-size' => astra_responsive_font( $heading_h5_font_size, 'mobile' ), + ), + '.edit-post-visual-editor h6, .wp-block-heading h6, .wp-block-freeform.block-library-rich-text__tinymce h6, .edit-post-visual-editor .wp-block-heading h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6' => array( + 'font-size' => astra_responsive_font( $heading_h6_font_size, 'mobile' ), + ), + '.ast-separate-container .edit-post-visual-editor, .ast-page-builder-template .edit-post-visual-editor, .ast-plain-container .edit-post-visual-editor, .ast-separate-container #wpwrap #editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $box_bg_obj, 'mobile' ), + ); + + $css .= astra_parse_css( $mobile_css, '', astra_get_mobile_breakpoint() ); + + if ( is_callable( 'Astra_Woocommerce::astra_global_btn_woo_comp' ) && Astra_Woocommerce::astra_global_btn_woo_comp() ) { + + $woo_global_button_css = array( + '.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( + 'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '0', + 'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '0', + 'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '0', + 'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '0', + 'border-color' => $btn_border_color ? $btn_border_color : $btn_bg_color, + ), + '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array( + 'border-color' => $btn_bg_h_color, + ), + ); + $css .= astra_parse_css( $woo_global_button_css ); + } + + if ( astra_wp_version_compare( '5.4.99', '>=' ) ) { + + $page_builder_css = array( + '.ast-page-builder-template .editor-post-title__block, .ast-page-builder-template .editor-default-block-appender' => array( + 'width' => '100%', + 'max-width' => '100%', + ), + '.ast-page-builder-template .wp-block[data-align="right"] > *' => array( + 'max-width' => 'unset', + 'width' => 'unset', + ), + '.ast-page-builder-template .block-editor-block-list__layout' => array( + 'padding-left' => 0, + 'padding-right' => 0, + ), + '.ast-page-builder-template .editor-block-list__block-edit' => array( + 'padding-left' => '20px', + 'padding-right' => '20px', + ), + '.ast-page-builder-template .editor-block-list__block-edit .editor-block-list__block-edit' => array( + 'padding-left' => '0', + 'padding-right' => '0', + ), + ); + + } else { + + $page_builder_css = array( + '.ast-page-builder-template .editor-post-title__block, .ast-page-builder-template .editor-default-block-appender, .ast-page-builder-template .block-editor-block-list__block' => array( + 'width' => '100%', + 'max-width' => '100%', + ), + '.ast-page-builder-template .block-editor-block-list__layout' => array( + 'padding-left' => 0, + 'padding-right' => 0, + ), + '.ast-page-builder-template .editor-block-list__block-edit' => array( + 'padding-left' => '20px', + 'padding-right' => '20px', + ), + '.ast-page-builder-template .editor-block-list__block-edit .editor-block-list__block-edit' => array( + 'padding-left' => '0', + 'padding-right' => '0', + ), + ); + } + + $css .= astra_parse_css( $page_builder_css ); + + $aligned_full_content_css = array( + '.ast-page-builder-template .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit, .ast-plain-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit' => array( + 'margin-left' => '0', + 'margin-right' => '0', + ), + '.ast-page-builder-template .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"], .ast-plain-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"]' => array( + 'margin-left' => '0', + 'margin-right' => '0', + ), + ); + + $css .= astra_parse_css( $aligned_full_content_css ); + + $boxed_container = array( + '.ast-separate-container .block-editor-writing-flow, .ast-two-container .block-editor-writing-flow' => array( + 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), + 'margin' => '0 auto', + 'background-color' => '#fff', + ), + '.ast-separate-container .gutenberg__editor, .ast-two-container .gutenberg__editor' => array( + 'background-color' => '#f5f5f5', + ), + + '.ast-separate-container .block-editor-block-list__layout, .ast-two-container .editor-block-list__layout' => array( + 'padding-top' => '0', + ), + + '.ast-two-container .editor-post-title, .ast-separate-container .block-editor-block-list__layout, .ast-two-container .editor-post-title' => array( + 'padding-top' => 'calc( 5.34em - 19px)', + 'padding-bottom' => '5.34em', + 'padding-left' => 'calc( 6.67em - 28px )', + 'padding-right' => 'calc( 6.67em - 28px )', + ), + '.ast-separate-container .block-editor-block-list__layout' => array( + 'padding-top' => '0', + 'padding-bottom' => '5.34em', + 'padding-left' => 'calc( 6.67em - 28px )', + 'padding-right' => 'calc( 6.67em - 28px )', + ), + '.ast-separate-container .editor-post-title' => array( + 'padding-top' => 'calc( 5.34em - 19px)', + 'padding-bottom' => '5.34em', + 'padding-left' => 'calc( 6.67em - 28px )', + 'padding-right' => 'calc( 6.67em - 28px )', + ), + + '.ast-separate-container .editor-post-title, .ast-two-container .editor-post-title' => array( + 'padding-bottom' => '0', + ), + '.ast-separate-container .editor-block-list__block, .ast-two-container .editor-block-list__block' => array( + 'max-width' => 'calc(' . astra_get_css_value( $site_content_width, 'px' ) . ' - 6.67em)', + ), + '.ast-separate-container .editor-block-list__block[data-align=wide], .ast-two-container .editor-block-list__block[data-align=wide]' => array( + 'margin-left' => '-20px', + 'margin-right' => '-20px', + ), + '.ast-separate-container .editor-block-list__block[data-align=full], .ast-two-container .editor-block-list__block[data-align=full]' => array( + 'margin-left' => '-6.67em', + 'margin-right' => '-6.67em', + ), + '.ast-separate-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"], .ast-separate-container .block-editor-block-list__layout .editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit, .ast-two-container .block-editor-block-list__layout .editor-block-list__block[data-align="full"], .ast-two-container .block-editor-block-list__layout .editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit' => array( + 'margin-left' => '0', + 'margin-right' => '0', + ), + ); + + $css .= astra_parse_css( $boxed_container ); + + // Manage the extra padding applied in the block inster preview of blocks. + $block_inserter_css = array( + '.ast-separate-container .block-editor-inserter__preview .block-editor-block-list__layout' => array( + 'padding-top' => '0px', + 'padding-bottom' => '0px', + 'padding-left' => '0px', + 'padding-right' => '0px', + ), + ); + + $css .= astra_parse_css( $block_inserter_css ); + + // WP 5.5 compatibility fix the extra padding applied for the block patterns in the editor view. + if ( astra_wp_version_compare( '5.4.99', '>=' ) ) { + + $block_pattern_css = array( + '.ast-separate-container .block-editor-inserter__panel-content .block-editor-block-list__layout' => array( + 'padding-top' => '0px', + 'padding-bottom' => '0px', + 'padding-left' => '0px', + 'padding-right' => '0px', + + ), + '.block-editor-inserter__panel-content .block-editor-block-list__layout' => array( + 'margin-left' => '60px', + 'margin-right' => '60px', + ), + '.block-editor-inserter__panel-content .block-editor-block-list__layout .block-editor-block-list__layout' => array( + 'margin-left' => '0px', + 'margin-right' => '0px', + ), + '.ast-page-builder-template .block-editor-inserter__panel-content .block-editor-block-list__layout' => array( + 'margin-left' => '0px', + 'margin-right' => '0px', + ), + ); + + $css .= astra_parse_css( $block_pattern_css ); + } else { + $full_width_streched_css = array( + '.ast-page-builder-template .block-editor-block-list__layout' => array( + 'margin-left' => '60px', + 'margin-right' => '60px', + ), + '.ast-page-builder-template .block-editor-block-list__layout .block-editor-block-list__layout' => array( + 'margin-left' => '0px', + 'margin-right' => '0px', + ), + ); + + $css .= astra_parse_css( $full_width_streched_css ); + } + + $ast_gtn_mobile_css = array( + '.ast-separate-container .editor-post-title' => array( + 'padding-top' => 'calc( 2.34em - 19px)', + 'padding-left' => 'calc( 3.67em - 28px )', + 'padding-right' => 'calc( 3.67em - 28px )', + ), + '.ast-separate-container .block-editor-block-list__layout' => array( + 'padding-bottom' => '2.34em', + 'padding-left' => 'calc( 3.67em - 28px )', + 'padding-right' => 'calc( 3.67em - 28px )', + ), + '.ast-page-builder-template .block-editor-block-list__layout' => array( + 'margin-left' => '30px', + 'margin-right' => '30px', + ), + '.ast-plain-container .block-editor-block-list__layout' => array( + 'padding-left' => '30px', + 'padding-right' => '30px', + ), + ); + + $css .= astra_parse_css( $ast_gtn_mobile_css, '', astra_get_mobile_breakpoint() ); + + if ( astra_wp_version_compare( '5.4.99', '>=' ) ) { + $gtn_full_wide_image_css = array( + '.wp-block[data-align="left"], .wp-block[data-align="right"], .wp-block[data-align="center"]' => array( + 'max-width' => '100%', + 'width' => '100%', + ), + '.ast-separate-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > .wp-block[data-align="full"], .ast-plain-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > .wp-block[data-align="full"]' => array( + 'margin-left' => 'auto', + 'margin-right' => 'auto', + ), + '.ast-separate-container .block-editor-block-list__layout .wp-block[data-align="full"] figure.wp-block-image' => array( + 'margin-left' => '-4.8em', + 'margin-right' => '-4.81em', + 'max-width' => 'unset', + 'width' => 'unset', + ), + '.ast-separate-container .wp-block[data-align="full"] .wp-block-cover' => array( + 'margin-left' => '-4.8em', + 'margin-right' => '-4.81em', + 'max-width' => 'unset', + 'width' => 'unset', + ), + '.ast-plain-container .wp-block[data-align="left"], .ast-plain-container .wp-block[data-align="right"], .ast-plain-container .wp-block[data-align="center"], .ast-plain-container .wp-block[data-align="full"]' => array( + 'max-width' => astra_get_css_value( $site_content_width, 'px' ), + ), + '.ast-plain-container .wp-block[data-align="wide"]' => array( + 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), + ), + ); + } else { + $gtn_full_wide_image_css = array( + '.ast-separate-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] figure.wp-block-image' => array( + 'margin-left' => '-4.8em', + 'margin-right' => '-4.81em', + 'max-width' => 'unset', + 'width' => 'unset', + ), + '.ast-separate-container .block-editor-block-list__block[data-align="full"] .wp-block-cover' => array( + 'margin-left' => '-4.8em', + 'margin-right' => '-4.81em', + 'max-width' => 'unset', + 'width' => 'unset', + ), + ); + } + + $css .= astra_parse_css( $gtn_full_wide_image_css ); + + if ( in_array( $pagenow, array( 'post-new.php' ) ) && ! isset( $post ) ) { + + $boxed_container = array( + '.block-editor-writing-flow' => array( + 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), + 'margin' => '0 auto', + 'background-color' => '#fff', + ), + '.gutenberg__editor' => array( + 'background-color' => '#f5f5f5', + ), + '.block-editor-block-list__layout, .editor-post-title' => array( + 'padding-top' => 'calc( 5.34em - 19px)', + 'padding-bottom' => '5.34em', + 'padding-left' => 'calc( 6.67em - 28px )', + 'padding-right' => 'calc( 6.67em - 28px )', + ), + '.block-editor-block-list__layout' => array( + 'padding-top' => '0', + ), + '.editor-post-title' => array( + 'padding-bottom' => '0', + ), + '.block-editor-block-list__block' => array( + 'max-width' => 'calc(' . astra_get_css_value( $site_content_width, 'px' ) . ' - 6.67em)', + ), + '.block-editor-block-list__block[data-align=wide]' => array( + 'margin-left' => '-20px', + 'margin-right' => '-20px', + ), + '.block-editor-block-list__block[data-align=full]' => array( + 'margin-left' => '-6.67em', + 'margin-right' => '-6.67em', + ), + '.block-editor-block-list__layout .block-editor-block-list__block[data-align="full"], .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] > .editor-block-list__block-edit' => array( + 'margin-left' => '0', + 'margin-right' => '0', + ), + ); + + $css .= astra_parse_css( $boxed_container ); + + } + + return $css; + } + } + +endif; diff --git a/inc/core/class-theme-strings.php b/inc/core/class-theme-strings.php index 089de87..e5cd74b 100644 --- a/inc/core/class-theme-strings.php +++ b/inc/core/class-theme-strings.php @@ -1,108 +1,108 @@ - __( 'Skip to content', 'astra' ), - - // 404 Page Strings. - 'string-404-sub-title' => __( 'It looks like the link pointing here was faulty. Maybe try searching?', 'astra' ), - - // Search Page Strings. - 'string-search-nothing-found' => __( 'Nothing Found', 'astra' ), - 'string-search-nothing-found-message' => __( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'astra' ), - 'string-full-width-search-message' => __( 'Start typing and press enter to search', 'astra' ), - 'string-full-width-search-placeholder' => __( 'Search …', 'astra' ), - 'string-header-cover-search-placeholder' => __( 'Search …', 'astra' ), - 'string-search-input-placeholder' => __( 'Search …', 'astra' ), - - // Comment Template Strings. - 'string-comment-reply-link' => __( 'Reply', 'astra' ), - 'string-comment-edit-link' => __( 'Edit', 'astra' ), - 'string-comment-awaiting-moderation' => __( 'Your comment is awaiting moderation.', 'astra' ), - 'string-comment-title-reply' => __( 'Leave a Comment', 'astra' ), - 'string-comment-cancel-reply-link' => __( 'Cancel Reply', 'astra' ), - 'string-comment-label-submit' => __( 'Post Comment »', 'astra' ), - 'string-comment-label-message' => __( 'Type here..', 'astra' ), - 'string-comment-label-name' => __( 'Name*', 'astra' ), - 'string-comment-label-email' => __( 'Email*', 'astra' ), - 'string-comment-label-website' => __( 'Website', 'astra' ), - 'string-comment-closed' => __( 'Comments are closed.', 'astra' ), - 'string-comment-navigation-title' => __( 'Comment navigation', 'astra' ), - 'string-comment-navigation-next' => __( 'Newer Comments', 'astra' ), - 'string-comment-navigation-previous' => __( 'Older Comments', 'astra' ), - - // Blog Default Strings. - 'string-blog-page-links-before' => __( 'Pages:', 'astra' ), - 'string-blog-meta-author-by' => __( 'By ', 'astra' ), - 'string-blog-meta-leave-a-comment' => __( 'Leave a Comment', 'astra' ), - 'string-blog-meta-one-comment' => __( '1 Comment', 'astra' ), - 'string-blog-meta-multiple-comment' => __( '% Comments', 'astra' ), - 'string-blog-navigation-next' => __( 'Next Page', 'astra' ) . ' ', - 'string-blog-navigation-previous' => ' ' . __( 'Previous Page', 'astra' ), - - // Single Post Default Strings. - 'string-single-page-links-before' => __( 'Pages:', 'astra' ), - /* translators: 1: Post type label */ - 'string-single-navigation-next' => __( 'Next %s', 'astra' ) . ' ', - /* translators: 1: Post type label */ - 'string-single-navigation-previous' => ' ' . __( 'Previous %s', 'astra' ), - - // Content None. - 'string-content-nothing-found-message' => __( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'astra' ), - - ) - ); - - if ( is_rtl() ) { - $defaults['string-blog-navigation-next'] = __( 'Next Page', 'astra' ) . ' '; - $defaults['string-blog-navigation-previous'] = ' ' . __( 'Previous Page', 'astra' ); - - /* translators: 1: Post type label */ - $defaults['string-single-navigation-next'] = __( 'Next %s', 'astra' ) . ' '; - /* translators: 1: Post type label */ - $defaults['string-single-navigation-previous'] = ' ' . __( 'Previous %s', 'astra' ); - } - - $output = isset( $defaults[ $key ] ) ? $defaults[ $key ] : ''; - - /** - * Print or return - */ - if ( $echo ) { - echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } else { - return $output; - } - } -} + __( 'Skip to content', 'astra' ), + + // 404 Page Strings. + 'string-404-sub-title' => __( 'It looks like the link pointing here was faulty. Maybe try searching?', 'astra' ), + + // Search Page Strings. + 'string-search-nothing-found' => __( 'Nothing Found', 'astra' ), + 'string-search-nothing-found-message' => __( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'astra' ), + 'string-full-width-search-message' => __( 'Start typing and press enter to search', 'astra' ), + 'string-full-width-search-placeholder' => __( 'Search …', 'astra' ), + 'string-header-cover-search-placeholder' => __( 'Search …', 'astra' ), + 'string-search-input-placeholder' => __( 'Search …', 'astra' ), + + // Comment Template Strings. + 'string-comment-reply-link' => __( 'Reply', 'astra' ), + 'string-comment-edit-link' => __( 'Edit', 'astra' ), + 'string-comment-awaiting-moderation' => __( 'Your comment is awaiting moderation.', 'astra' ), + 'string-comment-title-reply' => __( 'Leave a Comment', 'astra' ), + 'string-comment-cancel-reply-link' => __( 'Cancel Reply', 'astra' ), + 'string-comment-label-submit' => __( 'Post Comment »', 'astra' ), + 'string-comment-label-message' => __( 'Type here..', 'astra' ), + 'string-comment-label-name' => __( 'Name*', 'astra' ), + 'string-comment-label-email' => __( 'Email*', 'astra' ), + 'string-comment-label-website' => __( 'Website', 'astra' ), + 'string-comment-closed' => __( 'Comments are closed.', 'astra' ), + 'string-comment-navigation-title' => __( 'Comment navigation', 'astra' ), + 'string-comment-navigation-next' => __( 'Newer Comments', 'astra' ), + 'string-comment-navigation-previous' => __( 'Older Comments', 'astra' ), + + // Blog Default Strings. + 'string-blog-page-links-before' => __( 'Pages:', 'astra' ), + 'string-blog-meta-author-by' => __( 'By ', 'astra' ), + 'string-blog-meta-leave-a-comment' => __( 'Leave a Comment', 'astra' ), + 'string-blog-meta-one-comment' => __( '1 Comment', 'astra' ), + 'string-blog-meta-multiple-comment' => __( '% Comments', 'astra' ), + 'string-blog-navigation-next' => __( 'Next Page', 'astra' ) . ' ', + 'string-blog-navigation-previous' => ' ' . __( 'Previous Page', 'astra' ), + + // Single Post Default Strings. + 'string-single-page-links-before' => __( 'Pages:', 'astra' ), + /* translators: 1: Post type label */ + 'string-single-navigation-next' => __( 'Next %s', 'astra' ) . ' ', + /* translators: 1: Post type label */ + 'string-single-navigation-previous' => ' ' . __( 'Previous %s', 'astra' ), + + // Content None. + 'string-content-nothing-found-message' => __( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'astra' ), + + ) + ); + + if ( is_rtl() ) { + $defaults['string-blog-navigation-next'] = __( 'Next Page', 'astra' ) . ' '; + $defaults['string-blog-navigation-previous'] = ' ' . __( 'Previous Page', 'astra' ); + + /* translators: 1: Post type label */ + $defaults['string-single-navigation-next'] = __( 'Next %s', 'astra' ) . ' '; + /* translators: 1: Post type label */ + $defaults['string-single-navigation-previous'] = ' ' . __( 'Previous %s', 'astra' ); + } + + $output = isset( $defaults[ $key ] ) ? $defaults[ $key ] : ''; + + /** + * Print or return + */ + if ( $echo ) { + echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } else { + return $output; + } + } +} diff --git a/inc/core/common-functions.php b/inc/core/common-functions.php index 3c9ae29..e7888ac 100644 --- a/inc/core/common-functions.php +++ b/inc/core/common-functions.php @@ -1,1526 +1,1526 @@ - 0 ) { - - foreach ( $css_output as $selector => $properties ) { - - if ( null === $properties ) { - break; - } - - if ( ! count( $properties ) ) { - continue; - } - - $temp_parse_css = $selector . '{'; - $properties_added = 0; - - foreach ( $properties as $property => $value ) { - - if ( '' == $value && 0 !== $value ) { - continue; - } - - $properties_added++; - $temp_parse_css .= $property . ':' . $value . ';'; - } - - $temp_parse_css .= '}'; - - if ( $properties_added > 0 ) { - $parse_css .= $temp_parse_css; - } - } - - if ( '' != $parse_css && ( '' !== $min_media || '' !== $max_media ) ) { - - $media_css = '@media '; - $min_media_css = ''; - $max_media_css = ''; - $media_separator = ''; - - if ( '' !== $min_media ) { - $min_media_css = '(min-width:' . $min_media . 'px)'; - } - if ( '' !== $max_media ) { - $max_media_css = '(max-width:' . $max_media . 'px)'; - } - if ( '' !== $min_media && '' !== $max_media ) { - $media_separator = ' and '; - } - - $media_css .= $min_media_css . $media_separator . $max_media_css . '{' . $parse_css . '}'; - - return $media_css; - } - } - - return $parse_css; - } -} - -/** - * Return Theme options. - */ -if ( ! function_exists( 'astra_get_option' ) ) { - - /** - * Return Theme options. - * - * @param string $option Option key. - * @param string $default Option default value. - * @param string $deprecated Option default value. - * @return Mixed Return option value. - */ - function astra_get_option( $option, $default = '', $deprecated = '' ) { - - if ( '' != $deprecated ) { - $default = $deprecated; - } - - $theme_options = Astra_Theme_Options::get_options(); - - /** - * Filter the options array for Astra Settings. - * - * @since 1.0.20 - * @var Array - */ - $theme_options = apply_filters( 'astra_get_option_array', $theme_options, $option, $default ); - - $value = ( isset( $theme_options[ $option ] ) && '' !== $theme_options[ $option ] ) ? $theme_options[ $option ] : $default; - - /** - * Dynamic filter astra_get_option_$option. - * $option is the name of the Astra Setting, Refer Astra_Theme_Options::defaults() for option names from the theme. - * - * @since 1.0.20 - * @var Mixed. - */ - return apply_filters( "astra_get_option_{$option}", $value, $option, $default ); - } -} - -if ( ! function_exists( 'astra_update_option' ) ) { - - /** - * Update Theme options. - * - * @param string $option option key. - * @param Mixed $value option value. - * @return void - */ - function astra_update_option( $option, $value ) { - - do_action( "astra_before_update_option_{$option}", $value, $option ); - - // Get all customizer options. - $theme_options = get_option( ASTRA_THEME_SETTINGS ); - - // Update value in options array. - $theme_options[ $option ] = $value; - - update_option( ASTRA_THEME_SETTINGS, $theme_options ); - - do_action( "astra_after_update_option_{$option}", $value, $option ); - } -} - -if ( ! function_exists( 'astra_delete_option' ) ) { - - /** - * Update Theme options. - * - * @param string $option option key. - * @return void - */ - function astra_delete_option( $option ) { - - do_action( "astra_before_delete_option_{$option}", $option ); - - // Get all customizer options. - $theme_options = get_option( ASTRA_THEME_SETTINGS ); - - // Update value in options array. - unset( $theme_options[ $option ] ); - - update_option( ASTRA_THEME_SETTINGS, $theme_options ); - - do_action( "astra_after_delete_option_{$option}", $option ); - } -} - -/** - * Return Theme options from postmeta. - */ -if ( ! function_exists( 'astra_get_option_meta' ) ) { - - /** - * Return Theme options from postmeta. - * - * @param string $option_id Option ID. - * @param string $default Option default value. - * @param boolean $only_meta Get only meta value. - * @param string $extension Is value from extension. - * @param string $post_id Get value from specific post by post ID. - * @return Mixed Return option value. - */ - function astra_get_option_meta( $option_id, $default = '', $only_meta = false, $extension = '', $post_id = '' ) { - - $post_id = ( '' != $post_id ) ? $post_id : astra_get_post_id(); - - $value = astra_get_option( $option_id, $default ); - - // Get value from option 'post-meta'. - if ( is_singular() || ( is_home() && ! is_front_page() ) ) { - - $value = get_post_meta( $post_id, $option_id, true ); - - if ( empty( $value ) || 'default' == $value ) { - - if ( true === $only_meta ) { - return false; - } - - $value = astra_get_option( $option_id, $default ); - } - } - - /** - * Dynamic filter astra_get_option_meta_$option. - * $option_id is the name of the Astra Meta Setting. - * - * @since 1.0.20 - * @var Mixed. - */ - return apply_filters( "astra_get_option_meta_{$option_id}", $value, $default, $default ); - } -} - -/** - * Helper function to get the current post id. - */ -if ( ! function_exists( 'astra_get_post_id' ) ) { - - /** - * Get post ID. - * - * @param string $post_id_override Get override post ID. - * @return number Post ID. - */ - function astra_get_post_id( $post_id_override = '' ) { - - if ( null == Astra_Theme_Options::$post_id ) { - global $post; - - $post_id = 0; - - if ( is_home() ) { - $post_id = get_option( 'page_for_posts' ); - } elseif ( is_archive() ) { - global $wp_query; - $post_id = $wp_query->get_queried_object_id(); - } elseif ( isset( $post->ID ) && ! is_search() && ! is_category() ) { - $post_id = $post->ID; - } - - Astra_Theme_Options::$post_id = $post_id; - } - - return apply_filters( 'astra_get_post_id', Astra_Theme_Options::$post_id, $post_id_override ); - } -} - - -/** - * Display classes for primary div - */ -if ( ! function_exists( 'astra_primary_class' ) ) { - - /** - * Display classes for primary div - * - * @param string|array $class One or more classes to add to the class list. - * @return void Echo classes. - */ - function astra_primary_class( $class = '' ) { - - // Separates classes with a single space, collates classes for body element. - echo 'class="' . esc_attr( join( ' ', astra_get_primary_class( $class ) ) ) . '"'; - } -} - -/** - * Retrieve the classes for the primary element as an array. - */ -if ( ! function_exists( 'astra_get_primary_class' ) ) { - - /** - * Retrieve the classes for the primary element as an array. - * - * @param string|array $class One or more classes to add to the class list. - * @return array Return array of classes. - */ - function astra_get_primary_class( $class = '' ) { - - // array of class names. - $classes = array(); - - // default class for content area. - $classes[] = 'content-area'; - - // primary base class. - $classes[] = 'primary'; - - if ( ! empty( $class ) ) { - if ( ! is_array( $class ) ) { - $class = preg_split( '#\s+#', $class ); - } - $classes = array_merge( $classes, $class ); - } else { - - // Ensure that we always coerce class to being an array. - $class = array(); - } - - // Filter primary div class names. - $classes = apply_filters( 'astra_primary_class', $classes, $class ); - - $classes = array_map( 'sanitize_html_class', $classes ); - - return array_unique( $classes ); - } -} - -/** - * Display classes for secondary div - */ -if ( ! function_exists( 'astra_secondary_class' ) ) { - - /** - * Retrieve the classes for the secondary element as an array. - * - * @param string|array $class One or more classes to add to the class list. - * @return void echo classes. - */ - function astra_secondary_class( $class = '' ) { - - // Separates classes with a single space, collates classes for body element. - echo 'class="' . esc_attr( join( ' ', astra_get_secondary_class( $class ) ) ) . '"'; - } -} - -/** - * Retrieve the classes for the secondary element as an array. - */ -if ( ! function_exists( 'astra_get_secondary_class' ) ) { - - /** - * Retrieve the classes for the secondary element as an array. - * - * @param string|array $class One or more classes to add to the class list. - * @return array Return array of classes. - */ - function astra_get_secondary_class( $class = '' ) { - - // array of class names. - $classes = array(); - - // default class from widget area. - $classes[] = 'widget-area'; - - // secondary base class. - $classes[] = 'secondary'; - - if ( ! empty( $class ) ) { - if ( ! is_array( $class ) ) { - $class = preg_split( '#\s+#', $class ); - } - $classes = array_merge( $classes, $class ); - } else { - - // Ensure that we always coerce class to being an array. - $class = array(); - } - - // Filter secondary div class names. - $classes = apply_filters( 'astra_secondary_class', $classes, $class ); - - $classes = array_map( 'sanitize_html_class', $classes ); - - return array_unique( $classes ); - } -} - -/** - * Get post format - */ -if ( ! function_exists( 'astra_get_post_format' ) ) { - - /** - * Get post format - * - * @param string $post_format_override Override post formate. - * @return string Return post format. - */ - function astra_get_post_format( $post_format_override = '' ) { - - if ( ( is_home() ) || is_archive() ) { - $post_format = 'blog'; - } else { - $post_format = get_post_format(); - } - - return apply_filters( 'astra_get_post_format', $post_format, $post_format_override ); - } -} - -/** - * Wrapper function for get_the_title() for blog post. - */ -if ( ! function_exists( 'astra_the_post_title' ) ) { - - /** - * Wrapper function for get_the_title() for blog post. - * - * Displays title only if the page title bar is disabled. - * - * @since 1.0.15 - * @param string $before Optional. Content to prepend to the title. - * @param string $after Optional. Content to append to the title. - * @param int $post_id Optional, default to 0. Post id. - * @param bool $echo Optional, default to true.Whether to display or return. - * @return string|void String if $echo parameter is false. - */ - function astra_the_post_title( $before = '', $after = '', $post_id = 0, $echo = true ) { - - $enabled = apply_filters( 'astra_the_post_title_enabled', true ); - if ( $enabled ) { - - $title = astra_get_the_title( $post_id ); - $before = apply_filters( 'astra_the_post_title_before', $before ); - $after = apply_filters( 'astra_the_post_title_after', $after ); - - // This will work same as `the_title` function but with Custom Title if exits. - if ( $echo ) { - echo $before . $title . $after; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } else { - return $before . $title . $after; - } - } - } -} - -/** - * Wrapper function for the_title() - */ -if ( ! function_exists( 'astra_the_title' ) ) { - - /** - * Wrapper function for the_title() - * - * Displays title only if the page title bar is disabled. - * - * @param string $before Optional. Content to prepend to the title. - * @param string $after Optional. Content to append to the title. - * @param int $post_id Optional, default to 0. Post id. - * @param bool $echo Optional, default to true.Whether to display or return. - * @return string|void String if $echo parameter is false. - */ - function astra_the_title( $before = '', $after = '', $post_id = 0, $echo = true ) { - - $title = ''; - $blog_post_title = astra_get_option( 'blog-post-structure' ); - $single_post_title = astra_get_option( 'blog-single-post-structure' ); - - if ( ( ! is_singular() && in_array( 'title-meta', $blog_post_title ) ) || ( is_single() && in_array( 'single-title-meta', $single_post_title ) ) || is_page() ) { - if ( apply_filters( 'astra_the_title_enabled', true ) ) { - - $title = astra_get_the_title( $post_id ); - $before = apply_filters( 'astra_the_title_before', $before ); - $after = apply_filters( 'astra_the_title_after', $after ); - - $title = $before . $title . $after; - } - } - - // This will work same as `the_title` function but with Custom Title if exits. - if ( $echo ) { - echo $title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } else { - return $title; - } - } -} - -/** - * Wrapper function for get_the_title() - */ -if ( ! function_exists( 'astra_get_the_title' ) ) { - - /** - * Wrapper function for get_the_title() - * - * Return title for Title Bar and Normal Title. - * - * @param int $post_id Optional, default to 0. Post id. - * @param bool $echo Optional, default to false. Whether to display or return. - * @return string|void String if $echo parameter is false. - */ - function astra_get_the_title( $post_id = 0, $echo = false ) { - - $title = ''; - if ( $post_id || is_singular() ) { - $title = get_the_title( $post_id ); - } else { - if ( is_front_page() && is_home() ) { - // Default homepage. - $title = apply_filters( 'astra_the_default_home_page_title', esc_html__( 'Home', 'astra' ) ); - } elseif ( is_home() ) { - // blog page. - $title = apply_filters( 'astra_the_blog_home_page_title', get_the_title( get_option( 'page_for_posts', true ) ) ); - } elseif ( is_404() ) { - // for 404 page - title always display. - $title = apply_filters( 'astra_the_404_page_title', esc_html__( 'This page doesn\'t seem to exist.', 'astra' ) ); - - // for search page - title always display. - } elseif ( is_search() ) { - - /* translators: 1: search string */ - $title = apply_filters( 'astra_the_search_page_title', sprintf( __( 'Search Results for: %s', 'astra' ), '' . get_search_query() . '' ) ); - - } elseif ( class_exists( 'WooCommerce' ) && is_shop() ) { - - $title = woocommerce_page_title( false ); - - } elseif ( is_archive() ) { - - $title = get_the_archive_title(); - - } - } - - $title = apply_filters( 'astra_the_title', $title, $post_id ); - - // This will work same as `get_the_title` function but with Custom Title if exits. - if ( $echo ) { - echo $title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } else { - return $title; - } - } -} - -/** - * Archive Page Title - */ -if ( ! function_exists( 'astra_archive_page_info' ) ) { - - /** - * Wrapper function for the_title() - * - * Displays title only if the page title bar is disabled. - */ - function astra_archive_page_info() { - - if ( apply_filters( 'astra_the_title_enabled', true ) ) { - - // Author. - if ( is_author() ) { ?> - -
    -
    - -

    - -

    - -
    -
    - -
    -
    - - - -
    - -

    - - - -
    - - - -
    - -

    - - - -
    - - - -
    - - ' . get_search_query() . '' ) ); - ?> -

    - -
    - - - -
    - - ', '' ); ?> - - - -
    - - hexdec( substr( $hex, 0, 2 ) ), - 'g' => hexdec( substr( $hex, 2, 2 ) ), - 'b' => hexdec( substr( $hex, 4, 2 ) ), - ); - - // Should we darken the color? - if ( 'reverse' == $type && $shortcode_atts['r'] + $shortcode_atts['g'] + $shortcode_atts['b'] > 382 ) { - $steps = -$steps; - } elseif ( 'darken' == $type ) { - $steps = -$steps; - } - - // Build the new color. - $steps = max( -255, min( 255, $steps ) ); - - $shortcode_atts['r'] = max( 0, min( 255, $shortcode_atts['r'] + $steps ) ); - $shortcode_atts['g'] = max( 0, min( 255, $shortcode_atts['g'] + $steps ) ); - $shortcode_atts['b'] = max( 0, min( 255, $shortcode_atts['b'] + $steps ) ); - - $r_hex = str_pad( dechex( $shortcode_atts['r'] ), 2, '0', STR_PAD_LEFT ); - $g_hex = str_pad( dechex( $shortcode_atts['g'] ), 2, '0', STR_PAD_LEFT ); - $b_hex = str_pad( dechex( $shortcode_atts['b'] ), 2, '0', STR_PAD_LEFT ); - - return '#' . $r_hex . $g_hex . $b_hex; - } -} // End if. - -/** - * Convert colors from HEX to RGBA - */ -if ( ! function_exists( 'astra_hex_to_rgba' ) ) : - - /** - * Convert colors from HEX to RGBA - * - * @param string $color Color code in HEX. - * @param boolean $opacity Color code opacity. - * @return string Color code in RGB or RGBA. - */ - function astra_hex_to_rgba( $color, $opacity = false ) { - - $default = 'rgb(0,0,0)'; - - // Return default if no color provided. - if ( empty( $color ) ) { - return $default; - } - - // Sanitize $color if "#" is provided. - if ( '#' == $color[0] ) { - $color = substr( $color, 1 ); - } - - // Check if color has 6 or 3 characters and get values. - if ( 6 == strlen( $color ) ) { - $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] ); - } elseif ( 3 == strlen( $color ) ) { - $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] ); - } else { - return $default; - } - - // Convert HEX to RGB. - $rgb = array_map( 'hexdec', $hex ); - - // Check if opacity is set(RGBA or RGB). - if ( $opacity ) { - if ( 1 < abs( $opacity ) ) { - $opacity = 1.0; - } - $output = 'rgba(' . implode( ',', $rgb ) . ',' . $opacity . ')'; - } else { - $output = 'rgb(' . implode( ',', $rgb ) . ')'; - } - - // Return RGB(a) color string. - return $output; - } - -endif; - - -if ( ! function_exists( 'astra_enable_page_builder_compatibility' ) ) : - - /** - * Allow filter to enable/disable page builder compatibility. - * - * @see https://wpastra.com/docs/recommended-settings-beaver-builder-astra/ - * @see https://wpastra.com/docs/recommended-settings-for-elementor/ - * - * @since 1.2.2 - * @return bool True - If the page builder compatibility is enabled. False - IF the page builder compatibility is disabled. - */ - function astra_enable_page_builder_compatibility() { - return apply_filters( 'astra_enable_page_builder_compatibility', true ); - } - -endif; - - -if ( ! function_exists( 'astra_get_pro_url' ) ) : - /** - * Returns an URL with utm tags - * the admin settings page. - * - * @param string $url URL fo the site. - * @param string $source utm source. - * @param string $medium utm medium. - * @param string $campaign utm campaign. - * @return mixed - */ - function astra_get_pro_url( $url, $source = '', $medium = '', $campaign = '' ) { - - $astra_pro_url = trailingslashit( $url ); - - // Set up our URL if we have a source. - if ( isset( $source ) ) { - $astra_pro_url = add_query_arg( 'utm_source', sanitize_text_field( $source ), $url ); - } - // Set up our URL if we have a medium. - if ( isset( $medium ) ) { - $astra_pro_url = add_query_arg( 'utm_medium', sanitize_text_field( $medium ), $url ); - } - // Set up our URL if we have a campaign. - if ( isset( $campaign ) ) { - $astra_pro_url = add_query_arg( 'utm_campaign', sanitize_text_field( $campaign ), $url ); - } - - return esc_url( apply_filters( 'astra_get_pro_url', $astra_pro_url, $url ) ); - } - -endif; - - -/** - * Search Form - */ -if ( ! function_exists( 'astra_get_search_form' ) ) : - /** - * Display search form. - * - * @param bool $echo Default to echo and not return the form. - * @return string|void String when $echo is false. - */ - function astra_get_search_form( $echo = true ) { - - $form = get_search_form( - array( - 'input_placeholder' => apply_filters( 'astra_search_field_placeholder', esc_attr_x( 'Search …', 'placeholder', 'astra' ) ), - 'data_attributes' => apply_filters( 'astra_search_field_toggle_data_attrs', '' ), - 'input_value' => get_search_query(), - 'show_input_submit' => false, - ) - ); - - /** - * Filters the HTML output of the search form. - * - * @param string $form The search form HTML output. - */ - $result = apply_filters( 'astra_get_search_form', $form ); - - if ( null === $result ) { - $result = $form; - } - - if ( $echo ) { - echo $result; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } else { - return $result; - } - } - -endif; - -/** - * Check if we're being delivered AMP - * - * @return bool - */ -function astra_is_amp_endpoint() { - return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint(); -} - -/* - * Get Responsive Spacing - */ -if ( ! function_exists( 'astra_responsive_spacing' ) ) { - - /** - * Get Spacing value - * - * @param array $option CSS value. - * @param string $side top | bottom | left | right. - * @param string $device CSS device. - * @param string $default Default value. - * @param string $prefix Prefix value. - * @return mixed - */ - function astra_responsive_spacing( $option, $side = '', $device = 'desktop', $default = '', $prefix = '' ) { - - if ( isset( $option[ $device ][ $side ] ) && isset( $option[ $device . '-unit' ] ) ) { - $spacing = astra_get_css_value( $option[ $device ][ $side ], $option[ $device . '-unit' ], $default ); - } elseif ( is_numeric( $option ) ) { - $spacing = astra_get_css_value( $option ); - } else { - $spacing = ( ! is_array( $option ) ) ? $option : ''; - } - - if ( '' !== $prefix && '' !== $spacing ) { - return $prefix . $spacing; - } - return $spacing; - } -} - -/** - * Get the tablet breakpoint value. - * - * @param string $min min. - * @param string $max max. - * - * @since 2.4.0 - * - * @return number $breakpoint. - */ -function astra_get_tablet_breakpoint( $min = '', $max = '' ) { - - $update_breakpoint = astra_get_option( 'can-update-theme-tablet-breakpoint', true ); - - // Change default for new users. - $default = ( true === $update_breakpoint ) ? 921 : 768; - - $header_breakpoint = apply_filters( 'astra_tablet_breakpoint', $default ); - - if ( '' !== $min ) { - $header_breakpoint = $header_breakpoint - $min; - } elseif ( '' !== $max ) { - $header_breakpoint = $header_breakpoint + $max; - } - - return absint( $header_breakpoint ); -} - -/** - * Get the mobile breakpoint value. - * - * @param string $min min. - * @param string $max max. - * - * @since 2.4.0 - * - * @return number header_breakpoint. - */ -function astra_get_mobile_breakpoint( $min = '', $max = '' ) { - - $header_breakpoint = apply_filters( 'astra_mobile_breakpoint', 544 ); - - if ( '' !== $min ) { - $header_breakpoint = $header_breakpoint - $min; - } elseif ( '' !== $max ) { - $header_breakpoint = $header_breakpoint + $max; - } - - return absint( $header_breakpoint ); -} - -/* - * Apply CSS for the element - */ -if ( ! function_exists( 'astra_color_responsive_css' ) ) { - - /** - * Astra Responsive Colors - * - * @param array $setting Responsive colors. - * @param string $css_property CSS property. - * @param string $selector CSS selector. - * @return string Dynamic responsive CSS. - */ - function astra_color_responsive_css( $setting, $css_property, $selector ) { - $css = ''; - if ( isset( $setting['desktop'] ) && ! empty( $setting['desktop'] ) ) { - $css .= $selector . '{' . $css_property . ':' . esc_attr( $setting['desktop'] ) . ';}'; - } - if ( isset( $setting['tablet'] ) && ! empty( $setting['tablet'] ) ) { - $css .= '@media (max-width:' . astra_get_tablet_breakpoint() . 'px) {' . $selector . '{' . $css_property . ':' . esc_attr( $setting['tablet'] ) . ';} }'; - } - if ( isset( $setting['mobile'] ) && ! empty( $setting['mobile'] ) ) { - $css .= '@media (max-width:' . astra_get_mobile_breakpoint() . 'px) {' . $selector . '{' . $css_property . ':' . esc_attr( $setting['mobile'] ) . ';} }'; - } - return $css; - } -} - -if ( ! function_exists( 'astra_check_is_bb_themer_layout' ) ) : - - /** - * Check if layout is bb themer's layout - */ - function astra_check_is_bb_themer_layout() { - - $is_layout = false; - - $post_type = get_post_type(); - $post_id = get_the_ID(); - - if ( 'fl-theme-layout' === $post_type && $post_id ) { - - $is_layout = true; - } - - return $is_layout; - } - -endif; - - -if ( ! function_exists( 'astra_is_white_labelled' ) ) : - - /** - * Check if white label option is enabled in astra pro plugin - */ - function astra_is_white_labelled() { - - if ( is_callable( 'Astra_Ext_White_Label_Markup::show_branding' ) && ! Astra_Ext_White_Label_Markup::show_branding() ) { - return apply_filters( 'astra_is_white_labelled', true ); - } - - return apply_filters( 'astra_is_white_labelled', false ); - } - -endif; - -/** - * Get the value for font-display property. - * - * @since 1.8.6 - * @return string - */ -function astra_get_fonts_display_property() { - return apply_filters( 'astra_fonts_display_property', 'fallback' ); -} - -/** - * Return Theme options from database. - * - * @param string $option Option key. - * @param string $default Option default value. - * @param string $deprecated Option default value. - * @return Mixed Return option value. - */ -function astra_get_db_option( $option, $default = '', $deprecated = '' ) { - - if ( '' != $deprecated ) { - $default = $deprecated; - } - - $theme_options = Astra_Theme_Options::get_db_options(); - - /** - * Filter the options array for Astra Settings. - * - * @since 1.0.20 - * @var Array - */ - $theme_options = apply_filters( 'astra_get_db_option_array', $theme_options, $option, $default ); - - $value = ( isset( $theme_options[ $option ] ) && '' !== $theme_options[ $option ] ) ? $theme_options[ $option ] : $default; - - /** - * Dynamic filter astra_get_option_$option. - * $option is the name of the Astra Setting, Refer Astra_Theme_Options::defaults() for option names from the theme. - * - * @since 1.0.20 - * @var Mixed. - */ - return apply_filters( "astra_get_db_option_{$option}", $value, $option, $default ); -} - -/** - * Generate Responsive Background Color CSS. - * - * @param array $bg_obj_res array of background object. - * @param string $device CSS for which device. - * @return array - */ -function astra_get_responsive_background_obj( $bg_obj_res, $device ) { - - $gen_bg_css = array(); - - if ( ! is_array( $bg_obj_res ) ) { - return; - } - - $bg_obj = $bg_obj_res[ $device ]; - $bg_img = isset( $bg_obj['background-image'] ) ? $bg_obj['background-image'] : ''; - $bg_tab_img = isset( $bg_obj_res['tablet']['background-image'] ) ? $bg_obj_res['tablet']['background-image'] : ''; - $bg_desk_img = isset( $bg_obj_res['desktop']['background-image'] ) ? $bg_obj_res['desktop']['background-image'] : ''; - $bg_color = isset( $bg_obj['background-color'] ) ? $bg_obj['background-color'] : ''; - $tablet_css = ( isset( $bg_obj_res['tablet']['background-image'] ) && $bg_obj_res['tablet']['background-image'] ) ? true : false; - $desktop_css = ( isset( $bg_obj_res['desktop']['background-image'] ) && $bg_obj_res['desktop']['background-image'] ) ? true : false; - - $bg_type = ( isset( $bg_obj['background-type'] ) && $bg_obj['background-type'] ) ? $bg_obj['background-type'] : ''; - - if ( '' !== $bg_type ) { - switch ( $bg_type ) { - case 'color': - if ( '' !== $bg_img && '' !== $bg_color ) { - $gen_bg_css['background-image'] = 'linear-gradient(to right, ' . $bg_color . ', ' . $bg_color . '), url(' . $bg_img . ');'; - } elseif ( 'mobile' === $device ) { - if ( $desktop_css ) { - $gen_bg_css['background-image'] = 'linear-gradient(to right, ' . $bg_color . ', ' . $bg_color . '), url(' . $bg_desk_img . ');'; - } elseif ( $tablet_css ) { - $gen_bg_css['background-image'] = 'linear-gradient(to right, ' . $bg_color . ', ' . $bg_color . '), url(' . $bg_tab_img . ');'; - } else { - $gen_bg_css['background-color'] = $bg_color . ';'; - $gen_bg_css['background-image'] = 'none;'; - } - } elseif ( 'tablet' === $device ) { - if ( $desktop_css ) { - $gen_bg_css['background-image'] = 'linear-gradient(to right, ' . $bg_color . ', ' . $bg_color . '), url(' . $bg_desk_img . ');'; - } else { - $gen_bg_css['background-color'] = $bg_color . ';'; - $gen_bg_css['background-image'] = 'none;'; - } - } elseif ( '' === $bg_img ) { - $gen_bg_css['background-color'] = $bg_color . ';'; - $gen_bg_css['background-image'] = 'none;'; - } - break; - - case 'image': - if ( '' !== $bg_img && '' !== $bg_color && ( ! is_numeric( strpos( $bg_color, 'linear-gradient' ) ) && ! is_numeric( strpos( $bg_color, 'radial-gradient' ) ) ) ) { - $gen_bg_css['background-image'] = 'linear-gradient(to right, ' . $bg_color . ', ' . $bg_color . '), url(' . $bg_img . ');'; - } - if ( '' === $bg_color || is_numeric( strpos( $bg_color, 'linear-gradient' ) ) || is_numeric( strpos( $bg_color, 'radial-gradient' ) ) && '' !== $bg_img ) { - $gen_bg_css['background-image'] = 'url(' . $bg_img . ');'; - } - break; - - case 'gradient': - if ( isset( $bg_color ) ) { - $gen_bg_css['background-image'] = $bg_color . ';'; - } - break; - - default: - break; - } - } elseif ( '' !== $bg_color ) { - $gen_bg_css['background-color'] = $bg_color . ';'; - } - - if ( '' !== $bg_img ) { - if ( isset( $bg_obj['background-repeat'] ) ) { - $gen_bg_css['background-repeat'] = esc_attr( $bg_obj['background-repeat'] ); - } - - if ( isset( $bg_obj['background-position'] ) ) { - $gen_bg_css['background-position'] = esc_attr( $bg_obj['background-position'] ); - } - - if ( isset( $bg_obj['background-size'] ) ) { - $gen_bg_css['background-size'] = esc_attr( $bg_obj['background-size'] ); - } - - if ( isset( $bg_obj['background-attachment'] ) ) { - $gen_bg_css['background-attachment'] = esc_attr( $bg_obj['background-attachment'] ); - } - } - - return $gen_bg_css; -} - -/** - * Common function to check is pagination is enabled on current page. - * - * @since 3.0.1 - * @return boolean - */ -function is_astra_pagination_enabled() { - global $wp_query; - - return ( $wp_query->max_num_pages > 1 && apply_filters( 'astra_pagination_enabled', true ) ); -} - -/** - * Verify is current post comments are enabled or not for applying dynamic CSS. - * - * @since 3.0.1 - * @return boolean - */ -function is_current_post_comment_enabled() { - return ( is_singular() && comments_open() ); -} + 0 ) { + + foreach ( $css_output as $selector => $properties ) { + + if ( null === $properties ) { + break; + } + + if ( ! count( $properties ) ) { + continue; + } + + $temp_parse_css = $selector . '{'; + $properties_added = 0; + + foreach ( $properties as $property => $value ) { + + if ( '' == $value && 0 !== $value ) { + continue; + } + + $properties_added++; + $temp_parse_css .= $property . ':' . $value . ';'; + } + + $temp_parse_css .= '}'; + + if ( $properties_added > 0 ) { + $parse_css .= $temp_parse_css; + } + } + + if ( '' != $parse_css && ( '' !== $min_media || '' !== $max_media ) ) { + + $media_css = '@media '; + $min_media_css = ''; + $max_media_css = ''; + $media_separator = ''; + + if ( '' !== $min_media ) { + $min_media_css = '(min-width:' . $min_media . 'px)'; + } + if ( '' !== $max_media ) { + $max_media_css = '(max-width:' . $max_media . 'px)'; + } + if ( '' !== $min_media && '' !== $max_media ) { + $media_separator = ' and '; + } + + $media_css .= $min_media_css . $media_separator . $max_media_css . '{' . $parse_css . '}'; + + return $media_css; + } + } + + return $parse_css; + } +} + +/** + * Return Theme options. + */ +if ( ! function_exists( 'astra_get_option' ) ) { + + /** + * Return Theme options. + * + * @param string $option Option key. + * @param string $default Option default value. + * @param string $deprecated Option default value. + * @return Mixed Return option value. + */ + function astra_get_option( $option, $default = '', $deprecated = '' ) { + + if ( '' != $deprecated ) { + $default = $deprecated; + } + + $theme_options = Astra_Theme_Options::get_options(); + + /** + * Filter the options array for Astra Settings. + * + * @since 1.0.20 + * @var Array + */ + $theme_options = apply_filters( 'astra_get_option_array', $theme_options, $option, $default ); + + $value = ( isset( $theme_options[ $option ] ) && '' !== $theme_options[ $option ] ) ? $theme_options[ $option ] : $default; + + /** + * Dynamic filter astra_get_option_$option. + * $option is the name of the Astra Setting, Refer Astra_Theme_Options::defaults() for option names from the theme. + * + * @since 1.0.20 + * @var Mixed. + */ + return apply_filters( "astra_get_option_{$option}", $value, $option, $default ); + } +} + +if ( ! function_exists( 'astra_update_option' ) ) { + + /** + * Update Theme options. + * + * @param string $option option key. + * @param Mixed $value option value. + * @return void + */ + function astra_update_option( $option, $value ) { + + do_action( "astra_before_update_option_{$option}", $value, $option ); + + // Get all customizer options. + $theme_options = get_option( ASTRA_THEME_SETTINGS ); + + // Update value in options array. + $theme_options[ $option ] = $value; + + update_option( ASTRA_THEME_SETTINGS, $theme_options ); + + do_action( "astra_after_update_option_{$option}", $value, $option ); + } +} + +if ( ! function_exists( 'astra_delete_option' ) ) { + + /** + * Update Theme options. + * + * @param string $option option key. + * @return void + */ + function astra_delete_option( $option ) { + + do_action( "astra_before_delete_option_{$option}", $option ); + + // Get all customizer options. + $theme_options = get_option( ASTRA_THEME_SETTINGS ); + + // Update value in options array. + unset( $theme_options[ $option ] ); + + update_option( ASTRA_THEME_SETTINGS, $theme_options ); + + do_action( "astra_after_delete_option_{$option}", $option ); + } +} + +/** + * Return Theme options from postmeta. + */ +if ( ! function_exists( 'astra_get_option_meta' ) ) { + + /** + * Return Theme options from postmeta. + * + * @param string $option_id Option ID. + * @param string $default Option default value. + * @param boolean $only_meta Get only meta value. + * @param string $extension Is value from extension. + * @param string $post_id Get value from specific post by post ID. + * @return Mixed Return option value. + */ + function astra_get_option_meta( $option_id, $default = '', $only_meta = false, $extension = '', $post_id = '' ) { + + $post_id = ( '' != $post_id ) ? $post_id : astra_get_post_id(); + + $value = astra_get_option( $option_id, $default ); + + // Get value from option 'post-meta'. + if ( is_singular() || ( is_home() && ! is_front_page() ) ) { + + $value = get_post_meta( $post_id, $option_id, true ); + + if ( empty( $value ) || 'default' == $value ) { + + if ( true === $only_meta ) { + return false; + } + + $value = astra_get_option( $option_id, $default ); + } + } + + /** + * Dynamic filter astra_get_option_meta_$option. + * $option_id is the name of the Astra Meta Setting. + * + * @since 1.0.20 + * @var Mixed. + */ + return apply_filters( "astra_get_option_meta_{$option_id}", $value, $default, $default ); + } +} + +/** + * Helper function to get the current post id. + */ +if ( ! function_exists( 'astra_get_post_id' ) ) { + + /** + * Get post ID. + * + * @param string $post_id_override Get override post ID. + * @return number Post ID. + */ + function astra_get_post_id( $post_id_override = '' ) { + + if ( null == Astra_Theme_Options::$post_id ) { + global $post; + + $post_id = 0; + + if ( is_home() ) { + $post_id = get_option( 'page_for_posts' ); + } elseif ( is_archive() ) { + global $wp_query; + $post_id = $wp_query->get_queried_object_id(); + } elseif ( isset( $post->ID ) && ! is_search() && ! is_category() ) { + $post_id = $post->ID; + } + + Astra_Theme_Options::$post_id = $post_id; + } + + return apply_filters( 'astra_get_post_id', Astra_Theme_Options::$post_id, $post_id_override ); + } +} + + +/** + * Display classes for primary div + */ +if ( ! function_exists( 'astra_primary_class' ) ) { + + /** + * Display classes for primary div + * + * @param string|array $class One or more classes to add to the class list. + * @return void Echo classes. + */ + function astra_primary_class( $class = '' ) { + + // Separates classes with a single space, collates classes for body element. + echo 'class="' . esc_attr( join( ' ', astra_get_primary_class( $class ) ) ) . '"'; + } +} + +/** + * Retrieve the classes for the primary element as an array. + */ +if ( ! function_exists( 'astra_get_primary_class' ) ) { + + /** + * Retrieve the classes for the primary element as an array. + * + * @param string|array $class One or more classes to add to the class list. + * @return array Return array of classes. + */ + function astra_get_primary_class( $class = '' ) { + + // array of class names. + $classes = array(); + + // default class for content area. + $classes[] = 'content-area'; + + // primary base class. + $classes[] = 'primary'; + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + $classes = array_merge( $classes, $class ); + } else { + + // Ensure that we always coerce class to being an array. + $class = array(); + } + + // Filter primary div class names. + $classes = apply_filters( 'astra_primary_class', $classes, $class ); + + $classes = array_map( 'sanitize_html_class', $classes ); + + return array_unique( $classes ); + } +} + +/** + * Display classes for secondary div + */ +if ( ! function_exists( 'astra_secondary_class' ) ) { + + /** + * Retrieve the classes for the secondary element as an array. + * + * @param string|array $class One or more classes to add to the class list. + * @return void echo classes. + */ + function astra_secondary_class( $class = '' ) { + + // Separates classes with a single space, collates classes for body element. + echo 'class="' . esc_attr( join( ' ', astra_get_secondary_class( $class ) ) ) . '"'; + } +} + +/** + * Retrieve the classes for the secondary element as an array. + */ +if ( ! function_exists( 'astra_get_secondary_class' ) ) { + + /** + * Retrieve the classes for the secondary element as an array. + * + * @param string|array $class One or more classes to add to the class list. + * @return array Return array of classes. + */ + function astra_get_secondary_class( $class = '' ) { + + // array of class names. + $classes = array(); + + // default class from widget area. + $classes[] = 'widget-area'; + + // secondary base class. + $classes[] = 'secondary'; + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + $classes = array_merge( $classes, $class ); + } else { + + // Ensure that we always coerce class to being an array. + $class = array(); + } + + // Filter secondary div class names. + $classes = apply_filters( 'astra_secondary_class', $classes, $class ); + + $classes = array_map( 'sanitize_html_class', $classes ); + + return array_unique( $classes ); + } +} + +/** + * Get post format + */ +if ( ! function_exists( 'astra_get_post_format' ) ) { + + /** + * Get post format + * + * @param string $post_format_override Override post formate. + * @return string Return post format. + */ + function astra_get_post_format( $post_format_override = '' ) { + + if ( ( is_home() ) || is_archive() ) { + $post_format = 'blog'; + } else { + $post_format = get_post_format(); + } + + return apply_filters( 'astra_get_post_format', $post_format, $post_format_override ); + } +} + +/** + * Wrapper function for get_the_title() for blog post. + */ +if ( ! function_exists( 'astra_the_post_title' ) ) { + + /** + * Wrapper function for get_the_title() for blog post. + * + * Displays title only if the page title bar is disabled. + * + * @since 1.0.15 + * @param string $before Optional. Content to prepend to the title. + * @param string $after Optional. Content to append to the title. + * @param int $post_id Optional, default to 0. Post id. + * @param bool $echo Optional, default to true.Whether to display or return. + * @return string|void String if $echo parameter is false. + */ + function astra_the_post_title( $before = '', $after = '', $post_id = 0, $echo = true ) { + + $enabled = apply_filters( 'astra_the_post_title_enabled', true ); + if ( $enabled ) { + + $title = astra_get_the_title( $post_id ); + $before = apply_filters( 'astra_the_post_title_before', $before ); + $after = apply_filters( 'astra_the_post_title_after', $after ); + + // This will work same as `the_title` function but with Custom Title if exits. + if ( $echo ) { + echo $before . $title . $after; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } else { + return $before . $title . $after; + } + } + } +} + +/** + * Wrapper function for the_title() + */ +if ( ! function_exists( 'astra_the_title' ) ) { + + /** + * Wrapper function for the_title() + * + * Displays title only if the page title bar is disabled. + * + * @param string $before Optional. Content to prepend to the title. + * @param string $after Optional. Content to append to the title. + * @param int $post_id Optional, default to 0. Post id. + * @param bool $echo Optional, default to true.Whether to display or return. + * @return string|void String if $echo parameter is false. + */ + function astra_the_title( $before = '', $after = '', $post_id = 0, $echo = true ) { + + $title = ''; + $blog_post_title = astra_get_option( 'blog-post-structure' ); + $single_post_title = astra_get_option( 'blog-single-post-structure' ); + + if ( ( ! is_singular() && in_array( 'title-meta', $blog_post_title ) ) || ( is_single() && in_array( 'single-title-meta', $single_post_title ) ) || is_page() ) { + if ( apply_filters( 'astra_the_title_enabled', true ) ) { + + $title = astra_get_the_title( $post_id ); + $before = apply_filters( 'astra_the_title_before', $before ); + $after = apply_filters( 'astra_the_title_after', $after ); + + $title = $before . $title . $after; + } + } + + // This will work same as `the_title` function but with Custom Title if exits. + if ( $echo ) { + echo $title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } else { + return $title; + } + } +} + +/** + * Wrapper function for get_the_title() + */ +if ( ! function_exists( 'astra_get_the_title' ) ) { + + /** + * Wrapper function for get_the_title() + * + * Return title for Title Bar and Normal Title. + * + * @param int $post_id Optional, default to 0. Post id. + * @param bool $echo Optional, default to false. Whether to display or return. + * @return string|void String if $echo parameter is false. + */ + function astra_get_the_title( $post_id = 0, $echo = false ) { + + $title = ''; + if ( $post_id || is_singular() ) { + $title = get_the_title( $post_id ); + } else { + if ( is_front_page() && is_home() ) { + // Default homepage. + $title = apply_filters( 'astra_the_default_home_page_title', esc_html__( 'Home', 'astra' ) ); + } elseif ( is_home() ) { + // blog page. + $title = apply_filters( 'astra_the_blog_home_page_title', get_the_title( get_option( 'page_for_posts', true ) ) ); + } elseif ( is_404() ) { + // for 404 page - title always display. + $title = apply_filters( 'astra_the_404_page_title', esc_html__( 'This page doesn\'t seem to exist.', 'astra' ) ); + + // for search page - title always display. + } elseif ( is_search() ) { + + /* translators: 1: search string */ + $title = apply_filters( 'astra_the_search_page_title', sprintf( __( 'Search Results for: %s', 'astra' ), '' . get_search_query() . '' ) ); + + } elseif ( class_exists( 'WooCommerce' ) && is_shop() ) { + + $title = woocommerce_page_title( false ); + + } elseif ( is_archive() ) { + + $title = get_the_archive_title(); + + } + } + + $title = apply_filters( 'astra_the_title', $title, $post_id ); + + // This will work same as `get_the_title` function but with Custom Title if exits. + if ( $echo ) { + echo $title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } else { + return $title; + } + } +} + +/** + * Archive Page Title + */ +if ( ! function_exists( 'astra_archive_page_info' ) ) { + + /** + * Wrapper function for the_title() + * + * Displays title only if the page title bar is disabled. + */ + function astra_archive_page_info() { + + if ( apply_filters( 'astra_the_title_enabled', true ) ) { + + // Author. + if ( is_author() ) { ?> + +
    +
    + +

    + +

    + +
    +
    + +
    +
    + + + +
    + +

    + + + +
    + + + +
    + +

    + + + +
    + + + +
    + + ' . get_search_query() . '' ) ); + ?> +

    + +
    + + + +
    + + ', '' ); ?> + + + +
    + + hexdec( substr( $hex, 0, 2 ) ), + 'g' => hexdec( substr( $hex, 2, 2 ) ), + 'b' => hexdec( substr( $hex, 4, 2 ) ), + ); + + // Should we darken the color? + if ( 'reverse' == $type && $shortcode_atts['r'] + $shortcode_atts['g'] + $shortcode_atts['b'] > 382 ) { + $steps = -$steps; + } elseif ( 'darken' == $type ) { + $steps = -$steps; + } + + // Build the new color. + $steps = max( -255, min( 255, $steps ) ); + + $shortcode_atts['r'] = max( 0, min( 255, $shortcode_atts['r'] + $steps ) ); + $shortcode_atts['g'] = max( 0, min( 255, $shortcode_atts['g'] + $steps ) ); + $shortcode_atts['b'] = max( 0, min( 255, $shortcode_atts['b'] + $steps ) ); + + $r_hex = str_pad( dechex( $shortcode_atts['r'] ), 2, '0', STR_PAD_LEFT ); + $g_hex = str_pad( dechex( $shortcode_atts['g'] ), 2, '0', STR_PAD_LEFT ); + $b_hex = str_pad( dechex( $shortcode_atts['b'] ), 2, '0', STR_PAD_LEFT ); + + return '#' . $r_hex . $g_hex . $b_hex; + } +} // End if. + +/** + * Convert colors from HEX to RGBA + */ +if ( ! function_exists( 'astra_hex_to_rgba' ) ) : + + /** + * Convert colors from HEX to RGBA + * + * @param string $color Color code in HEX. + * @param boolean $opacity Color code opacity. + * @return string Color code in RGB or RGBA. + */ + function astra_hex_to_rgba( $color, $opacity = false ) { + + $default = 'rgb(0,0,0)'; + + // Return default if no color provided. + if ( empty( $color ) ) { + return $default; + } + + // Sanitize $color if "#" is provided. + if ( '#' == $color[0] ) { + $color = substr( $color, 1 ); + } + + // Check if color has 6 or 3 characters and get values. + if ( 6 == strlen( $color ) ) { + $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] ); + } elseif ( 3 == strlen( $color ) ) { + $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] ); + } else { + return $default; + } + + // Convert HEX to RGB. + $rgb = array_map( 'hexdec', $hex ); + + // Check if opacity is set(RGBA or RGB). + if ( $opacity ) { + if ( 1 < abs( $opacity ) ) { + $opacity = 1.0; + } + $output = 'rgba(' . implode( ',', $rgb ) . ',' . $opacity . ')'; + } else { + $output = 'rgb(' . implode( ',', $rgb ) . ')'; + } + + // Return RGB(a) color string. + return $output; + } + +endif; + + +if ( ! function_exists( 'astra_enable_page_builder_compatibility' ) ) : + + /** + * Allow filter to enable/disable page builder compatibility. + * + * @see https://wpastra.com/docs/recommended-settings-beaver-builder-astra/ + * @see https://wpastra.com/docs/recommended-settings-for-elementor/ + * + * @since 1.2.2 + * @return bool True - If the page builder compatibility is enabled. False - IF the page builder compatibility is disabled. + */ + function astra_enable_page_builder_compatibility() { + return apply_filters( 'astra_enable_page_builder_compatibility', true ); + } + +endif; + + +if ( ! function_exists( 'astra_get_pro_url' ) ) : + /** + * Returns an URL with utm tags + * the admin settings page. + * + * @param string $url URL fo the site. + * @param string $source utm source. + * @param string $medium utm medium. + * @param string $campaign utm campaign. + * @return mixed + */ + function astra_get_pro_url( $url, $source = '', $medium = '', $campaign = '' ) { + + $astra_pro_url = trailingslashit( $url ); + + // Set up our URL if we have a source. + if ( isset( $source ) ) { + $astra_pro_url = add_query_arg( 'utm_source', sanitize_text_field( $source ), $url ); + } + // Set up our URL if we have a medium. + if ( isset( $medium ) ) { + $astra_pro_url = add_query_arg( 'utm_medium', sanitize_text_field( $medium ), $url ); + } + // Set up our URL if we have a campaign. + if ( isset( $campaign ) ) { + $astra_pro_url = add_query_arg( 'utm_campaign', sanitize_text_field( $campaign ), $url ); + } + + return esc_url( apply_filters( 'astra_get_pro_url', $astra_pro_url, $url ) ); + } + +endif; + + +/** + * Search Form + */ +if ( ! function_exists( 'astra_get_search_form' ) ) : + /** + * Display search form. + * + * @param bool $echo Default to echo and not return the form. + * @return string|void String when $echo is false. + */ + function astra_get_search_form( $echo = true ) { + + $form = get_search_form( + array( + 'input_placeholder' => apply_filters( 'astra_search_field_placeholder', esc_attr_x( 'Search …', 'placeholder', 'astra' ) ), + 'data_attributes' => apply_filters( 'astra_search_field_toggle_data_attrs', '' ), + 'input_value' => get_search_query(), + 'show_input_submit' => false, + ) + ); + + /** + * Filters the HTML output of the search form. + * + * @param string $form The search form HTML output. + */ + $result = apply_filters( 'astra_get_search_form', $form ); + + if ( null === $result ) { + $result = $form; + } + + if ( $echo ) { + echo $result; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } else { + return $result; + } + } + +endif; + +/** + * Check if we're being delivered AMP + * + * @return bool + */ +function astra_is_amp_endpoint() { + return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint(); +} + +/* + * Get Responsive Spacing + */ +if ( ! function_exists( 'astra_responsive_spacing' ) ) { + + /** + * Get Spacing value + * + * @param array $option CSS value. + * @param string $side top | bottom | left | right. + * @param string $device CSS device. + * @param string $default Default value. + * @param string $prefix Prefix value. + * @return mixed + */ + function astra_responsive_spacing( $option, $side = '', $device = 'desktop', $default = '', $prefix = '' ) { + + if ( isset( $option[ $device ][ $side ] ) && isset( $option[ $device . '-unit' ] ) ) { + $spacing = astra_get_css_value( $option[ $device ][ $side ], $option[ $device . '-unit' ], $default ); + } elseif ( is_numeric( $option ) ) { + $spacing = astra_get_css_value( $option ); + } else { + $spacing = ( ! is_array( $option ) ) ? $option : ''; + } + + if ( '' !== $prefix && '' !== $spacing ) { + return $prefix . $spacing; + } + return $spacing; + } +} + +/** + * Get the tablet breakpoint value. + * + * @param string $min min. + * @param string $max max. + * + * @since 2.4.0 + * + * @return number $breakpoint. + */ +function astra_get_tablet_breakpoint( $min = '', $max = '' ) { + + $update_breakpoint = astra_get_option( 'can-update-theme-tablet-breakpoint', true ); + + // Change default for new users. + $default = ( true === $update_breakpoint ) ? 921 : 768; + + $header_breakpoint = apply_filters( 'astra_tablet_breakpoint', $default ); + + if ( '' !== $min ) { + $header_breakpoint = $header_breakpoint - $min; + } elseif ( '' !== $max ) { + $header_breakpoint = $header_breakpoint + $max; + } + + return absint( $header_breakpoint ); +} + +/** + * Get the mobile breakpoint value. + * + * @param string $min min. + * @param string $max max. + * + * @since 2.4.0 + * + * @return number header_breakpoint. + */ +function astra_get_mobile_breakpoint( $min = '', $max = '' ) { + + $header_breakpoint = apply_filters( 'astra_mobile_breakpoint', 544 ); + + if ( '' !== $min ) { + $header_breakpoint = $header_breakpoint - $min; + } elseif ( '' !== $max ) { + $header_breakpoint = $header_breakpoint + $max; + } + + return absint( $header_breakpoint ); +} + +/* + * Apply CSS for the element + */ +if ( ! function_exists( 'astra_color_responsive_css' ) ) { + + /** + * Astra Responsive Colors + * + * @param array $setting Responsive colors. + * @param string $css_property CSS property. + * @param string $selector CSS selector. + * @return string Dynamic responsive CSS. + */ + function astra_color_responsive_css( $setting, $css_property, $selector ) { + $css = ''; + if ( isset( $setting['desktop'] ) && ! empty( $setting['desktop'] ) ) { + $css .= $selector . '{' . $css_property . ':' . esc_attr( $setting['desktop'] ) . ';}'; + } + if ( isset( $setting['tablet'] ) && ! empty( $setting['tablet'] ) ) { + $css .= '@media (max-width:' . astra_get_tablet_breakpoint() . 'px) {' . $selector . '{' . $css_property . ':' . esc_attr( $setting['tablet'] ) . ';} }'; + } + if ( isset( $setting['mobile'] ) && ! empty( $setting['mobile'] ) ) { + $css .= '@media (max-width:' . astra_get_mobile_breakpoint() . 'px) {' . $selector . '{' . $css_property . ':' . esc_attr( $setting['mobile'] ) . ';} }'; + } + return $css; + } +} + +if ( ! function_exists( 'astra_check_is_bb_themer_layout' ) ) : + + /** + * Check if layout is bb themer's layout + */ + function astra_check_is_bb_themer_layout() { + + $is_layout = false; + + $post_type = get_post_type(); + $post_id = get_the_ID(); + + if ( 'fl-theme-layout' === $post_type && $post_id ) { + + $is_layout = true; + } + + return $is_layout; + } + +endif; + + +if ( ! function_exists( 'astra_is_white_labelled' ) ) : + + /** + * Check if white label option is enabled in astra pro plugin + */ + function astra_is_white_labelled() { + + if ( is_callable( 'Astra_Ext_White_Label_Markup::show_branding' ) && ! Astra_Ext_White_Label_Markup::show_branding() ) { + return apply_filters( 'astra_is_white_labelled', true ); + } + + return apply_filters( 'astra_is_white_labelled', false ); + } + +endif; + +/** + * Get the value for font-display property. + * + * @since 1.8.6 + * @return string + */ +function astra_get_fonts_display_property() { + return apply_filters( 'astra_fonts_display_property', 'fallback' ); +} + +/** + * Return Theme options from database. + * + * @param string $option Option key. + * @param string $default Option default value. + * @param string $deprecated Option default value. + * @return Mixed Return option value. + */ +function astra_get_db_option( $option, $default = '', $deprecated = '' ) { + + if ( '' != $deprecated ) { + $default = $deprecated; + } + + $theme_options = Astra_Theme_Options::get_db_options(); + + /** + * Filter the options array for Astra Settings. + * + * @since 1.0.20 + * @var Array + */ + $theme_options = apply_filters( 'astra_get_db_option_array', $theme_options, $option, $default ); + + $value = ( isset( $theme_options[ $option ] ) && '' !== $theme_options[ $option ] ) ? $theme_options[ $option ] : $default; + + /** + * Dynamic filter astra_get_option_$option. + * $option is the name of the Astra Setting, Refer Astra_Theme_Options::defaults() for option names from the theme. + * + * @since 1.0.20 + * @var Mixed. + */ + return apply_filters( "astra_get_db_option_{$option}", $value, $option, $default ); +} + +/** + * Generate Responsive Background Color CSS. + * + * @param array $bg_obj_res array of background object. + * @param string $device CSS for which device. + * @return array + */ +function astra_get_responsive_background_obj( $bg_obj_res, $device ) { + + $gen_bg_css = array(); + + if ( ! is_array( $bg_obj_res ) ) { + return; + } + + $bg_obj = $bg_obj_res[ $device ]; + $bg_img = isset( $bg_obj['background-image'] ) ? $bg_obj['background-image'] : ''; + $bg_tab_img = isset( $bg_obj_res['tablet']['background-image'] ) ? $bg_obj_res['tablet']['background-image'] : ''; + $bg_desk_img = isset( $bg_obj_res['desktop']['background-image'] ) ? $bg_obj_res['desktop']['background-image'] : ''; + $bg_color = isset( $bg_obj['background-color'] ) ? $bg_obj['background-color'] : ''; + $tablet_css = ( isset( $bg_obj_res['tablet']['background-image'] ) && $bg_obj_res['tablet']['background-image'] ) ? true : false; + $desktop_css = ( isset( $bg_obj_res['desktop']['background-image'] ) && $bg_obj_res['desktop']['background-image'] ) ? true : false; + + $bg_type = ( isset( $bg_obj['background-type'] ) && $bg_obj['background-type'] ) ? $bg_obj['background-type'] : ''; + + if ( '' !== $bg_type ) { + switch ( $bg_type ) { + case 'color': + if ( '' !== $bg_img && '' !== $bg_color ) { + $gen_bg_css['background-image'] = 'linear-gradient(to right, ' . $bg_color . ', ' . $bg_color . '), url(' . $bg_img . ');'; + } elseif ( 'mobile' === $device ) { + if ( $desktop_css ) { + $gen_bg_css['background-image'] = 'linear-gradient(to right, ' . $bg_color . ', ' . $bg_color . '), url(' . $bg_desk_img . ');'; + } elseif ( $tablet_css ) { + $gen_bg_css['background-image'] = 'linear-gradient(to right, ' . $bg_color . ', ' . $bg_color . '), url(' . $bg_tab_img . ');'; + } else { + $gen_bg_css['background-color'] = $bg_color . ';'; + $gen_bg_css['background-image'] = 'none;'; + } + } elseif ( 'tablet' === $device ) { + if ( $desktop_css ) { + $gen_bg_css['background-image'] = 'linear-gradient(to right, ' . $bg_color . ', ' . $bg_color . '), url(' . $bg_desk_img . ');'; + } else { + $gen_bg_css['background-color'] = $bg_color . ';'; + $gen_bg_css['background-image'] = 'none;'; + } + } elseif ( '' === $bg_img ) { + $gen_bg_css['background-color'] = $bg_color . ';'; + $gen_bg_css['background-image'] = 'none;'; + } + break; + + case 'image': + if ( '' !== $bg_img && '' !== $bg_color && ( ! is_numeric( strpos( $bg_color, 'linear-gradient' ) ) && ! is_numeric( strpos( $bg_color, 'radial-gradient' ) ) ) ) { + $gen_bg_css['background-image'] = 'linear-gradient(to right, ' . $bg_color . ', ' . $bg_color . '), url(' . $bg_img . ');'; + } + if ( '' === $bg_color || is_numeric( strpos( $bg_color, 'linear-gradient' ) ) || is_numeric( strpos( $bg_color, 'radial-gradient' ) ) && '' !== $bg_img ) { + $gen_bg_css['background-image'] = 'url(' . $bg_img . ');'; + } + break; + + case 'gradient': + if ( isset( $bg_color ) ) { + $gen_bg_css['background-image'] = $bg_color . ';'; + } + break; + + default: + break; + } + } elseif ( '' !== $bg_color ) { + $gen_bg_css['background-color'] = $bg_color . ';'; + } + + if ( '' !== $bg_img ) { + if ( isset( $bg_obj['background-repeat'] ) ) { + $gen_bg_css['background-repeat'] = esc_attr( $bg_obj['background-repeat'] ); + } + + if ( isset( $bg_obj['background-position'] ) ) { + $gen_bg_css['background-position'] = esc_attr( $bg_obj['background-position'] ); + } + + if ( isset( $bg_obj['background-size'] ) ) { + $gen_bg_css['background-size'] = esc_attr( $bg_obj['background-size'] ); + } + + if ( isset( $bg_obj['background-attachment'] ) ) { + $gen_bg_css['background-attachment'] = esc_attr( $bg_obj['background-attachment'] ); + } + } + + return $gen_bg_css; +} + +/** + * Common function to check is pagination is enabled on current page. + * + * @since 3.0.1 + * @return boolean + */ +function is_astra_pagination_enabled() { + global $wp_query; + + return ( $wp_query->max_num_pages > 1 && apply_filters( 'astra_pagination_enabled', true ) ); +} + +/** + * Verify is current post comments are enabled or not for applying dynamic CSS. + * + * @since 3.0.1 + * @return boolean + */ +function is_current_post_comment_enabled() { + return ( is_singular() && comments_open() ); +} diff --git a/inc/core/deprecated/deprecated-filters.php b/inc/core/deprecated/deprecated-filters.php index ae044ee..bd3da36 100644 --- a/inc/core/deprecated/deprecated-filters.php +++ b/inc/core/deprecated/deprecated-filters.php @@ -1,87 +1,87 @@ -= 4.6 */ - return apply_filters_deprecated( $tag, $args, $version, $replacement, $message ); - } else { - return apply_filters_ref_array( $tag, $args ); - } - } -} += 4.6 */ + return apply_filters_deprecated( $tag, $args, $version, $replacement, $message ); + } else { + return apply_filters_ref_array( $tag, $args ); + } + } +} diff --git a/inc/core/deprecated/deprecated-functions.php b/inc/core/deprecated/deprecated-functions.php index 779d474..99dea01 100644 --- a/inc/core/deprecated/deprecated-functions.php +++ b/inc/core/deprecated/deprecated-functions.php @@ -1,145 +1,145 @@ -= 4.6 */ - do_action_deprecated( $tag, $args, $version, $replacement, $message ); - } else { - do_action_ref_array( $tag, $args ); - } - } -} += 4.6 */ + do_action_deprecated( $tag, $args, $version, $replacement, $message ); + } else { + do_action_ref_array( $tag, $args ); + } + } +} diff --git a/inc/core/index.php b/inc/core/index.php index 8b96815..820bcb9 100644 --- a/inc/core/index.php +++ b/inc/core/index.php @@ -1,9 +1,9 @@ - - * // Declare support for all hook types - * add_theme_support( 'astra_hooks', array( 'all' ) ); - * - * // Declare support for certain hook types only - * add_theme_support( 'astra_hooks', array( 'header', 'content', 'footer' ) ); - * - */ -add_theme_support( - 'astra_hooks', - array( - - /** - * As a Theme developer, use the 'all' parameter, to declare support for all - * hook types. - * Please make sure you then actually reference all the hooks in this file, - * Plugin developers depend on it! - */ - 'all', - - /** - * Themes can also choose to only support certain hook types. - * Please make sure you then actually reference all the hooks in this type - * family. - * - * When the 'all' parameter was set, specific hook types do not need to be - * added explicitly. - */ - 'html', - 'body', - 'head', - 'header', - 'content', - 'entry', - 'comments', - 'sidebars', - 'sidebar', - 'footer', - - /** - * If/when WordPress Core implements similar methodology, Themes and Plugins - * will be able to check whether the version of THA supplied by the theme - * supports Core hooks. - */ - ) -); - -/** - * Determines, whether the specific hook type is actually supported. - * - * Plugin developers should always check for the support of a specific - * hook type before hooking a callback function to a hook of this type. - * - * Example: - * - * if ( current_theme_supports( 'astra_hooks', 'header' ) ) - * add_action( 'astra_head_top', 'prefix_header_top' ); - * - * - * @param bool $bool true. - * @param array $args The hook type being checked. - * @param array $registered All registered hook types. - * - * @return bool - */ -function astra_current_theme_supports( $bool, $args, $registered ) { - return in_array( $args[0], $registered[0] ) || in_array( 'all', $registered[0] ); -} -add_filter( 'current_theme_supports-astra_hooks', 'astra_current_theme_supports', 10, 3 ); - -/** - * HTML hook - * Special case, useful for , etc. - * $astra_supports[] = 'html; - */ -function astra_html_before() { - do_action( 'astra_html_before' ); -} -/** - * HTML hooks - * $astra_supports[] = 'body'; - */ -function astra_body_top() { - do_action( 'astra_body_top' ); -} - -/** - * Body Bottom - */ -function astra_body_bottom() { - do_action( 'astra_body_bottom' ); -} - -/** - * HTML hooks - * - * $astra_supports[] = 'head'; - */ -function astra_head_top() { - do_action( 'astra_head_top' ); -} - -/** - * Head Bottom - */ -function astra_head_bottom() { - do_action( 'astra_head_bottom' ); -} - -/** - * Semantic
    hooks - * - * $astra_supports[] = 'header'; - */ -function astra_header_before() { - do_action( 'astra_header_before' ); -} - -/** - * Site Header - */ -function astra_header() { - do_action( 'astra_header' ); -} - -/** - * Masthead Top - */ -function astra_masthead_top() { - do_action( 'astra_masthead_top' ); -} - -/** - * Masthead - */ -function astra_masthead() { - do_action( 'astra_masthead' ); -} - -/** - * Masthead Bottom - */ -function astra_masthead_bottom() { - do_action( 'astra_masthead_bottom' ); -} - -/** - * Header After - */ -function astra_header_after() { - do_action( 'astra_header_after' ); -} - -/** - * Main Header bar top - */ -function astra_main_header_bar_top() { - do_action( 'astra_main_header_bar_top' ); -} - -/** - * Main Header bar bottom - */ -function astra_main_header_bar_bottom() { - do_action( 'astra_main_header_bar_bottom' ); -} - -/** - * Main Header Content - */ -function astra_masthead_content() { - do_action( 'astra_masthead_content' ); -} -/** - * Main toggle button before - */ -function astra_masthead_toggle_buttons_before() { - do_action( 'astra_masthead_toggle_buttons_before' ); -} - -/** - * Main toggle buttons - */ -function astra_masthead_toggle_buttons() { - do_action( 'astra_masthead_toggle_buttons' ); -} - -/** - * Main toggle button after - */ -function astra_masthead_toggle_buttons_after() { - do_action( 'astra_masthead_toggle_buttons_after' ); -} - -/** - * Semantic hooks - * - * $astra_supports[] = 'content'; - */ -function astra_content_before() { - do_action( 'astra_content_before' ); -} - -/** - * Content after - */ -function astra_content_after() { - do_action( 'astra_content_after' ); -} - -/** - * Content top - */ -function astra_content_top() { - do_action( 'astra_content_top' ); -} - -/** - * Content bottom - */ -function astra_content_bottom() { - do_action( 'astra_content_bottom' ); -} - -/** - * Content while before - */ -function astra_content_while_before() { - do_action( 'astra_content_while_before' ); -} - -/** - * Content loop - */ -function astra_content_loop() { - do_action( 'astra_content_loop' ); -} - -/** - * Conten Page Loop. - * - * Called from page.php - */ -function astra_content_page_loop() { - do_action( 'astra_content_page_loop' ); -} - -/** - * Content while after - */ -function astra_content_while_after() { - do_action( 'astra_content_while_after' ); -} - -/** - * Semantic hooks - * - * $astra_supports[] = 'entry'; - */ -function astra_entry_before() { - do_action( 'astra_entry_before' ); -} - -/** - * Entry after - */ -function astra_entry_after() { - do_action( 'astra_entry_after' ); -} - -/** - * Entry content before - */ -function astra_entry_content_before() { - do_action( 'astra_entry_content_before' ); -} - -/** - * Entry content after - */ -function astra_entry_content_after() { - do_action( 'astra_entry_content_after' ); -} - -/** - * Entry Top - */ -function astra_entry_top() { - do_action( 'astra_entry_top' ); -} - -/** - * Entry bottom - */ -function astra_entry_bottom() { - do_action( 'astra_entry_bottom' ); -} - -/** - * Single Post Header Before - */ -function astra_single_header_before() { - do_action( 'astra_single_header_before' ); -} - -/** - * Single Post Header After - */ -function astra_single_header_after() { - do_action( 'astra_single_header_after' ); -} - -/** - * Single Post Header Top - */ -function astra_single_header_top() { - do_action( 'astra_single_header_top' ); -} - -/** - * Single Post Header Bottom - */ -function astra_single_header_bottom() { - do_action( 'astra_single_header_bottom' ); -} - -/** - * Comments block hooks - * - * $astra_supports[] = 'comments'; - */ -function astra_comments_before() { - do_action( 'astra_comments_before' ); -} - -/** - * Comments after. - */ -function astra_comments_after() { - do_action( 'astra_comments_after' ); -} - -/** - * Semantic hooks - * - * $astra_supports[] = 'sidebar'; - */ -function astra_sidebars_before() { - do_action( 'astra_sidebars_before' ); -} - -/** - * Sidebars after - */ -function astra_sidebars_after() { - do_action( 'astra_sidebars_after' ); -} - -/** - * Semantic
    hooks - * - * $astra_supports[] = 'footer'; - */ -function astra_footer() { - do_action( 'astra_footer' ); -} - -/** - * Footer before - */ -function astra_footer_before() { - do_action( 'astra_footer_before' ); -} - -/** - * Footer after - */ -function astra_footer_after() { - do_action( 'astra_footer_after' ); -} - -/** - * Footer top - */ -function astra_footer_content_top() { - do_action( 'astra_footer_content_top' ); -} - -/** - * Footer - */ -function astra_footer_content() { - do_action( 'astra_footer_content' ); -} - -/** - * Footer bottom - */ -function astra_footer_content_bottom() { - do_action( 'astra_footer_content_bottom' ); -} - -/** - * Archive header - */ -function astra_archive_header() { - do_action( 'astra_archive_header' ); -} - -/** - * Pagination - */ -function astra_pagination() { - do_action( 'astra_pagination' ); -} - -/** - * Entry content single - */ -function astra_entry_content_single() { - do_action( 'astra_entry_content_single' ); -} - -/** - * 404 - */ -function astra_entry_content_404_page() { - do_action( 'astra_entry_content_404_page' ); -} - -/** - * Entry content blog - */ -function astra_entry_content_blog() { - do_action( 'astra_entry_content_blog' ); -} - -/** - * Blog featured post section - */ -function astra_blog_post_featured_format() { - do_action( 'astra_blog_post_featured_format' ); -} - -/** - * Primary Content Top - */ -function astra_primary_content_top() { - do_action( 'astra_primary_content_top' ); -} - -/** - * Primary Content Bottom - */ -function astra_primary_content_bottom() { - do_action( 'astra_primary_content_bottom' ); -} - -/** - * 404 Page content template action. - */ -function astra_404_content_template() { - do_action( 'astra_404_content_template' ); -} - -if ( ! function_exists( 'wp_body_open' ) ) { - - /** - * Fire the wp_body_open action. - * Adds backward compatibility for WordPress versions < 5.2 - * - * @since 1.8.7 - */ - function wp_body_open() { - do_action( 'wp_body_open' ); - } -} + + * // Declare support for all hook types + * add_theme_support( 'astra_hooks', array( 'all' ) ); + * + * // Declare support for certain hook types only + * add_theme_support( 'astra_hooks', array( 'header', 'content', 'footer' ) ); + * + */ +add_theme_support( + 'astra_hooks', + array( + + /** + * As a Theme developer, use the 'all' parameter, to declare support for all + * hook types. + * Please make sure you then actually reference all the hooks in this file, + * Plugin developers depend on it! + */ + 'all', + + /** + * Themes can also choose to only support certain hook types. + * Please make sure you then actually reference all the hooks in this type + * family. + * + * When the 'all' parameter was set, specific hook types do not need to be + * added explicitly. + */ + 'html', + 'body', + 'head', + 'header', + 'content', + 'entry', + 'comments', + 'sidebars', + 'sidebar', + 'footer', + + /** + * If/when WordPress Core implements similar methodology, Themes and Plugins + * will be able to check whether the version of THA supplied by the theme + * supports Core hooks. + */ + ) +); + +/** + * Determines, whether the specific hook type is actually supported. + * + * Plugin developers should always check for the support of a specific + * hook type before hooking a callback function to a hook of this type. + * + * Example: + * + * if ( current_theme_supports( 'astra_hooks', 'header' ) ) + * add_action( 'astra_head_top', 'prefix_header_top' ); + * + * + * @param bool $bool true. + * @param array $args The hook type being checked. + * @param array $registered All registered hook types. + * + * @return bool + */ +function astra_current_theme_supports( $bool, $args, $registered ) { + return in_array( $args[0], $registered[0] ) || in_array( 'all', $registered[0] ); +} +add_filter( 'current_theme_supports-astra_hooks', 'astra_current_theme_supports', 10, 3 ); + +/** + * HTML hook + * Special case, useful for , etc. + * $astra_supports[] = 'html; + */ +function astra_html_before() { + do_action( 'astra_html_before' ); +} +/** + * HTML hooks + * $astra_supports[] = 'body'; + */ +function astra_body_top() { + do_action( 'astra_body_top' ); +} + +/** + * Body Bottom + */ +function astra_body_bottom() { + do_action( 'astra_body_bottom' ); +} + +/** + * HTML hooks + * + * $astra_supports[] = 'head'; + */ +function astra_head_top() { + do_action( 'astra_head_top' ); +} + +/** + * Head Bottom + */ +function astra_head_bottom() { + do_action( 'astra_head_bottom' ); +} + +/** + * Semantic
    hooks + * + * $astra_supports[] = 'header'; + */ +function astra_header_before() { + do_action( 'astra_header_before' ); +} + +/** + * Site Header + */ +function astra_header() { + do_action( 'astra_header' ); +} + +/** + * Masthead Top + */ +function astra_masthead_top() { + do_action( 'astra_masthead_top' ); +} + +/** + * Masthead + */ +function astra_masthead() { + do_action( 'astra_masthead' ); +} + +/** + * Masthead Bottom + */ +function astra_masthead_bottom() { + do_action( 'astra_masthead_bottom' ); +} + +/** + * Header After + */ +function astra_header_after() { + do_action( 'astra_header_after' ); +} + +/** + * Main Header bar top + */ +function astra_main_header_bar_top() { + do_action( 'astra_main_header_bar_top' ); +} + +/** + * Main Header bar bottom + */ +function astra_main_header_bar_bottom() { + do_action( 'astra_main_header_bar_bottom' ); +} + +/** + * Main Header Content + */ +function astra_masthead_content() { + do_action( 'astra_masthead_content' ); +} +/** + * Main toggle button before + */ +function astra_masthead_toggle_buttons_before() { + do_action( 'astra_masthead_toggle_buttons_before' ); +} + +/** + * Main toggle buttons + */ +function astra_masthead_toggle_buttons() { + do_action( 'astra_masthead_toggle_buttons' ); +} + +/** + * Main toggle button after + */ +function astra_masthead_toggle_buttons_after() { + do_action( 'astra_masthead_toggle_buttons_after' ); +} + +/** + * Semantic hooks + * + * $astra_supports[] = 'content'; + */ +function astra_content_before() { + do_action( 'astra_content_before' ); +} + +/** + * Content after + */ +function astra_content_after() { + do_action( 'astra_content_after' ); +} + +/** + * Content top + */ +function astra_content_top() { + do_action( 'astra_content_top' ); +} + +/** + * Content bottom + */ +function astra_content_bottom() { + do_action( 'astra_content_bottom' ); +} + +/** + * Content while before + */ +function astra_content_while_before() { + do_action( 'astra_content_while_before' ); +} + +/** + * Content loop + */ +function astra_content_loop() { + do_action( 'astra_content_loop' ); +} + +/** + * Conten Page Loop. + * + * Called from page.php + */ +function astra_content_page_loop() { + do_action( 'astra_content_page_loop' ); +} + +/** + * Content while after + */ +function astra_content_while_after() { + do_action( 'astra_content_while_after' ); +} + +/** + * Semantic hooks + * + * $astra_supports[] = 'entry'; + */ +function astra_entry_before() { + do_action( 'astra_entry_before' ); +} + +/** + * Entry after + */ +function astra_entry_after() { + do_action( 'astra_entry_after' ); +} + +/** + * Entry content before + */ +function astra_entry_content_before() { + do_action( 'astra_entry_content_before' ); +} + +/** + * Entry content after + */ +function astra_entry_content_after() { + do_action( 'astra_entry_content_after' ); +} + +/** + * Entry Top + */ +function astra_entry_top() { + do_action( 'astra_entry_top' ); +} + +/** + * Entry bottom + */ +function astra_entry_bottom() { + do_action( 'astra_entry_bottom' ); +} + +/** + * Single Post Header Before + */ +function astra_single_header_before() { + do_action( 'astra_single_header_before' ); +} + +/** + * Single Post Header After + */ +function astra_single_header_after() { + do_action( 'astra_single_header_after' ); +} + +/** + * Single Post Header Top + */ +function astra_single_header_top() { + do_action( 'astra_single_header_top' ); +} + +/** + * Single Post Header Bottom + */ +function astra_single_header_bottom() { + do_action( 'astra_single_header_bottom' ); +} + +/** + * Comments block hooks + * + * $astra_supports[] = 'comments'; + */ +function astra_comments_before() { + do_action( 'astra_comments_before' ); +} + +/** + * Comments after. + */ +function astra_comments_after() { + do_action( 'astra_comments_after' ); +} + +/** + * Semantic hooks + * + * $astra_supports[] = 'sidebar'; + */ +function astra_sidebars_before() { + do_action( 'astra_sidebars_before' ); +} + +/** + * Sidebars after + */ +function astra_sidebars_after() { + do_action( 'astra_sidebars_after' ); +} + +/** + * Semantic
    hooks + * + * $astra_supports[] = 'footer'; + */ +function astra_footer() { + do_action( 'astra_footer' ); +} + +/** + * Footer before + */ +function astra_footer_before() { + do_action( 'astra_footer_before' ); +} + +/** + * Footer after + */ +function astra_footer_after() { + do_action( 'astra_footer_after' ); +} + +/** + * Footer top + */ +function astra_footer_content_top() { + do_action( 'astra_footer_content_top' ); +} + +/** + * Footer + */ +function astra_footer_content() { + do_action( 'astra_footer_content' ); +} + +/** + * Footer bottom + */ +function astra_footer_content_bottom() { + do_action( 'astra_footer_content_bottom' ); +} + +/** + * Archive header + */ +function astra_archive_header() { + do_action( 'astra_archive_header' ); +} + +/** + * Pagination + */ +function astra_pagination() { + do_action( 'astra_pagination' ); +} + +/** + * Entry content single + */ +function astra_entry_content_single() { + do_action( 'astra_entry_content_single' ); +} + +/** + * 404 + */ +function astra_entry_content_404_page() { + do_action( 'astra_entry_content_404_page' ); +} + +/** + * Entry content blog + */ +function astra_entry_content_blog() { + do_action( 'astra_entry_content_blog' ); +} + +/** + * Blog featured post section + */ +function astra_blog_post_featured_format() { + do_action( 'astra_blog_post_featured_format' ); +} + +/** + * Primary Content Top + */ +function astra_primary_content_top() { + do_action( 'astra_primary_content_top' ); +} + +/** + * Primary Content Bottom + */ +function astra_primary_content_bottom() { + do_action( 'astra_primary_content_bottom' ); +} + +/** + * 404 Page content template action. + */ +function astra_404_content_template() { + do_action( 'astra_404_content_template' ); +} + +if ( ! function_exists( 'wp_body_open' ) ) { + + /** + * Fire the wp_body_open action. + * Adds backward compatibility for WordPress versions < 5.2 + * + * @since 1.8.7 + */ + function wp_body_open() { + do_action( 'wp_body_open' ); + } +} diff --git a/inc/core/view-general.php b/inc/core/view-general.php index 7194851..bec5b92 100644 --- a/inc/core/view-general.php +++ b/inc/core/view-general.php @@ -1,45 +1,45 @@ - - -
    -
    -
    -
    - -

    - - - - - -
    -
    -
    - - - - - -
    -
    -
    - -
    -
    - - -
    + + +
    +
    +
    +
    + +

    + + + + + +
    +
    +
    + + + + + +
    +
    +
    + +
    +
    + + +
    diff --git a/inc/customizer/astra-pro/class-astra-pro-customizer.php b/inc/customizer/astra-pro/class-astra-pro-customizer.php index a9a8f4c..6d1455d 100644 --- a/inc/customizer/astra-pro/class-astra-pro-customizer.php +++ b/inc/customizer/astra-pro/class-astra-pro-customizer.php @@ -1,79 +1,79 @@ -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 }} - <# } #> -

    -
  • - 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', 'upgrade-link', 'upgrade-to-pro' ) ), - '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(); + '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', 'upgrade-link', 'upgrade-to-pro' ) ), + '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(); diff --git a/inc/customizer/astra-pro/index.php b/inc/customizer/astra-pro/index.php index 8b96815..820bcb9 100644 --- a/inc/customizer/astra-pro/index.php +++ b/inc/customizer/astra-pro/index.php @@ -1,9 +1,9 @@ - ' . $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 ); - } - } -} + ' . $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 ); + } + } +} diff --git a/inc/customizer/class-astra-customizer-register-sections-panels.php b/inc/customizer/class-astra-customizer-register-sections-panels.php index 1212216..f8362c0 100644 --- a/inc/customizer/class-astra-customizer-register-sections-panels.php +++ b/inc/customizer/class-astra-customizer-register-sections-panels.php @@ -1,389 +1,389 @@ - '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/', 'customizer', 'site-layout', 'helpful-information' ), - ), - ), - array( - 'text' => __( 'Container Overview', 'astra' ) . ' »', - 'attrs' => array( - 'href' => astra_get_pro_url( 'https://wpastra.com/docs/container-overview/', 'customizer', 'container', 'helpful-information' ), - ), - ), - ), - ) - ), - ), - - /* - * 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/', 'customizer', 'site-identity', 'helpful-information' ), - ), - ), - ), - ) - ), - ), - - /* - * 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/', 'customizer', 'primary-header', 'helpful-information' ), - ), - ), - ), - ) - ), - ), - - 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/', 'customizer', 'footer-bar', 'helpful-information' ), - ), - ), - ), - ) - ), - ), - - 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-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/', 'customizer', 'sidebar', 'helpful-information' ), - ), - ), - ), - ) - ), - ), - - /** - * Performance Panel - * - * @since 3.6.0 - */ - array( - 'name' => 'section-performance', - 'type' => 'section', - 'priority' => 65, - 'title' => __( 'Performance', 'astra' ), - ), - - /** - * 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/', 'customizer', 'colors-background', 'helpful-information' ), - ), - ), - ), - ) - ), - '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/', 'customizer', 'typography', 'helpful-information' ), - ), - ), - ), - ) - ), - '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', - ), - - ); - return array_merge( $configurations, $configs ); - } - } -} - - -/** - * Kicking this off by calling 'get_instance()' method - */ -new Astra_Customizer_Register_Sections_Panels(); + '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/', 'customizer', 'site-layout', 'helpful-information' ), + ), + ), + array( + 'text' => __( 'Container Overview', 'astra' ) . ' »', + 'attrs' => array( + 'href' => astra_get_pro_url( 'https://wpastra.com/docs/container-overview/', 'customizer', 'container', 'helpful-information' ), + ), + ), + ), + ) + ), + ), + + /* + * 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/', 'customizer', 'site-identity', 'helpful-information' ), + ), + ), + ), + ) + ), + ), + + /* + * 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/', 'customizer', 'primary-header', 'helpful-information' ), + ), + ), + ), + ) + ), + ), + + 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/', 'customizer', 'footer-bar', 'helpful-information' ), + ), + ), + ), + ) + ), + ), + + 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-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/', 'customizer', 'sidebar', 'helpful-information' ), + ), + ), + ), + ) + ), + ), + + /** + * Performance Panel + * + * @since 3.6.0 + */ + array( + 'name' => 'section-performance', + 'type' => 'section', + 'priority' => 65, + 'title' => __( 'Performance', 'astra' ), + ), + + /** + * 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/', 'customizer', 'colors-background', 'helpful-information' ), + ), + ), + ), + ) + ), + '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/', 'customizer', 'typography', 'helpful-information' ), + ), + ), + ), + ) + ), + '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', + ), + + ); + return array_merge( $configurations, $configs ); + } + } +} + + +/** + * Kicking this off by calling 'get_instance()' method + */ +new Astra_Customizer_Register_Sections_Panels(); diff --git a/inc/customizer/class-astra-customizer-sanitizes.php b/inc/customizer/class-astra-customizer-sanitizes.php index a95787b..53e884d 100644 --- a/inc/customizer/class-astra-customizer-sanitizes.php +++ b/inc/customizer/class-astra-customizer-sanitizes.php @@ -1,682 +1,682 @@ -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']; - } - - $dv = (float) $val / $input_attrs['step']; - - $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 number $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 ''; - } - - 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', - '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'] ); - - 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', - 'background-media' => '', - 'background-type' => '', - ), - 'tablet' => array( - 'background-color' => '', - 'background-image' => '', - 'background-repeat' => 'repeat', - 'background-position' => 'center center', - 'background-size' => 'auto', - 'background-attachment' => 'scroll', - 'background-media' => '', - 'background-type' => '', - ), - 'mobile' => array( - 'background-color' => '', - 'background-image' => '', - 'background-repeat' => 'repeat', - 'background-position' => 'center center', - 'background-size' => 'auto', - 'background-attachment' => 'scroll', - '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(); +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']; + } + + $dv = (float) $val / $input_attrs['step']; + + $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 number $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 ''; + } + + 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', + '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'] ); + + 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', + 'background-media' => '', + 'background-type' => '', + ), + 'tablet' => array( + 'background-color' => '', + 'background-image' => '', + 'background-repeat' => 'repeat', + 'background-position' => 'center center', + 'background-size' => 'auto', + 'background-attachment' => 'scroll', + 'background-media' => '', + 'background-type' => '', + ), + 'mobile' => array( + 'background-color' => '', + 'background-image' => '', + 'background-repeat' => 'repeat', + 'background-position' => 'center center', + 'background-size' => 'auto', + 'background-attachment' => 'scroll', + '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(); diff --git a/inc/customizer/class-astra-customizer.php b/inc/customizer/class-astra-customizer.php index 037e052..cfc7aea 100644 --- a/inc/customizer/class-astra-customizer.php +++ b/inc/customizer/class-astra-customizer.php @@ -1,1534 +1,1534 @@ -' ) && is_customize_preview() ) { - add_filter( 'gutenberg_use_widgets_block_editor', '__return_false' ); - } - - add_action( 'customize_controls_enqueue_scripts', array( $this, 'controls_scripts' ) ); - add_filter( '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_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' ) ); - } - - /** - * Reset font folder - * - * @access public - * @return void - * - * @since 3.6.0 - */ - public function regenerate_astra_fonts_folder() { - - check_ajax_referer( 'astra-regenerate-local-fonts', 'nonce' ); - - if ( ! current_user_can( 'edit_theme_options' ) ) { - wp_send_json_error( 'invalid_permissions' ); - } - - if ( astra_get_option( 'load-google-fonts-locally' ) ) { - $local_font_loader = astra_webfont_loader_instance( '' ); - $flushed = $local_font_loader->astra_delete_fonts_folder(); - - if ( ! $flushed ) { - wp_send_json_error( 'failed_to_flush' ); - } - wp_send_json_success(); - } - - wp_send_json_error( 'no_font_loader' ); - } - - /** - * 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_get_option( 'load-google-fonts-locally' ) ) { - $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']; - } - } - 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-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-responsive': - if ( ! is_array( $val ) || is_numeric( $val ) ) { - - $configuration['value'] = array( - 'desktop' => $val, - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => '', - 'tablet-unit' => '', - 'mobile-unit' => '', - ); - } - 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; - - 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' ); - - $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' ), - ); - - - 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' ); - - 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' ); - - if ( false !== astra_get_prop( $config, 'font-type', false ) ) { - $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, - ); - - 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': - $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() { - - // Localize variables for Dev mode > Customizer JS. - wp_localize_script( - SCRIPT_DEBUG ? 'astra-custom-control-react-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(), - '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' ), - ) - ); - - if ( is_rtl() ) { - $builder_customizer_css_file = 'ast-builder-customizer-rtl'; - } else { - $builder_customizer_css_file = 'ast-builder-customizer'; - } - - // 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 - ); - } - - /** - * 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/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/performance/class-astra-performance-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-font-variant', - array( - 'callback' => 'Astra_Control_Font_Variant', - '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'; - $css_prefix = '.css'; - $dir = 'unminified'; - } - - if ( is_rtl() ) { - $css_prefix = '.min-rtl.css'; - if ( SCRIPT_DEBUG ) { - $css_prefix = '-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/' . $dir . '/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/' . $dir . '/customizer-controls' . $css_prefix, null, ASTRA_THEME_VERSION ); - - $string = $this->generate_font_dropdown(); - - $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, - 'is_pro' => defined( 'ASTRA_EXT_VER' ), - 'upgrade_link' => htmlspecialchars_decode( astra_get_pro_url( 'https://wpastra.com/pricing/', '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(), - 'has_block_editor_support' => Astra_Dynamic_CSS::is_block_editor_support_enabled(), - 'updated_gb_outline_button_patterns' => astra_button_default_padding_updated(), - ); - - 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 ); - - 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(); +' ) && is_customize_preview() ) { + add_filter( 'gutenberg_use_widgets_block_editor', '__return_false' ); + } + + add_action( 'customize_controls_enqueue_scripts', array( $this, 'controls_scripts' ) ); + add_filter( '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_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' ) ); + } + + /** + * Reset font folder + * + * @access public + * @return void + * + * @since 3.6.0 + */ + public function regenerate_astra_fonts_folder() { + + check_ajax_referer( 'astra-regenerate-local-fonts', 'nonce' ); + + if ( ! current_user_can( 'edit_theme_options' ) ) { + wp_send_json_error( 'invalid_permissions' ); + } + + if ( astra_get_option( 'load-google-fonts-locally' ) ) { + $local_font_loader = astra_webfont_loader_instance( '' ); + $flushed = $local_font_loader->astra_delete_fonts_folder(); + + if ( ! $flushed ) { + wp_send_json_error( 'failed_to_flush' ); + } + wp_send_json_success(); + } + + wp_send_json_error( 'no_font_loader' ); + } + + /** + * 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_get_option( 'load-google-fonts-locally' ) ) { + $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']; + } + } + 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-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-responsive': + if ( ! is_array( $val ) || is_numeric( $val ) ) { + + $configuration['value'] = array( + 'desktop' => $val, + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => '', + 'tablet-unit' => '', + 'mobile-unit' => '', + ); + } + 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; + + 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' ); + + $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' ), + ); + + + 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' ); + + 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' ); + + if ( false !== astra_get_prop( $config, 'font-type', false ) ) { + $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, + ); + + 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': + $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() { + + // Localize variables for Dev mode > Customizer JS. + wp_localize_script( + SCRIPT_DEBUG ? 'astra-custom-control-react-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(), + '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' ), + ) + ); + + if ( is_rtl() ) { + $builder_customizer_css_file = 'ast-builder-customizer-rtl'; + } else { + $builder_customizer_css_file = 'ast-builder-customizer'; + } + + // 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 + ); + } + + /** + * 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/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/performance/class-astra-performance-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-font-variant', + array( + 'callback' => 'Astra_Control_Font_Variant', + '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'; + $css_prefix = '.css'; + $dir = 'unminified'; + } + + if ( is_rtl() ) { + $css_prefix = '.min-rtl.css'; + if ( SCRIPT_DEBUG ) { + $css_prefix = '-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/' . $dir . '/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/' . $dir . '/customizer-controls' . $css_prefix, null, ASTRA_THEME_VERSION ); + + $string = $this->generate_font_dropdown(); + + $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, + 'is_pro' => defined( 'ASTRA_EXT_VER' ), + 'upgrade_link' => htmlspecialchars_decode( astra_get_pro_url( 'https://wpastra.com/pricing/', '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(), + 'has_block_editor_support' => Astra_Dynamic_CSS::is_block_editor_support_enabled(), + 'updated_gb_outline_button_patterns' => astra_button_default_padding_updated(), + ); + + 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 ); + + 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(); diff --git a/inc/customizer/class-astra-font-families.php b/inc/customizer/class-astra-font-families.php index 6da5e29..92b44ec 100644 --- a/inc/customizer/class-astra-font-families.php +++ b/inc/customizer/class-astra-font-families.php @@ -1,171 +1,171 @@ - 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 ); - } - - /** - * 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; + 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 ); + } + + /** + * 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; diff --git a/inc/customizer/class-astra-fonts-data.php b/inc/customizer/class-astra-fonts-data.php index fc5f52c..bce8dd6 100644 --- a/inc/customizer/class-astra-fonts-data.php +++ b/inc/customizer/class-astra-fonts-data.php @@ -1,44 +1,44 @@ - (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_get_option( 'load-google-fonts-locally' ) && ! is_customize_preview() && ! is_admin() ) { - if ( astra_get_option( 'preload-local-fonts' ) ) { - ast_load_preload_local_fonts( $google_font_url ); - } - wp_enqueue_style( 'astra-google-fonts', ast_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 add_query_arg( $font_args, $base_url ); - } - - return ''; - } -} + (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_get_option( 'load-google-fonts-locally' ) && ! is_customize_preview() && ! is_admin() ) { + if ( astra_get_option( 'preload-local-fonts' ) ) { + ast_load_preload_local_fonts( $google_font_url ); + } + wp_enqueue_style( 'astra-google-fonts', ast_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 add_query_arg( $font_args, $base_url ); + } + + return ''; + } +} diff --git a/inc/customizer/configurations/buttons/class-astra-customizer-button-configs.php b/inc/customizer/configurations/buttons/class-astra-customizer-button-configs.php index b153ee6..7c49a4d 100644 --- a/inc/customizer/configurations/buttons/class-astra-customizer-button-configs.php +++ b/inc/customizer/configurations/buttons/class-astra-customizer-button-configs.php @@ -1,484 +1,484 @@ - ASTRA_THEME_SETTINGS . '[theme-button-color-group]', - 'default' => astra_get_option( 'theme-button-color-group' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Text Color', 'astra' ), - 'section' => 'section-buttons', - 'transport' => 'postMessage', - 'priority' => 18, - ), - - /** - * Group: Theme Button background colors Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[theme-button-bg-color-group]', - 'default' => astra_get_option( 'theme-button-bg-color-group' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Background Color', 'astra' ), - 'section' => 'section-buttons', - 'transport' => 'postMessage', - 'priority' => 18.5, - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Button Color - */ - array( - 'name' => 'button-color', - 'default' => astra_get_option( 'button-color' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-color-group]', - 'section' => 'section-buttons', - 'control' => 'ast-color', - 'title' => __( 'Normal', 'astra' ), - ), - - /** - * Option: Button Hover Color - */ - array( - 'name' => 'button-h-color', - 'default' => astra_get_option( 'button-h-color' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-color-group]', - 'section' => 'section-buttons', - 'control' => 'ast-color', - 'title' => __( 'Hover', 'astra' ), - 'priority' => 39, - ), - - /** - * Option: Button Background Color - */ - array( - 'name' => 'button-bg-color', - 'default' => astra_get_option( 'button-bg-color' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-bg-color-group]', - 'section' => 'section-buttons', - 'control' => 'ast-color', - 'title' => __( 'Normal', 'astra' ), - ), - - /** - * Option: Button Background Hover Color - */ - array( - 'name' => 'button-bg-h-color', - 'default' => astra_get_option( 'button-bg-h-color' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-bg-color-group]', - 'section' => 'section-buttons', - 'control' => 'ast-color', - 'title' => __( 'Hover', 'astra' ), - 'priority' => 40, - ), - - /** - * Option: Global Button Border Size - */ - array( - 'type' => 'control', - 'section' => 'section-buttons', - 'control' => 'ast-border', - 'name' => ASTRA_THEME_SETTINGS . '[theme-button-border-group-border-size]', - 'transport' => 'postMessage', - 'linked_choices' => true, - 'priority' => 19, - 'default' => astra_get_option( 'theme-button-border-group-border-size' ), - 'title' => __( 'Border Width', 'astra' ), - 'choices' => array( - 'top' => __( 'Top', 'astra' ), - 'right' => __( 'Right', 'astra' ), - 'bottom' => __( 'Bottom', 'astra' ), - 'left' => __( 'Left', 'astra' ), - ), - ), - - /** - * Group: Theme Button Border Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[theme-button-border-color-group]', - 'default' => astra_get_option( 'theme-button-border-color-group' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Border Color', 'astra' ), - 'section' => 'section-buttons', - 'transport' => 'postMessage', - 'priority' => 19, - ), - - /** - * Option: Global Button Border Color - */ - array( - 'name' => 'theme-button-border-group-border-color', - 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-border-color-group]', - 'default' => astra_get_option( 'theme-button-border-group-border-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'section' => 'section-buttons', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 19, - 'title' => __( 'Border Color', 'astra' ), - ), - - /** - * Option: Global Button Border Hover Color - */ - array( - 'name' => 'theme-button-border-group-border-h-color', - 'default' => astra_get_option( 'theme-button-border-group-border-h-color' ), - 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-border-color-group]', - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'section' => 'section-buttons', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 19, - 'title' => __( 'Border Hover Color', 'astra' ), - ), - - /** - * Option: Global Button Radius - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[button-radius]', - 'default' => astra_get_option( 'button-radius' ), - 'type' => 'control', - 'section' => 'section-buttons', - 'control' => 'ast-slider', - 'priority' => 19, - 'suffix' => 'px', - 'title' => __( 'Border Radius', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - 'step' => 1, - 'max' => 200, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Theme Button Padding - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[theme-button-padding]', - 'default' => astra_get_option( 'theme-button-padding' ), - 'type' => 'control', - 'control' => 'ast-responsive-spacing', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), - 'section' => 'section-buttons', - 'title' => __( 'Padding', 'astra' ), - 'linked_choices' => true, - 'transport' => 'postMessage', - 'unit_choices' => array( 'px', 'em', '%' ), - 'choices' => array( - 'top' => __( 'Top', 'astra' ), - 'right' => __( 'Right', 'astra' ), - 'bottom' => __( 'Bottom', 'astra' ), - 'left' => __( 'Left', 'astra' ), - ), - 'priority' => 35, - 'connected' => false, - ), - - ); - - if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - $_trans_config = array( - /** - * Option: Transparent Header Button Colors Divider - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-divider]', - 'type' => 'control', - 'control' => 'ast-heading', - 'section' => 'section-transparent-header', - 'title' => __( 'Header Button', 'astra' ), - 'settings' => array(), - 'priority' => 40, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', - 'operator' => '===', - 'value' => 'custom-button', - ), - ), - ), - /** - * Group: Transparent Header Button Colors Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]', - 'default' => astra_get_option( 'transparent-header-button-color-group' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Colors', 'astra' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 40, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', - 'operator' => '===', - 'value' => 'custom-button', - ), - ), - ), - /** - * Group: Transparent Header Button Border Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]', - 'default' => astra_get_option( 'transparent-header-button-border-group' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Border', 'astra' ), - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'priority' => 40, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', - 'operator' => '===', - 'value' => 'custom-button', - ), - ), - ), - - /** - * Option: Button Text Color - */ - array( - 'name' => 'header-main-rt-trans-section-button-text-color', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'header-main-rt-trans-section-button-text-color' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Normal', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 10, - 'title' => __( 'Text Color', 'astra' ), - ), - - /** - * Option: Button Text Hover Color - */ - array( - 'name' => 'header-main-rt-trans-section-button-text-h-color', - 'default' => astra_get_option( 'header-main-rt-trans-section-button-text-h-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Hover', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 10, - 'title' => __( 'Text Color', 'astra' ), - ), - - /** - * Option: Button Background Color - */ - array( - 'name' => 'header-main-rt-trans-section-button-back-color', - 'default' => astra_get_option( 'header-main-rt-trans-section-button-back-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Normal', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 10, - 'title' => __( 'Background Color', 'astra' ), - ), - - /** - * Option: Button Button Hover Color - */ - array( - 'name' => 'header-main-rt-trans-section-button-back-h-color', - 'default' => astra_get_option( 'header-main-rt-trans-section-button-back-h-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]', - 'section' => 'section-transparent-header', - 'tab' => __( 'Hover', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 10, - 'title' => __( 'Background Color', 'astra' ), - ), - - // Option: Custom Menu Button Border. - array( - 'type' => 'control', - 'control' => 'ast-responsive-spacing', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), - 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-trans-section-button-padding]', - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'linked_choices' => true, - 'priority' => 40, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', - 'operator' => '===', - 'value' => 'custom-button', - ), - ), - 'default' => astra_get_option( 'header-main-rt-trans-section-button-padding' ), - 'title' => __( 'Padding', 'astra' ), - 'choices' => array( - 'top' => __( 'Top', 'astra' ), - 'right' => __( 'Right', 'astra' ), - 'bottom' => __( 'Bottom', 'astra' ), - 'left' => __( 'Left', 'astra' ), - ), - ), - - /** - * Option: Button Border Size - */ - array( - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]', - 'section' => 'section-transparent-header', - 'control' => 'ast-border', - 'name' => 'header-main-rt-trans-section-button-border-size', - 'transport' => 'postMessage', - 'linked_choices' => true, - 'priority' => 10, - 'default' => astra_get_option( 'header-main-rt-trans-section-button-border-size' ), - 'title' => __( 'Width', 'astra' ), - 'choices' => array( - 'top' => __( 'Top', 'astra' ), - 'right' => __( 'Right', 'astra' ), - 'bottom' => __( 'Bottom', 'astra' ), - 'left' => __( 'Left', 'astra' ), - ), - ), - - /** - * Option: Button Border Color - */ - array( - 'name' => 'header-main-rt-trans-section-button-border-color', - 'default' => astra_get_option( 'header-main-rt-trans-section-button-border-color' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]', - 'section' => 'section-transparent-header', - 'transport' => 'postMessage', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 12, - 'title' => __( 'Color', 'astra' ), - ), - - /** - * Option: Button Border Hover Color - */ - array( - 'name' => 'header-main-rt-trans-section-button-border-h-color', - 'default' => astra_get_option( 'header-main-rt-trans-section-button-border-h-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 14, - 'title' => __( 'Hover Color', 'astra' ), - ), - - /** - * Option: Button Border Radius - */ - array( - 'name' => 'header-main-rt-trans-section-button-border-radius', - 'default' => astra_get_option( 'header-main-rt-trans-section-button-border-radius' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]', - 'section' => 'section-transparent-header', - 'control' => 'ast-slider', - 'suffix' => 'px', - 'transport' => 'postMessage', - 'priority' => 16, - 'title' => __( 'Border Radius', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - 'step' => 1, - 'max' => 100, - ), - ), - ); - $_configs = array_merge( $_configs, $_trans_config ); - - } - - return array_merge( $configurations, $_configs ); - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -new Astra_Customizer_Button_Configs(); + ASTRA_THEME_SETTINGS . '[theme-button-color-group]', + 'default' => astra_get_option( 'theme-button-color-group' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Text Color', 'astra' ), + 'section' => 'section-buttons', + 'transport' => 'postMessage', + 'priority' => 18, + ), + + /** + * Group: Theme Button background colors Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[theme-button-bg-color-group]', + 'default' => astra_get_option( 'theme-button-bg-color-group' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Background Color', 'astra' ), + 'section' => 'section-buttons', + 'transport' => 'postMessage', + 'priority' => 18.5, + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Button Color + */ + array( + 'name' => 'button-color', + 'default' => astra_get_option( 'button-color' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-color-group]', + 'section' => 'section-buttons', + 'control' => 'ast-color', + 'title' => __( 'Normal', 'astra' ), + ), + + /** + * Option: Button Hover Color + */ + array( + 'name' => 'button-h-color', + 'default' => astra_get_option( 'button-h-color' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-color-group]', + 'section' => 'section-buttons', + 'control' => 'ast-color', + 'title' => __( 'Hover', 'astra' ), + 'priority' => 39, + ), + + /** + * Option: Button Background Color + */ + array( + 'name' => 'button-bg-color', + 'default' => astra_get_option( 'button-bg-color' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-bg-color-group]', + 'section' => 'section-buttons', + 'control' => 'ast-color', + 'title' => __( 'Normal', 'astra' ), + ), + + /** + * Option: Button Background Hover Color + */ + array( + 'name' => 'button-bg-h-color', + 'default' => astra_get_option( 'button-bg-h-color' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-bg-color-group]', + 'section' => 'section-buttons', + 'control' => 'ast-color', + 'title' => __( 'Hover', 'astra' ), + 'priority' => 40, + ), + + /** + * Option: Global Button Border Size + */ + array( + 'type' => 'control', + 'section' => 'section-buttons', + 'control' => 'ast-border', + 'name' => ASTRA_THEME_SETTINGS . '[theme-button-border-group-border-size]', + 'transport' => 'postMessage', + 'linked_choices' => true, + 'priority' => 19, + 'default' => astra_get_option( 'theme-button-border-group-border-size' ), + 'title' => __( 'Border Width', 'astra' ), + 'choices' => array( + 'top' => __( 'Top', 'astra' ), + 'right' => __( 'Right', 'astra' ), + 'bottom' => __( 'Bottom', 'astra' ), + 'left' => __( 'Left', 'astra' ), + ), + ), + + /** + * Group: Theme Button Border Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[theme-button-border-color-group]', + 'default' => astra_get_option( 'theme-button-border-color-group' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Border Color', 'astra' ), + 'section' => 'section-buttons', + 'transport' => 'postMessage', + 'priority' => 19, + ), + + /** + * Option: Global Button Border Color + */ + array( + 'name' => 'theme-button-border-group-border-color', + 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-border-color-group]', + 'default' => astra_get_option( 'theme-button-border-group-border-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'section' => 'section-buttons', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 19, + 'title' => __( 'Border Color', 'astra' ), + ), + + /** + * Option: Global Button Border Hover Color + */ + array( + 'name' => 'theme-button-border-group-border-h-color', + 'default' => astra_get_option( 'theme-button-border-group-border-h-color' ), + 'parent' => ASTRA_THEME_SETTINGS . '[theme-button-border-color-group]', + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'section' => 'section-buttons', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 19, + 'title' => __( 'Border Hover Color', 'astra' ), + ), + + /** + * Option: Global Button Radius + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[button-radius]', + 'default' => astra_get_option( 'button-radius' ), + 'type' => 'control', + 'section' => 'section-buttons', + 'control' => 'ast-slider', + 'priority' => 19, + 'suffix' => 'px', + 'title' => __( 'Border Radius', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + 'step' => 1, + 'max' => 200, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Theme Button Padding + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[theme-button-padding]', + 'default' => astra_get_option( 'theme-button-padding' ), + 'type' => 'control', + 'control' => 'ast-responsive-spacing', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), + 'section' => 'section-buttons', + 'title' => __( 'Padding', 'astra' ), + 'linked_choices' => true, + 'transport' => 'postMessage', + 'unit_choices' => array( 'px', 'em', '%' ), + 'choices' => array( + 'top' => __( 'Top', 'astra' ), + 'right' => __( 'Right', 'astra' ), + 'bottom' => __( 'Bottom', 'astra' ), + 'left' => __( 'Left', 'astra' ), + ), + 'priority' => 35, + 'connected' => false, + ), + + ); + + if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + $_trans_config = array( + /** + * Option: Transparent Header Button Colors Divider + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-divider]', + 'type' => 'control', + 'control' => 'ast-heading', + 'section' => 'section-transparent-header', + 'title' => __( 'Header Button', 'astra' ), + 'settings' => array(), + 'priority' => 40, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', + 'operator' => '===', + 'value' => 'custom-button', + ), + ), + ), + /** + * Group: Transparent Header Button Colors Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]', + 'default' => astra_get_option( 'transparent-header-button-color-group' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Colors', 'astra' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 40, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', + 'operator' => '===', + 'value' => 'custom-button', + ), + ), + ), + /** + * Group: Transparent Header Button Border Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]', + 'default' => astra_get_option( 'transparent-header-button-border-group' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Border', 'astra' ), + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'priority' => 40, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', + 'operator' => '===', + 'value' => 'custom-button', + ), + ), + ), + + /** + * Option: Button Text Color + */ + array( + 'name' => 'header-main-rt-trans-section-button-text-color', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'header-main-rt-trans-section-button-text-color' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Normal', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 10, + 'title' => __( 'Text Color', 'astra' ), + ), + + /** + * Option: Button Text Hover Color + */ + array( + 'name' => 'header-main-rt-trans-section-button-text-h-color', + 'default' => astra_get_option( 'header-main-rt-trans-section-button-text-h-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Hover', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 10, + 'title' => __( 'Text Color', 'astra' ), + ), + + /** + * Option: Button Background Color + */ + array( + 'name' => 'header-main-rt-trans-section-button-back-color', + 'default' => astra_get_option( 'header-main-rt-trans-section-button-back-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Normal', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 10, + 'title' => __( 'Background Color', 'astra' ), + ), + + /** + * Option: Button Button Hover Color + */ + array( + 'name' => 'header-main-rt-trans-section-button-back-h-color', + 'default' => astra_get_option( 'header-main-rt-trans-section-button-back-h-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]', + 'section' => 'section-transparent-header', + 'tab' => __( 'Hover', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 10, + 'title' => __( 'Background Color', 'astra' ), + ), + + // Option: Custom Menu Button Border. + array( + 'type' => 'control', + 'control' => 'ast-responsive-spacing', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), + 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-trans-section-button-padding]', + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'linked_choices' => true, + 'priority' => 40, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', + 'operator' => '===', + 'value' => 'custom-button', + ), + ), + 'default' => astra_get_option( 'header-main-rt-trans-section-button-padding' ), + 'title' => __( 'Padding', 'astra' ), + 'choices' => array( + 'top' => __( 'Top', 'astra' ), + 'right' => __( 'Right', 'astra' ), + 'bottom' => __( 'Bottom', 'astra' ), + 'left' => __( 'Left', 'astra' ), + ), + ), + + /** + * Option: Button Border Size + */ + array( + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]', + 'section' => 'section-transparent-header', + 'control' => 'ast-border', + 'name' => 'header-main-rt-trans-section-button-border-size', + 'transport' => 'postMessage', + 'linked_choices' => true, + 'priority' => 10, + 'default' => astra_get_option( 'header-main-rt-trans-section-button-border-size' ), + 'title' => __( 'Width', 'astra' ), + 'choices' => array( + 'top' => __( 'Top', 'astra' ), + 'right' => __( 'Right', 'astra' ), + 'bottom' => __( 'Bottom', 'astra' ), + 'left' => __( 'Left', 'astra' ), + ), + ), + + /** + * Option: Button Border Color + */ + array( + 'name' => 'header-main-rt-trans-section-button-border-color', + 'default' => astra_get_option( 'header-main-rt-trans-section-button-border-color' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]', + 'section' => 'section-transparent-header', + 'transport' => 'postMessage', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 12, + 'title' => __( 'Color', 'astra' ), + ), + + /** + * Option: Button Border Hover Color + */ + array( + 'name' => 'header-main-rt-trans-section-button-border-h-color', + 'default' => astra_get_option( 'header-main-rt-trans-section-button-border-h-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 14, + 'title' => __( 'Hover Color', 'astra' ), + ), + + /** + * Option: Button Border Radius + */ + array( + 'name' => 'header-main-rt-trans-section-button-border-radius', + 'default' => astra_get_option( 'header-main-rt-trans-section-button-border-radius' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]', + 'section' => 'section-transparent-header', + 'control' => 'ast-slider', + 'suffix' => 'px', + 'transport' => 'postMessage', + 'priority' => 16, + 'title' => __( 'Border Radius', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + 'step' => 1, + 'max' => 100, + ), + ), + ); + $_configs = array_merge( $_configs, $_trans_config ); + + } + + return array_merge( $configurations, $_configs ); + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +new Astra_Customizer_Button_Configs(); diff --git a/inc/customizer/configurations/buttons/class-astra-existing-button-configs.php b/inc/customizer/configurations/buttons/class-astra-existing-button-configs.php index 707420a..15d5a81 100644 --- a/inc/customizer/configurations/buttons/class-astra-existing-button-configs.php +++ b/inc/customizer/configurations/buttons/class-astra-existing-button-configs.php @@ -1,452 +1,452 @@ - ASTRA_THEME_SETTINGS . '[primary-header-button-color-divider]', - 'type' => 'control', - 'control' => 'ast-heading', - 'section' => 'section-primary-menu', - 'title' => __( 'Header Button', 'astra' ), - 'settings' => array(), - 'priority' => 17, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', - 'operator' => '===', - 'value' => 'custom-button', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => '==', - 'value' => 'button', - ), - ), - - ), - /** - * Group: Primary Header Button Colors Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]', - 'default' => astra_get_option( 'primary-header-button-color-group' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Colors', 'astra' ), - 'section' => 'section-primary-menu', - 'transport' => 'postMessage', - 'priority' => 18, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', - 'operator' => '===', - 'value' => 'custom-button', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => '==', - 'value' => 'button', - ), - ), - ), - /** - * Group: Primary Header Button Border Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]', - 'default' => astra_get_option( 'primary-header-button-border-group' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Border', 'astra' ), - 'section' => 'section-primary-menu', - 'transport' => 'postMessage', - 'priority' => 19, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', - 'operator' => '===', - 'value' => 'custom-button', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => '==', - 'value' => 'button', - ), - ), - ), - - /** - * Option: Button Text Color - */ - array( - 'name' => 'header-main-rt-section-button-text-color', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'header-main-rt-section-button-text-color' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]', - 'section' => 'section-primary-menu', - 'tab' => __( 'Normal', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 10, - 'title' => __( 'Text Color', 'astra' ), - ), - - /** - * Option: Button Text Hover Color - */ - array( - 'name' => 'header-main-rt-section-button-text-h-color', - 'default' => astra_get_option( 'header-main-rt-section-button-text-h-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]', - 'section' => 'section-primary-menu', - 'tab' => __( 'Hover', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 10, - 'title' => __( 'Text Color', 'astra' ), - ), - - /** - * Option: Button Background Color - */ - array( - 'name' => 'header-main-rt-section-button-back-color', - 'default' => astra_get_option( 'header-main-rt-section-button-back-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]', - 'section' => 'section-primary-menu', - 'tab' => __( 'Normal', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 10, - 'title' => __( 'Background Color', 'astra' ), - ), - - /** - * Option: Button Button Hover Color - */ - array( - 'name' => 'header-main-rt-section-button-back-h-color', - 'default' => astra_get_option( 'header-main-rt-section-button-back-h-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]', - 'section' => 'section-primary-menu', - 'tab' => __( 'Hover', 'astra' ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 10, - 'title' => __( 'Background Color', 'astra' ), - ), - - /** - * Option: Primary Header Button Typography - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', - 'default' => astra_get_option( 'primary-header-button-text-typography' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Typography', 'astra' ), - 'section' => 'section-primary-menu', - 'transport' => 'postMessage', - 'priority' => 20, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', - 'operator' => '===', - 'value' => 'custom-button', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => '==', - 'value' => 'button', - ), - ), - ), - - /** - * Option: Primary Header Button Font Family - */ - array( - 'name' => 'primary-header-button-font-family', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', - 'section' => 'section-primary-menu', - 'control' => 'ast-font', - 'font_type' => 'ast-font-family', - 'title' => __( 'Family', 'astra' ), - 'default' => astra_get_option( 'primary-header-button-font-family' ), - 'connect' => ASTRA_THEME_SETTINGS . '[primary-header-button-font-weight]', - 'priority' => 1, - ), - - /** - * Option: Primary Header Button Font Size - */ - array( - 'name' => 'primary-header-button-font-size', - 'transport' => 'postMessage', - 'title' => __( 'Size', 'astra' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', - 'section' => 'section-primary-menu', - 'control' => 'ast-responsive', - 'default' => astra_get_option( 'primary-header-button-font-size' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - - /** - * Option: Primary Header Button Font Weight - */ - array( - 'name' => 'primary-header-button-font-weight', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', - 'section' => 'section-primary-menu', - 'control' => 'ast-font', - 'font_type' => 'ast-font-weight', - 'title' => __( 'Weight', 'astra' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), - 'default' => astra_get_option( 'primary-header-button-font-weight' ), - 'connect' => 'primary-header-button-font-family', - 'priority' => 2, - ), - - /** - * Option: Primary Header Button Text Transform - */ - array( - 'name' => 'primary-header-button-text-transform', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'primary-header-button-text-transform' ), - 'title' => __( 'Text Transform', 'astra' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', - 'section' => 'section-primary-menu', - 'control' => 'ast-select', - 'priority' => 3, - 'choices' => array( - '' => __( 'Inherit', 'astra' ), - 'none' => __( 'None', 'astra' ), - 'capitalize' => __( 'Capitalize', 'astra' ), - 'uppercase' => __( 'Uppercase', 'astra' ), - 'lowercase' => __( 'Lowercase', 'astra' ), - ), - ), - - /** - * Option: Primary Header Button Line Height - */ - array( - 'name' => 'primary-header-button-line-height', - 'control' => 'ast-slider', - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'default' => astra_get_option( 'primary-header-button-line-height' ), - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', - 'section' => 'section-primary-menu', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'title' => __( 'Line Height', 'astra' ), - 'suffix' => 'em', - 'priority' => 4, - 'input_attrs' => array( - 'min' => 1, - 'step' => 0.01, - 'max' => 5, - ), - ), - - /** - * Option: Primary Header Button Letter Spacing - */ - array( - 'name' => 'primary-header-button-letter-spacing', - 'control' => 'ast-slider', - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'default' => astra_get_option( 'primary-header-button-letter-spacing' ), - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', - 'section' => 'section-primary-menu', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'title' => __( 'Letter Spacing', 'astra' ), - 'suffix' => 'px', - 'priority' => 5, - 'input_attrs' => array( - 'min' => 1, - 'step' => 1, - 'max' => 100, - ), - ), - - // Option: Custom Menu Button Border. - array( - 'type' => 'control', - 'control' => 'ast-responsive-spacing', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), - 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-padding]', - 'section' => 'section-primary-menu', - 'transport' => 'postMessage', - 'linked_choices' => true, - 'priority' => 21, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', - 'operator' => '===', - 'value' => 'custom-button', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => '==', - 'value' => 'button', - ), - ), - 'default' => astra_get_option( 'header-main-rt-section-button-padding' ), - 'title' => __( 'Padding', 'astra' ), - 'choices' => array( - 'top' => __( 'Top', 'astra' ), - 'right' => __( 'Right', 'astra' ), - 'bottom' => __( 'Bottom', 'astra' ), - 'left' => __( 'Left', 'astra' ), - ), - ), - - /** - * Option: Button Border Size - */ - array( - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]', - 'section' => 'section-primary-menu', - 'control' => 'ast-border', - 'name' => 'header-main-rt-section-button-border-size', - 'transport' => 'postMessage', - 'linked_choices' => true, - 'priority' => 10, - 'default' => astra_get_option( 'header-main-rt-section-button-border-size' ), - 'title' => __( 'Width', 'astra' ), - 'choices' => array( - 'top' => __( 'Top', 'astra' ), - 'right' => __( 'Right', 'astra' ), - 'bottom' => __( 'Bottom', 'astra' ), - 'left' => __( 'Left', 'astra' ), - ), - ), - - /** - * Option: Button Border Color - */ - array( - 'name' => 'header-main-rt-section-button-border-color', - 'default' => astra_get_option( 'header-main-rt-section-button-border-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]', - 'section' => 'section-primary-menu', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 12, - 'title' => __( 'Color', 'astra' ), - ), - - /** - * Option: Button Border Hover Color - */ - array( - 'name' => 'header-main-rt-section-button-border-h-color', - 'default' => astra_get_option( 'header-main-rt-section-button-border-h-color' ), - 'transport' => 'postMessage', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]', - 'section' => 'section-primary-menu', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'priority' => 14, - 'title' => __( 'Hover Color', 'astra' ), - ), - - /** - * Option: Button Border Radius - */ - array( - 'name' => 'header-main-rt-section-button-border-radius', - 'default' => astra_get_option( 'header-main-rt-section-button-border-radius' ), - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]', - 'section' => 'section-primary-menu', - 'control' => 'ast-slider', - 'suffix' => 'px', - 'transport' => 'postMessage', - 'priority' => 16, - 'title' => __( 'Border Radius', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - 'step' => 1, - 'max' => 100, - ), - ), - ); - - return array_merge( $configurations, $_configs ); - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -new Astra_Existing_Button_Configs(); + ASTRA_THEME_SETTINGS . '[primary-header-button-color-divider]', + 'type' => 'control', + 'control' => 'ast-heading', + 'section' => 'section-primary-menu', + 'title' => __( 'Header Button', 'astra' ), + 'settings' => array(), + 'priority' => 17, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', + 'operator' => '===', + 'value' => 'custom-button', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => '==', + 'value' => 'button', + ), + ), + + ), + /** + * Group: Primary Header Button Colors Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]', + 'default' => astra_get_option( 'primary-header-button-color-group' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Colors', 'astra' ), + 'section' => 'section-primary-menu', + 'transport' => 'postMessage', + 'priority' => 18, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', + 'operator' => '===', + 'value' => 'custom-button', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => '==', + 'value' => 'button', + ), + ), + ), + /** + * Group: Primary Header Button Border Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]', + 'default' => astra_get_option( 'primary-header-button-border-group' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Border', 'astra' ), + 'section' => 'section-primary-menu', + 'transport' => 'postMessage', + 'priority' => 19, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', + 'operator' => '===', + 'value' => 'custom-button', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => '==', + 'value' => 'button', + ), + ), + ), + + /** + * Option: Button Text Color + */ + array( + 'name' => 'header-main-rt-section-button-text-color', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'header-main-rt-section-button-text-color' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]', + 'section' => 'section-primary-menu', + 'tab' => __( 'Normal', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 10, + 'title' => __( 'Text Color', 'astra' ), + ), + + /** + * Option: Button Text Hover Color + */ + array( + 'name' => 'header-main-rt-section-button-text-h-color', + 'default' => astra_get_option( 'header-main-rt-section-button-text-h-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]', + 'section' => 'section-primary-menu', + 'tab' => __( 'Hover', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 10, + 'title' => __( 'Text Color', 'astra' ), + ), + + /** + * Option: Button Background Color + */ + array( + 'name' => 'header-main-rt-section-button-back-color', + 'default' => astra_get_option( 'header-main-rt-section-button-back-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]', + 'section' => 'section-primary-menu', + 'tab' => __( 'Normal', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 10, + 'title' => __( 'Background Color', 'astra' ), + ), + + /** + * Option: Button Button Hover Color + */ + array( + 'name' => 'header-main-rt-section-button-back-h-color', + 'default' => astra_get_option( 'header-main-rt-section-button-back-h-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]', + 'section' => 'section-primary-menu', + 'tab' => __( 'Hover', 'astra' ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 10, + 'title' => __( 'Background Color', 'astra' ), + ), + + /** + * Option: Primary Header Button Typography + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', + 'default' => astra_get_option( 'primary-header-button-text-typography' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Typography', 'astra' ), + 'section' => 'section-primary-menu', + 'transport' => 'postMessage', + 'priority' => 20, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', + 'operator' => '===', + 'value' => 'custom-button', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => '==', + 'value' => 'button', + ), + ), + ), + + /** + * Option: Primary Header Button Font Family + */ + array( + 'name' => 'primary-header-button-font-family', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', + 'section' => 'section-primary-menu', + 'control' => 'ast-font', + 'font_type' => 'ast-font-family', + 'title' => __( 'Family', 'astra' ), + 'default' => astra_get_option( 'primary-header-button-font-family' ), + 'connect' => ASTRA_THEME_SETTINGS . '[primary-header-button-font-weight]', + 'priority' => 1, + ), + + /** + * Option: Primary Header Button Font Size + */ + array( + 'name' => 'primary-header-button-font-size', + 'transport' => 'postMessage', + 'title' => __( 'Size', 'astra' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', + 'section' => 'section-primary-menu', + 'control' => 'ast-responsive', + 'default' => astra_get_option( 'primary-header-button-font-size' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Primary Header Button Font Weight + */ + array( + 'name' => 'primary-header-button-font-weight', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', + 'section' => 'section-primary-menu', + 'control' => 'ast-font', + 'font_type' => 'ast-font-weight', + 'title' => __( 'Weight', 'astra' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), + 'default' => astra_get_option( 'primary-header-button-font-weight' ), + 'connect' => 'primary-header-button-font-family', + 'priority' => 2, + ), + + /** + * Option: Primary Header Button Text Transform + */ + array( + 'name' => 'primary-header-button-text-transform', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'primary-header-button-text-transform' ), + 'title' => __( 'Text Transform', 'astra' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', + 'section' => 'section-primary-menu', + 'control' => 'ast-select', + 'priority' => 3, + 'choices' => array( + '' => __( 'Inherit', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + ), + + /** + * Option: Primary Header Button Line Height + */ + array( + 'name' => 'primary-header-button-line-height', + 'control' => 'ast-slider', + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'default' => astra_get_option( 'primary-header-button-line-height' ), + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', + 'section' => 'section-primary-menu', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'title' => __( 'Line Height', 'astra' ), + 'suffix' => 'em', + 'priority' => 4, + 'input_attrs' => array( + 'min' => 1, + 'step' => 0.01, + 'max' => 5, + ), + ), + + /** + * Option: Primary Header Button Letter Spacing + */ + array( + 'name' => 'primary-header-button-letter-spacing', + 'control' => 'ast-slider', + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'default' => astra_get_option( 'primary-header-button-letter-spacing' ), + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]', + 'section' => 'section-primary-menu', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'title' => __( 'Letter Spacing', 'astra' ), + 'suffix' => 'px', + 'priority' => 5, + 'input_attrs' => array( + 'min' => 1, + 'step' => 1, + 'max' => 100, + ), + ), + + // Option: Custom Menu Button Border. + array( + 'type' => 'control', + 'control' => 'ast-responsive-spacing', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), + 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-padding]', + 'section' => 'section-primary-menu', + 'transport' => 'postMessage', + 'linked_choices' => true, + 'priority' => 21, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', + 'operator' => '===', + 'value' => 'custom-button', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => '==', + 'value' => 'button', + ), + ), + 'default' => astra_get_option( 'header-main-rt-section-button-padding' ), + 'title' => __( 'Padding', 'astra' ), + 'choices' => array( + 'top' => __( 'Top', 'astra' ), + 'right' => __( 'Right', 'astra' ), + 'bottom' => __( 'Bottom', 'astra' ), + 'left' => __( 'Left', 'astra' ), + ), + ), + + /** + * Option: Button Border Size + */ + array( + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]', + 'section' => 'section-primary-menu', + 'control' => 'ast-border', + 'name' => 'header-main-rt-section-button-border-size', + 'transport' => 'postMessage', + 'linked_choices' => true, + 'priority' => 10, + 'default' => astra_get_option( 'header-main-rt-section-button-border-size' ), + 'title' => __( 'Width', 'astra' ), + 'choices' => array( + 'top' => __( 'Top', 'astra' ), + 'right' => __( 'Right', 'astra' ), + 'bottom' => __( 'Bottom', 'astra' ), + 'left' => __( 'Left', 'astra' ), + ), + ), + + /** + * Option: Button Border Color + */ + array( + 'name' => 'header-main-rt-section-button-border-color', + 'default' => astra_get_option( 'header-main-rt-section-button-border-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]', + 'section' => 'section-primary-menu', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 12, + 'title' => __( 'Color', 'astra' ), + ), + + /** + * Option: Button Border Hover Color + */ + array( + 'name' => 'header-main-rt-section-button-border-h-color', + 'default' => astra_get_option( 'header-main-rt-section-button-border-h-color' ), + 'transport' => 'postMessage', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]', + 'section' => 'section-primary-menu', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'priority' => 14, + 'title' => __( 'Hover Color', 'astra' ), + ), + + /** + * Option: Button Border Radius + */ + array( + 'name' => 'header-main-rt-section-button-border-radius', + 'default' => astra_get_option( 'header-main-rt-section-button-border-radius' ), + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]', + 'section' => 'section-primary-menu', + 'control' => 'ast-slider', + 'suffix' => 'px', + 'transport' => 'postMessage', + 'priority' => 16, + 'title' => __( 'Border Radius', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + 'step' => 1, + 'max' => 100, + ), + ), + ); + + return array_merge( $configurations, $_configs ); + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +new Astra_Existing_Button_Configs(); diff --git a/inc/customizer/configurations/class-astra-customizer-config-base.php b/inc/customizer/configurations/class-astra-customizer-config-base.php index 47a4688..862ad90 100644 --- a/inc/customizer/configurations/class-astra-customizer-config-base.php +++ b/inc/customizer/configurations/class-astra-customizer-config-base.php @@ -1,100 +1,100 @@ -'; - $content .= wp_kses_post( astra_get_prop( $args, 'description' ) ); - - // Links. - if ( astra_get_prop( $args, 'links' ) ) { - $content .= '
      '; - foreach ( $args['links'] as $index => $link ) { - - if ( astra_get_prop( $link, 'attrs' ) ) { - - $content .= '
    • '; - - // Attribute mapping. - $attributes = ' target="_blank" '; - foreach ( astra_get_prop( $link, 'attrs' ) as $attr => $attr_value ) { - $attributes .= ' ' . $attr . '="' . esc_attr( $attr_value ) . '" '; - } - $content .= '' . esc_html( astra_get_prop( $link, 'text' ) ) . '
    • '; - - $content .= ''; - } - } - $content .= '
    '; - } - - $content .= ''; - - return $content; - } - - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -new Astra_Customizer_Config_Base(); +'; + $content .= wp_kses_post( astra_get_prop( $args, 'description' ) ); + + // Links. + if ( astra_get_prop( $args, 'links' ) ) { + $content .= '
      '; + foreach ( $args['links'] as $index => $link ) { + + if ( astra_get_prop( $link, 'attrs' ) ) { + + $content .= '
    • '; + + // Attribute mapping. + $attributes = ' target="_blank" '; + foreach ( astra_get_prop( $link, 'attrs' ) as $attr => $attr_value ) { + $attributes .= ' ' . $attr . '="' . esc_attr( $attr_value ) . '" '; + } + $content .= '' . esc_html( astra_get_prop( $link, 'text' ) ) . '
    • '; + + $content .= ''; + } + } + $content .= '
    '; + } + + $content .= ''; + + return $content; + } + + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +new Astra_Customizer_Config_Base(); diff --git a/inc/customizer/configurations/colors-background/class-astra-advanced-footer-colors-configs.php b/inc/customizer/configurations/colors-background/class-astra-advanced-footer-colors-configs.php index c216adb..f6ba1dc 100644 --- a/inc/customizer/configurations/colors-background/class-astra-advanced-footer-colors-configs.php +++ b/inc/customizer/configurations/colors-background/class-astra-advanced-footer-colors-configs.php @@ -1,179 +1,179 @@ - ASTRA_THEME_SETTINGS . '[footer-widget-background-group]', - 'default' => astra_get_option( 'footer-widget-background-group' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Background Color', 'astra' ), - 'section' => 'section-footer-adv', - 'transport' => 'postMessage', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'priority' => 47, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]', - 'operator' => '!=', - 'value' => 'disabled', - ), - - ), - ), - - /** - * Option: Footer Bar Content Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-widget-content-group]', - 'default' => astra_get_option( 'footer-widget-content-group' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Content Colors', 'astra' ), - 'section' => 'section-footer-adv', - 'transport' => 'postMessage', - 'priority' => 48, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - ), - - /** - * Option: Footer Bar Content Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-widget-link-color-group]', - 'default' => astra_get_option( 'footer-widget-link-color-group' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Link Color', 'astra' ), - 'section' => 'section-footer-adv', - 'transport' => 'postMessage', - 'priority' => 48, - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]', - 'operator' => '!=', - 'value' => 'disabled', - ), - - ), - ), - - /** - * Option: Widget Title Color - */ - array( - 'name' => 'footer-adv-wgt-title-color', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-content-group]', - 'section' => 'section-footer-adv', - 'control' => 'ast-color', - 'title' => __( 'Title Color', 'astra' ), - 'default' => astra_get_option( 'footer-adv-wgt-title-color' ), - ), - - /** - * Option: Text Color - */ - array( - 'name' => 'footer-adv-text-color', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-content-group]', - 'section' => 'section-footer-adv', - 'control' => 'ast-color', - 'title' => __( 'Text Color', 'astra' ), - 'default' => astra_get_option( 'footer-adv-text-color' ), - ), - - /** - * Option: Link Color - */ - array( - 'name' => 'footer-adv-link-color', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-link-color-group]', - 'section' => 'section-footer-adv', - 'control' => 'ast-color', - 'title' => __( 'Normal', 'astra' ), - 'default' => astra_get_option( 'footer-adv-link-color' ), - ), - - /** - * Option: Link Hover Color - */ - array( - 'name' => 'footer-adv-link-h-color', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-link-color-group]', - 'section' => 'section-footer-adv', - 'control' => 'ast-color', - 'title' => __( 'Hover', 'astra' ), - 'default' => astra_get_option( 'footer-adv-link-h-color' ), - ), - - /** - * Option: Footer widget Background - */ - array( - 'name' => 'footer-adv-bg-obj', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-background-group]', - 'section' => 'section-footer-adv', - 'control' => 'ast-background', - 'default' => astra_get_option( 'footer-adv-bg-obj' ), - 'label' => __( 'Background', 'astra' ), - ), - ); - - $configurations = array_merge( $configurations, $_configs ); - - return $configurations; - } - } -} - -new Astra_Advanced_Footer_Colors_Configs(); - - + ASTRA_THEME_SETTINGS . '[footer-widget-background-group]', + 'default' => astra_get_option( 'footer-widget-background-group' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Background Color', 'astra' ), + 'section' => 'section-footer-adv', + 'transport' => 'postMessage', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'priority' => 47, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]', + 'operator' => '!=', + 'value' => 'disabled', + ), + + ), + ), + + /** + * Option: Footer Bar Content Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-widget-content-group]', + 'default' => astra_get_option( 'footer-widget-content-group' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Content Colors', 'astra' ), + 'section' => 'section-footer-adv', + 'transport' => 'postMessage', + 'priority' => 48, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + ), + + /** + * Option: Footer Bar Content Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-widget-link-color-group]', + 'default' => astra_get_option( 'footer-widget-link-color-group' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Link Color', 'astra' ), + 'section' => 'section-footer-adv', + 'transport' => 'postMessage', + 'priority' => 48, + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]', + 'operator' => '!=', + 'value' => 'disabled', + ), + + ), + ), + + /** + * Option: Widget Title Color + */ + array( + 'name' => 'footer-adv-wgt-title-color', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-content-group]', + 'section' => 'section-footer-adv', + 'control' => 'ast-color', + 'title' => __( 'Title Color', 'astra' ), + 'default' => astra_get_option( 'footer-adv-wgt-title-color' ), + ), + + /** + * Option: Text Color + */ + array( + 'name' => 'footer-adv-text-color', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-content-group]', + 'section' => 'section-footer-adv', + 'control' => 'ast-color', + 'title' => __( 'Text Color', 'astra' ), + 'default' => astra_get_option( 'footer-adv-text-color' ), + ), + + /** + * Option: Link Color + */ + array( + 'name' => 'footer-adv-link-color', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-link-color-group]', + 'section' => 'section-footer-adv', + 'control' => 'ast-color', + 'title' => __( 'Normal', 'astra' ), + 'default' => astra_get_option( 'footer-adv-link-color' ), + ), + + /** + * Option: Link Hover Color + */ + array( + 'name' => 'footer-adv-link-h-color', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-link-color-group]', + 'section' => 'section-footer-adv', + 'control' => 'ast-color', + 'title' => __( 'Hover', 'astra' ), + 'default' => astra_get_option( 'footer-adv-link-h-color' ), + ), + + /** + * Option: Footer widget Background + */ + array( + 'name' => 'footer-adv-bg-obj', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-background-group]', + 'section' => 'section-footer-adv', + 'control' => 'ast-background', + 'default' => astra_get_option( 'footer-adv-bg-obj' ), + 'label' => __( 'Background', 'astra' ), + ), + ); + + $configurations = array_merge( $configurations, $_configs ); + + return $configurations; + } + } +} + +new Astra_Advanced_Footer_Colors_Configs(); + + diff --git a/inc/customizer/configurations/colors-background/class-astra-body-colors-configs.php b/inc/customizer/configurations/colors-background/class-astra-body-colors-configs.php index b332f3c..67be0c6 100644 --- a/inc/customizer/configurations/colors-background/class-astra-body-colors-configs.php +++ b/inc/customizer/configurations/colors-background/class-astra-body-colors-configs.php @@ -1,99 +1,99 @@ - ASTRA_THEME_SETTINGS . '[text-color]', - 'default' => astra_get_option( 'text-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'section' => $_section, - 'priority' => 5, - 'title' => __( 'Text Color', 'astra' ), - ), - - /** - * Option: Theme Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[theme-color]', - 'type' => 'control', - 'control' => 'ast-color', - 'section' => $_section, - 'default' => astra_get_option( 'theme-color' ), - 'priority' => 5, - 'title' => __( 'Theme Color', 'astra' ), - ), - - /** - * Option: Link Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[link-color]', - 'section' => $_section, - 'type' => 'control', - 'control' => 'ast-color', - 'default' => astra_get_option( 'link-color' ), - 'priority' => 5, - 'title' => __( 'Link Color', 'astra' ), - ), - - /** - * Option: Link Hover Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[link-h-color]', - 'section' => $_section, - 'default' => astra_get_option( 'link-h-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'priority' => 15, - 'title' => __( 'Link Hover Color', 'astra' ), - ), - ); - - $configurations = array_merge( $configurations, $_configs ); - - return $configurations; - } - } -} - -new Astra_Body_Colors_Configs(); - - + ASTRA_THEME_SETTINGS . '[text-color]', + 'default' => astra_get_option( 'text-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'section' => $_section, + 'priority' => 5, + 'title' => __( 'Text Color', 'astra' ), + ), + + /** + * Option: Theme Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[theme-color]', + 'type' => 'control', + 'control' => 'ast-color', + 'section' => $_section, + 'default' => astra_get_option( 'theme-color' ), + 'priority' => 5, + 'title' => __( 'Theme Color', 'astra' ), + ), + + /** + * Option: Link Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[link-color]', + 'section' => $_section, + 'type' => 'control', + 'control' => 'ast-color', + 'default' => astra_get_option( 'link-color' ), + 'priority' => 5, + 'title' => __( 'Link Color', 'astra' ), + ), + + /** + * Option: Link Hover Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[link-h-color]', + 'section' => $_section, + 'default' => astra_get_option( 'link-h-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'priority' => 15, + 'title' => __( 'Link Hover Color', 'astra' ), + ), + ); + + $configurations = array_merge( $configurations, $_configs ); + + return $configurations; + } + } +} + +new Astra_Body_Colors_Configs(); + + diff --git a/inc/customizer/configurations/colors-background/class-astra-footer-colors-configs.php b/inc/customizer/configurations/colors-background/class-astra-footer-colors-configs.php index 9c0cf7f..bca23ba 100644 --- a/inc/customizer/configurations/colors-background/class-astra-footer-colors-configs.php +++ b/inc/customizer/configurations/colors-background/class-astra-footer-colors-configs.php @@ -1,102 +1,102 @@ - 'footer-color', - 'type' => 'sub-control', - 'priority' => 5, - 'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-content-group]', - 'section' => 'section-footer-small', - 'control' => 'ast-color', - 'title' => __( 'Text Color', 'astra' ), - 'default' => astra_get_option( 'footer-color' ), - ), - - /** - * Option: Link Color - */ - array( - 'name' => 'footer-link-color', - 'type' => 'sub-control', - 'priority' => 6, - 'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-link-color-group]', - 'section' => 'section-footer-small', - 'control' => 'ast-color', - 'default' => astra_get_option( 'footer-link-color' ), - 'title' => __( 'Normal', 'astra' ), - ), - - /** - * Option: Link Hover Color - */ - array( - 'name' => 'footer-link-h-color', - 'type' => 'sub-control', - 'priority' => 5, - 'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-link-color-group]', - 'section' => 'section-footer-small', - 'control' => 'ast-color', - 'title' => __( 'Hover', 'astra' ), - 'default' => astra_get_option( 'section-footer-small' ), - ), - - /** - * Option: Footer Background - */ - array( - 'name' => 'footer-bg-obj', - 'type' => 'sub-control', - 'priority' => 7, - 'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-background-group]', - 'section' => 'section-footer-small', - 'transport' => 'postMessage', - 'control' => 'ast-background', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_background_obj' ), - 'default' => astra_get_option( 'footer-bg-obj' ), - 'label' => __( 'Background', 'astra' ), - ), - ); - - $configurations = array_merge( $configurations, $_configs ); - - return $configurations; - } - } -} - -new Astra_Footer_Colors_Configs(); - - + 'footer-color', + 'type' => 'sub-control', + 'priority' => 5, + 'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-content-group]', + 'section' => 'section-footer-small', + 'control' => 'ast-color', + 'title' => __( 'Text Color', 'astra' ), + 'default' => astra_get_option( 'footer-color' ), + ), + + /** + * Option: Link Color + */ + array( + 'name' => 'footer-link-color', + 'type' => 'sub-control', + 'priority' => 6, + 'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-link-color-group]', + 'section' => 'section-footer-small', + 'control' => 'ast-color', + 'default' => astra_get_option( 'footer-link-color' ), + 'title' => __( 'Normal', 'astra' ), + ), + + /** + * Option: Link Hover Color + */ + array( + 'name' => 'footer-link-h-color', + 'type' => 'sub-control', + 'priority' => 5, + 'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-link-color-group]', + 'section' => 'section-footer-small', + 'control' => 'ast-color', + 'title' => __( 'Hover', 'astra' ), + 'default' => astra_get_option( 'section-footer-small' ), + ), + + /** + * Option: Footer Background + */ + array( + 'name' => 'footer-bg-obj', + 'type' => 'sub-control', + 'priority' => 7, + 'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-background-group]', + 'section' => 'section-footer-small', + 'transport' => 'postMessage', + 'control' => 'ast-background', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_background_obj' ), + 'default' => astra_get_option( 'footer-bg-obj' ), + 'label' => __( 'Background', 'astra' ), + ), + ); + + $configurations = array_merge( $configurations, $_configs ); + + return $configurations; + } + } +} + +new Astra_Footer_Colors_Configs(); + + diff --git a/inc/customizer/configurations/layout/class-astra-blog-layout-configs.php b/inc/customizer/configurations/layout/class-astra-blog-layout-configs.php index 854604e..8a88f54 100644 --- a/inc/customizer/configurations/layout/class-astra-blog-layout-configs.php +++ b/inc/customizer/configurations/layout/class-astra-blog-layout-configs.php @@ -1,173 +1,173 @@ - ASTRA_THEME_SETTINGS . '[blog-width]', - 'default' => astra_get_option( 'blog-width' ), - 'type' => 'control', - 'control' => 'ast-selector', - 'section' => 'section-blog', - 'priority' => 50, - 'transport' => 'postMessage', - 'title' => __( 'Content Width', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'custom' => __( 'Custom', 'astra' ), - ), - 'responsive' => false, - 'renderAs' => 'text', - ), - - /** - * Option: Enter Width - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[blog-max-width]', - 'type' => 'control', - 'control' => 'ast-slider', - 'section' => 'section-blog', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'blog-max-width' ), - 'priority' => 50, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[blog-width]', - 'operator' => '===', - 'value' => 'custom', - ), - ), - 'title' => __( 'Custom Width', 'astra' ), - 'suffix' => 'px', - 'input_attrs' => array( - 'min' => 768, - 'step' => 1, - 'max' => 1920, - ), - ), - - /** - * Option: Blog Post Content - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[blog-post-content]', - 'section' => 'section-blog', - 'title' => __( 'Post Content', 'astra' ), - 'default' => astra_get_option( 'blog-post-content' ), - 'type' => 'control', - 'control' => 'ast-selector', - 'priority' => 75, - 'choices' => array( - 'full-content' => __( 'Full Content', 'astra' ), - 'excerpt' => __( 'Excerpt', 'astra' ), - ), - 'responsive' => false, - 'renderAs' => 'text', - ), - - /** - * Option: Display Post Structure - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[blog-post-structure]', - 'default' => astra_get_option( 'blog-post-structure' ), - 'type' => 'control', - 'control' => 'ast-sortable', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), - 'section' => 'section-blog', - 'priority' => 50, - 'title' => __( 'Post Structure', 'astra' ), - 'divider' => array( 'ast_class' => 'ast-top-divider' ), - 'choices' => array( - 'image' => __( 'Featured Image', 'astra' ), - 'title-meta' => __( 'Title & Blog Meta', 'astra' ), - ), - ), - - ); - - if ( ! defined( 'ASTRA_EXT_VER' ) ) { - $_configs[] = array( - 'name' => ASTRA_THEME_SETTINGS . '[blog-meta]', - 'type' => 'control', - 'control' => 'ast-sortable', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), - 'section' => 'section-blog', - 'default' => astra_get_option( 'blog-meta' ), - 'priority' => 50, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[blog-post-structure]', - 'operator' => 'contains', - 'value' => 'title-meta', - ), - ), - 'title' => __( 'Meta', 'astra' ), - 'choices' => array( - 'comments' => __( 'Comments', 'astra' ), - 'category' => __( 'Category', 'astra' ), - 'author' => __( 'Author', 'astra' ), - 'date' => __( 'Publish Date', 'astra' ), - 'tag' => __( 'Tag', 'astra' ), - ), - ); - } - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - $_configs[] = array( - 'name' => 'section-blog-ast-context-tabs', - 'section' => 'section-blog', - 'type' => 'control', - 'control' => 'ast-builder-header-control', - 'priority' => 0, - 'description' => '', - ); - - } - - $configurations = array_merge( $configurations, $_configs ); - - return $configurations; - - } - } -} - - -new Astra_Blog_Layout_Configs(); + ASTRA_THEME_SETTINGS . '[blog-width]', + 'default' => astra_get_option( 'blog-width' ), + 'type' => 'control', + 'control' => 'ast-selector', + 'section' => 'section-blog', + 'priority' => 50, + 'transport' => 'postMessage', + 'title' => __( 'Content Width', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'custom' => __( 'Custom', 'astra' ), + ), + 'responsive' => false, + 'renderAs' => 'text', + ), + + /** + * Option: Enter Width + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[blog-max-width]', + 'type' => 'control', + 'control' => 'ast-slider', + 'section' => 'section-blog', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'blog-max-width' ), + 'priority' => 50, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[blog-width]', + 'operator' => '===', + 'value' => 'custom', + ), + ), + 'title' => __( 'Custom Width', 'astra' ), + 'suffix' => 'px', + 'input_attrs' => array( + 'min' => 768, + 'step' => 1, + 'max' => 1920, + ), + ), + + /** + * Option: Blog Post Content + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[blog-post-content]', + 'section' => 'section-blog', + 'title' => __( 'Post Content', 'astra' ), + 'default' => astra_get_option( 'blog-post-content' ), + 'type' => 'control', + 'control' => 'ast-selector', + 'priority' => 75, + 'choices' => array( + 'full-content' => __( 'Full Content', 'astra' ), + 'excerpt' => __( 'Excerpt', 'astra' ), + ), + 'responsive' => false, + 'renderAs' => 'text', + ), + + /** + * Option: Display Post Structure + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[blog-post-structure]', + 'default' => astra_get_option( 'blog-post-structure' ), + 'type' => 'control', + 'control' => 'ast-sortable', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), + 'section' => 'section-blog', + 'priority' => 50, + 'title' => __( 'Post Structure', 'astra' ), + 'divider' => array( 'ast_class' => 'ast-top-divider' ), + 'choices' => array( + 'image' => __( 'Featured Image', 'astra' ), + 'title-meta' => __( 'Title & Blog Meta', 'astra' ), + ), + ), + + ); + + if ( ! defined( 'ASTRA_EXT_VER' ) ) { + $_configs[] = array( + 'name' => ASTRA_THEME_SETTINGS . '[blog-meta]', + 'type' => 'control', + 'control' => 'ast-sortable', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), + 'section' => 'section-blog', + 'default' => astra_get_option( 'blog-meta' ), + 'priority' => 50, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[blog-post-structure]', + 'operator' => 'contains', + 'value' => 'title-meta', + ), + ), + 'title' => __( 'Meta', 'astra' ), + 'choices' => array( + 'comments' => __( 'Comments', 'astra' ), + 'category' => __( 'Category', 'astra' ), + 'author' => __( 'Author', 'astra' ), + 'date' => __( 'Publish Date', 'astra' ), + 'tag' => __( 'Tag', 'astra' ), + ), + ); + } + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + $_configs[] = array( + 'name' => 'section-blog-ast-context-tabs', + 'section' => 'section-blog', + 'type' => 'control', + 'control' => 'ast-builder-header-control', + 'priority' => 0, + 'description' => '', + ); + + } + + $configurations = array_merge( $configurations, $_configs ); + + return $configurations; + + } + } +} + + +new Astra_Blog_Layout_Configs(); diff --git a/inc/customizer/configurations/layout/class-astra-blog-single-layout-configs.php b/inc/customizer/configurations/layout/class-astra-blog-single-layout-configs.php index 7437479..9f8938e 100644 --- a/inc/customizer/configurations/layout/class-astra-blog-single-layout-configs.php +++ b/inc/customizer/configurations/layout/class-astra-blog-single-layout-configs.php @@ -1,156 +1,156 @@ - ASTRA_THEME_SETTINGS . '[blog-single-width]', - 'type' => 'control', - 'control' => 'ast-selector', - 'section' => 'section-blog-single', - 'default' => astra_get_option( 'blog-single-width' ), - 'priority' => 5, - 'title' => __( 'Content Width', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'custom' => __( 'Custom', 'astra' ), - ), - 'transport' => 'postMessage', - 'responsive' => false, - 'renderAs' => 'text', - ), - - /** - * Option: Enter Width - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[blog-single-max-width]', - 'type' => 'control', - 'control' => 'ast-slider', - 'section' => 'section-blog-single', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'blog-single-max-width' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[blog-single-width]', - 'operator' => '===', - 'value' => 'custom', - ), - ), - 'priority' => 5, - 'title' => __( 'Custom Width', 'astra' ), - 'suffix' => 'px', - 'input_attrs' => array( - 'min' => 768, - 'step' => 1, - 'max' => 1920, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - - /** - * Option: Display Post Structure - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[blog-single-post-structure]', - 'type' => 'control', - 'control' => 'ast-sortable', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), - 'section' => 'section-blog-single', - 'default' => astra_get_option( 'blog-single-post-structure' ), - 'priority' => 5, - 'title' => __( 'Structure', 'astra' ), - 'choices' => array( - 'single-image' => __( 'Featured Image', 'astra' ), - 'single-title-meta' => __( 'Title & Blog Meta', 'astra' ), - ), - ), - - ); - - if ( ! defined( 'ASTRA_EXT_VER' ) ) { - $_configs[] = array( - 'name' => ASTRA_THEME_SETTINGS . '[blog-single-meta]', - 'type' => 'control', - 'control' => 'ast-sortable', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), - 'default' => astra_get_option( 'blog-single-meta' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[blog-single-post-structure]', - 'operator' => 'contains', - 'value' => 'single-title-meta', - ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'section' => 'section-blog-single', - 'priority' => 5, - 'title' => __( 'Meta', 'astra' ), - 'choices' => array( - 'comments' => __( 'Comments', 'astra' ), - 'category' => __( 'Category', 'astra' ), - 'author' => __( 'Author', 'astra' ), - 'date' => __( 'Publish Date', 'astra' ), - 'tag' => __( 'Tag', 'astra' ), - ), - ); - } - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - $_configs[] = array( - 'name' => 'section-blog-single-ast-context-tabs', - 'section' => 'section-blog-single', - 'type' => 'control', - 'control' => 'ast-builder-header-control', - 'priority' => 0, - 'description' => '', - ); - - } - - $configurations = array_merge( $configurations, $_configs ); - - return $configurations; - - } - } -} - - -new Astra_Blog_Single_Layout_Configs(); + ASTRA_THEME_SETTINGS . '[blog-single-width]', + 'type' => 'control', + 'control' => 'ast-selector', + 'section' => 'section-blog-single', + 'default' => astra_get_option( 'blog-single-width' ), + 'priority' => 5, + 'title' => __( 'Content Width', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'custom' => __( 'Custom', 'astra' ), + ), + 'transport' => 'postMessage', + 'responsive' => false, + 'renderAs' => 'text', + ), + + /** + * Option: Enter Width + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[blog-single-max-width]', + 'type' => 'control', + 'control' => 'ast-slider', + 'section' => 'section-blog-single', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'blog-single-max-width' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[blog-single-width]', + 'operator' => '===', + 'value' => 'custom', + ), + ), + 'priority' => 5, + 'title' => __( 'Custom Width', 'astra' ), + 'suffix' => 'px', + 'input_attrs' => array( + 'min' => 768, + 'step' => 1, + 'max' => 1920, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + + /** + * Option: Display Post Structure + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[blog-single-post-structure]', + 'type' => 'control', + 'control' => 'ast-sortable', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), + 'section' => 'section-blog-single', + 'default' => astra_get_option( 'blog-single-post-structure' ), + 'priority' => 5, + 'title' => __( 'Structure', 'astra' ), + 'choices' => array( + 'single-image' => __( 'Featured Image', 'astra' ), + 'single-title-meta' => __( 'Title & Blog Meta', 'astra' ), + ), + ), + + ); + + if ( ! defined( 'ASTRA_EXT_VER' ) ) { + $_configs[] = array( + 'name' => ASTRA_THEME_SETTINGS . '[blog-single-meta]', + 'type' => 'control', + 'control' => 'ast-sortable', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), + 'default' => astra_get_option( 'blog-single-meta' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[blog-single-post-structure]', + 'operator' => 'contains', + 'value' => 'single-title-meta', + ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'section' => 'section-blog-single', + 'priority' => 5, + 'title' => __( 'Meta', 'astra' ), + 'choices' => array( + 'comments' => __( 'Comments', 'astra' ), + 'category' => __( 'Category', 'astra' ), + 'author' => __( 'Author', 'astra' ), + 'date' => __( 'Publish Date', 'astra' ), + 'tag' => __( 'Tag', 'astra' ), + ), + ); + } + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + $_configs[] = array( + 'name' => 'section-blog-single-ast-context-tabs', + 'section' => 'section-blog-single', + 'type' => 'control', + 'control' => 'ast-builder-header-control', + 'priority' => 0, + 'description' => '', + ); + + } + + $configurations = array_merge( $configurations, $_configs ); + + return $configurations; + + } + } +} + + +new Astra_Blog_Single_Layout_Configs(); diff --git a/inc/customizer/configurations/layout/class-astra-footer-layout-configs.php b/inc/customizer/configurations/layout/class-astra-footer-layout-configs.php index 68eba96..79da36a 100644 --- a/inc/customizer/configurations/layout/class-astra-footer-layout-configs.php +++ b/inc/customizer/configurations/layout/class-astra-footer-layout-configs.php @@ -1,482 +1,482 @@ - ASTRA_THEME_SETTINGS . '[footer-sml-layout]', - 'type' => 'control', - 'control' => 'ast-radio-image', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), - 'default' => astra_get_option( 'footer-sml-layout' ), - 'section' => 'section-footer-small', - 'priority' => 5, - 'title' => __( 'Layout', 'astra' ), - 'choices' => array( - 'disabled' => array( - 'label' => __( 'Disabled', 'astra' ), - 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'disabled' ), - ), - 'footer-sml-layout-1' => array( - 'label' => __( 'Footer Bar Layout 1', 'astra' ), - 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'footer-layout-1' ), - ), - 'footer-sml-layout-2' => array( - 'label' => __( 'Footer Bar Layout 2', 'astra' ), - 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'footer-layout-2' ), - ), - ), - 'partial' => array( - 'selector' => '.ast-small-footer', - 'container_inclusive' => false, - ), - ), - - /** - * Section: Section 1 - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-1]', - 'control' => 'ast-selector', - 'default' => astra_get_option( 'footer-sml-section-1' ), - 'type' => 'control', - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - 'section' => 'section-footer-small', - 'priority' => 15, - 'title' => __( 'Section 1', 'astra' ), - 'divider' => array( 'ast_class' => 'ast-top-divider' ), - 'choices' => array( - '' => __( 'None', 'astra' ), - 'custom' => __( 'Text', 'astra' ), - 'widget' => __( 'Widget', 'astra' ), - 'menu' => __( 'Footer Menu', 'astra' ), - ), - 'partial' => array( - 'selector' => '.ast-small-footer .ast-container .ast-footer-widget-1-area .ast-no-widget-row, .ast-small-footer .ast-container .ast-small-footer-section-1 .footer-primary-navigation .nav-menu', - 'container_inclusive' => false, - ), - 'responsive' => false, - 'renderAs' => 'text', - ), - /** - * Option: Section 1 Custom Text - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-1-credit]', - 'default' => astra_get_option( 'footer-sml-section-1-credit' ), - 'type' => 'control', - 'control' => 'textarea', - 'transport' => 'postMessage', - 'section' => 'section-footer-small', - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-section-1]', - 'operator' => '==', - 'value' => array( 'custom' ), - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - 'priority' => 20, - 'title' => __( 'Section 1 Custom Text', 'astra' ), - 'choices' => array( - '' => __( 'None', 'astra' ), - 'custom' => __( 'Custom Text', 'astra' ), - 'widget' => __( 'Widget', 'astra' ), - 'menu' => __( 'Footer Menu', 'astra' ), - ), - 'partial' => array( - 'selector' => '.ast-small-footer .ast-container .ast-small-footer-section.ast-small-footer-section-1:has(> .ast-footer-site-title)', - 'container_inclusive' => false, - 'render_callback' => 'Astra_Customizer_Partials::render_footer_sml_section_1_credit', - ), - ), - - /** - * Option: Section 2 - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-2]', - 'type' => 'control', - 'control' => 'ast-selector', - 'default' => astra_get_option( 'footer-sml-section-2' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - 'section' => 'section-footer-small', - 'priority' => 25, - 'title' => __( 'Section 2', 'astra' ), - 'choices' => array( - '' => __( 'None', 'astra' ), - 'custom' => __( 'Text', 'astra' ), - 'widget' => __( 'Widget', 'astra' ), - 'menu' => __( 'Footer Menu', 'astra' ), - ), - 'partial' => array( - 'selector' => '.ast-small-footer .ast-container .ast-footer-widget-2-area .ast-no-widget-row, .ast-small-footer .ast-container .ast-small-footer-section-2 .footer-primary-navigation .nav-menu', - 'container_inclusive' => false, - ), - 'responsive' => false, - 'renderAs' => 'text', - ), - - /** - * Option: Section 2 Custom Text - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-2-credit]', - 'type' => 'control', - 'control' => 'textarea', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'footer-sml-section-2-credit' ), - 'section' => 'section-footer-small', - 'priority' => 30, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-section-2]', - 'operator' => '==', - 'value' => 'custom', - ), - ), - 'title' => __( 'Section 2 Custom Text', 'astra' ), - 'partial' => array( - 'selector' => '.ast-small-footer-section-2', - 'container_inclusive' => false, - 'render_callback' => 'Astra_Customizer_Partials::render_footer_sml_section_2_credit', - ), - 'partial' => array( - 'selector' => '.ast-small-footer .ast-container .ast-small-footer-section.ast-small-footer-section-2:has(> .ast-footer-site-title)', - 'container_inclusive' => false, - ), - ), - - /** - * Option: Footer Top Border - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-divider]', - 'type' => 'control', - 'control' => 'ast-slider', - 'default' => astra_get_option( 'footer-sml-divider' ), - 'section' => 'section-footer-small', - 'priority' => 40, - 'suffix' => 'px', - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - 'title' => __( 'Border Size', 'astra' ), - 'transport' => 'postMessage', - 'input_attrs' => array( - 'min' => 0, - 'step' => 1, - 'max' => 600, - ), - ), - - /** - * Option: Footer Top Border Color - */ - - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-divider-color]', - 'section' => 'section-footer-small', - 'default' => astra_get_option( 'footer-sml-divider-color', '#7a7a7a' ), - 'type' => 'control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-divider]', - 'operator' => '>=', - 'value' => 1, - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - 'priority' => 45, - 'title' => __( 'Border Color', 'astra' ), - 'transport' => 'postMessage', - ), - - /** - * Option: Footer Bar Content Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-bar-background-group]', - 'default' => astra_get_option( 'footer-bar-background-group' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Background Color', 'astra' ), - 'section' => 'section-footer-small', - 'transport' => 'postMessage', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'priority' => 47, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - ), - - /** - * Option: Footer Bar Content Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-bar-content-group]', - 'default' => astra_get_option( 'footer-bar-content-group' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Content Colors', 'astra' ), - 'section' => 'section-footer-small', - 'transport' => 'postMessage', - 'priority' => 47, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - ), - - /** - * Option: Footer Bar Content Group - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-bar-link-color-group]', - 'default' => astra_get_option( 'footer-bar-link-color-group' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => __( 'Link Color', 'astra' ), - 'section' => 'section-footer-small', - 'transport' => 'postMessage', - 'priority' => 47, - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - ), - - /** - * Option: Header Width - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-layout-width]', - 'type' => 'control', - 'control' => 'ast-selector', - 'default' => astra_get_option( 'footer-layout-width' ), - 'section' => 'section-footer-small', - 'divider' => array( 'ast_class' => 'ast-top-divider ast-bottom-divider' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[site-layout]', - 'operator' => '!=', - 'value' => 'ast-box-layout', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[site-layout]', - 'operator' => '!=', - 'value' => 'ast-fluid-width-layout', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - 'priority' => 35, - 'title' => __( 'Width', 'astra' ), - 'choices' => array( - 'full' => __( 'Full Width', 'astra' ), - 'content' => __( 'Content Width', 'astra' ), - ), - 'responsive' => false, - 'renderAs' => 'text', - ), - - /** - * Option: Footer Top Border - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-adv-border-width]', - 'type' => 'control', - 'control' => 'ast-slider', - 'transport' => 'postMessage', - 'section' => 'section-footer-adv', - 'default' => astra_get_option( 'footer-adv-border-width' ), - 'priority' => 40, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - 'suffix' => 'px', - 'title' => __( 'Top Border Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - 'step' => 1, - 'max' => 600, - ), - ), - - /** - * Option: Footer Top Border Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-adv-border-color]', - 'section' => 'section-footer-adv', - 'title' => __( 'Top Border Color', 'astra' ), - 'type' => 'control', - 'transport' => 'postMessage', - 'control' => 'ast-color', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'default' => astra_get_option( 'footer-adv-border-color' ), - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]', - 'operator' => '!=', - 'value' => 'disabled', - ), - ), - 'priority' => 45, - ), - ); - - $configurations = array_merge( $configurations, $_configs ); - - // Learn More link if Astra Pro is not activated. - if ( ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && false === Astra_Ext_Extension::is_active( 'advanced-footer' ) ) ) { - - $config = array( - - /** - * Option: Footer Widgets Layout Layout - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[footer-adv]', - 'type' => 'control', - 'priority' => 0, - 'control' => 'ast-radio-image', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), - 'default' => astra_get_option( 'footer-adv' ), - 'title' => __( 'Layout', 'astra' ), - 'section' => 'section-footer-adv', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'choices' => array( - 'disabled' => array( - 'label' => __( 'Disable', 'astra' ), - 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'disabled' ), - ), - 'layout-4' => array( - 'label' => __( 'Layout 4', 'astra' ), - 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'footer-layout-4' ), - ), - ), - 'partial' => array( - 'selector' => '.footer-adv .ast-container', - 'container_inclusive' => false, - ), - ), - - /** - * Option: Learn More about Footer Widget - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[ast-footer-widget-more-feature-description]', - 'type' => 'control', - 'control' => 'ast-description', - 'section' => 'section-footer-adv', - 'priority' => 999, - 'label' => '', - 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', - 'settings' => array(), - ), - - ); - - $configurations = array_merge( $configurations, $config ); - } - - return $configurations; - - } - } -} - - -new Astra_Footer_Layout_Configs(); + ASTRA_THEME_SETTINGS . '[footer-sml-layout]', + 'type' => 'control', + 'control' => 'ast-radio-image', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), + 'default' => astra_get_option( 'footer-sml-layout' ), + 'section' => 'section-footer-small', + 'priority' => 5, + 'title' => __( 'Layout', 'astra' ), + 'choices' => array( + 'disabled' => array( + 'label' => __( 'Disabled', 'astra' ), + 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'disabled' ), + ), + 'footer-sml-layout-1' => array( + 'label' => __( 'Footer Bar Layout 1', 'astra' ), + 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'footer-layout-1' ), + ), + 'footer-sml-layout-2' => array( + 'label' => __( 'Footer Bar Layout 2', 'astra' ), + 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'footer-layout-2' ), + ), + ), + 'partial' => array( + 'selector' => '.ast-small-footer', + 'container_inclusive' => false, + ), + ), + + /** + * Section: Section 1 + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-1]', + 'control' => 'ast-selector', + 'default' => astra_get_option( 'footer-sml-section-1' ), + 'type' => 'control', + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + 'section' => 'section-footer-small', + 'priority' => 15, + 'title' => __( 'Section 1', 'astra' ), + 'divider' => array( 'ast_class' => 'ast-top-divider' ), + 'choices' => array( + '' => __( 'None', 'astra' ), + 'custom' => __( 'Text', 'astra' ), + 'widget' => __( 'Widget', 'astra' ), + 'menu' => __( 'Footer Menu', 'astra' ), + ), + 'partial' => array( + 'selector' => '.ast-small-footer .ast-container .ast-footer-widget-1-area .ast-no-widget-row, .ast-small-footer .ast-container .ast-small-footer-section-1 .footer-primary-navigation .nav-menu', + 'container_inclusive' => false, + ), + 'responsive' => false, + 'renderAs' => 'text', + ), + /** + * Option: Section 1 Custom Text + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-1-credit]', + 'default' => astra_get_option( 'footer-sml-section-1-credit' ), + 'type' => 'control', + 'control' => 'textarea', + 'transport' => 'postMessage', + 'section' => 'section-footer-small', + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-section-1]', + 'operator' => '==', + 'value' => array( 'custom' ), + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + 'priority' => 20, + 'title' => __( 'Section 1 Custom Text', 'astra' ), + 'choices' => array( + '' => __( 'None', 'astra' ), + 'custom' => __( 'Custom Text', 'astra' ), + 'widget' => __( 'Widget', 'astra' ), + 'menu' => __( 'Footer Menu', 'astra' ), + ), + 'partial' => array( + 'selector' => '.ast-small-footer .ast-container .ast-small-footer-section.ast-small-footer-section-1:has(> .ast-footer-site-title)', + 'container_inclusive' => false, + 'render_callback' => 'Astra_Customizer_Partials::render_footer_sml_section_1_credit', + ), + ), + + /** + * Option: Section 2 + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-2]', + 'type' => 'control', + 'control' => 'ast-selector', + 'default' => astra_get_option( 'footer-sml-section-2' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + 'section' => 'section-footer-small', + 'priority' => 25, + 'title' => __( 'Section 2', 'astra' ), + 'choices' => array( + '' => __( 'None', 'astra' ), + 'custom' => __( 'Text', 'astra' ), + 'widget' => __( 'Widget', 'astra' ), + 'menu' => __( 'Footer Menu', 'astra' ), + ), + 'partial' => array( + 'selector' => '.ast-small-footer .ast-container .ast-footer-widget-2-area .ast-no-widget-row, .ast-small-footer .ast-container .ast-small-footer-section-2 .footer-primary-navigation .nav-menu', + 'container_inclusive' => false, + ), + 'responsive' => false, + 'renderAs' => 'text', + ), + + /** + * Option: Section 2 Custom Text + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-2-credit]', + 'type' => 'control', + 'control' => 'textarea', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'footer-sml-section-2-credit' ), + 'section' => 'section-footer-small', + 'priority' => 30, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-section-2]', + 'operator' => '==', + 'value' => 'custom', + ), + ), + 'title' => __( 'Section 2 Custom Text', 'astra' ), + 'partial' => array( + 'selector' => '.ast-small-footer-section-2', + 'container_inclusive' => false, + 'render_callback' => 'Astra_Customizer_Partials::render_footer_sml_section_2_credit', + ), + 'partial' => array( + 'selector' => '.ast-small-footer .ast-container .ast-small-footer-section.ast-small-footer-section-2:has(> .ast-footer-site-title)', + 'container_inclusive' => false, + ), + ), + + /** + * Option: Footer Top Border + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-divider]', + 'type' => 'control', + 'control' => 'ast-slider', + 'default' => astra_get_option( 'footer-sml-divider' ), + 'section' => 'section-footer-small', + 'priority' => 40, + 'suffix' => 'px', + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + 'title' => __( 'Border Size', 'astra' ), + 'transport' => 'postMessage', + 'input_attrs' => array( + 'min' => 0, + 'step' => 1, + 'max' => 600, + ), + ), + + /** + * Option: Footer Top Border Color + */ + + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-sml-divider-color]', + 'section' => 'section-footer-small', + 'default' => astra_get_option( 'footer-sml-divider-color', '#7a7a7a' ), + 'type' => 'control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-divider]', + 'operator' => '>=', + 'value' => 1, + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + 'priority' => 45, + 'title' => __( 'Border Color', 'astra' ), + 'transport' => 'postMessage', + ), + + /** + * Option: Footer Bar Content Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-bar-background-group]', + 'default' => astra_get_option( 'footer-bar-background-group' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Background Color', 'astra' ), + 'section' => 'section-footer-small', + 'transport' => 'postMessage', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'priority' => 47, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + ), + + /** + * Option: Footer Bar Content Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-bar-content-group]', + 'default' => astra_get_option( 'footer-bar-content-group' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Content Colors', 'astra' ), + 'section' => 'section-footer-small', + 'transport' => 'postMessage', + 'priority' => 47, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + ), + + /** + * Option: Footer Bar Content Group + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-bar-link-color-group]', + 'default' => astra_get_option( 'footer-bar-link-color-group' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => __( 'Link Color', 'astra' ), + 'section' => 'section-footer-small', + 'transport' => 'postMessage', + 'priority' => 47, + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + ), + + /** + * Option: Header Width + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-layout-width]', + 'type' => 'control', + 'control' => 'ast-selector', + 'default' => astra_get_option( 'footer-layout-width' ), + 'section' => 'section-footer-small', + 'divider' => array( 'ast_class' => 'ast-top-divider ast-bottom-divider' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[site-layout]', + 'operator' => '!=', + 'value' => 'ast-box-layout', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[site-layout]', + 'operator' => '!=', + 'value' => 'ast-fluid-width-layout', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + 'priority' => 35, + 'title' => __( 'Width', 'astra' ), + 'choices' => array( + 'full' => __( 'Full Width', 'astra' ), + 'content' => __( 'Content Width', 'astra' ), + ), + 'responsive' => false, + 'renderAs' => 'text', + ), + + /** + * Option: Footer Top Border + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-adv-border-width]', + 'type' => 'control', + 'control' => 'ast-slider', + 'transport' => 'postMessage', + 'section' => 'section-footer-adv', + 'default' => astra_get_option( 'footer-adv-border-width' ), + 'priority' => 40, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + 'suffix' => 'px', + 'title' => __( 'Top Border Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + 'step' => 1, + 'max' => 600, + ), + ), + + /** + * Option: Footer Top Border Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-adv-border-color]', + 'section' => 'section-footer-adv', + 'title' => __( 'Top Border Color', 'astra' ), + 'type' => 'control', + 'transport' => 'postMessage', + 'control' => 'ast-color', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'default' => astra_get_option( 'footer-adv-border-color' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]', + 'operator' => '!=', + 'value' => 'disabled', + ), + ), + 'priority' => 45, + ), + ); + + $configurations = array_merge( $configurations, $_configs ); + + // Learn More link if Astra Pro is not activated. + if ( ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && false === Astra_Ext_Extension::is_active( 'advanced-footer' ) ) ) { + + $config = array( + + /** + * Option: Footer Widgets Layout Layout + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[footer-adv]', + 'type' => 'control', + 'priority' => 0, + 'control' => 'ast-radio-image', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), + 'default' => astra_get_option( 'footer-adv' ), + 'title' => __( 'Layout', 'astra' ), + 'section' => 'section-footer-adv', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'choices' => array( + 'disabled' => array( + 'label' => __( 'Disable', 'astra' ), + 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'disabled' ), + ), + 'layout-4' => array( + 'label' => __( 'Layout 4', 'astra' ), + 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'footer-layout-4' ), + ), + ), + 'partial' => array( + 'selector' => '.footer-adv .ast-container', + 'container_inclusive' => false, + ), + ), + + /** + * Option: Learn More about Footer Widget + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[ast-footer-widget-more-feature-description]', + 'type' => 'control', + 'control' => 'ast-description', + 'section' => 'section-footer-adv', + 'priority' => 999, + 'label' => '', + 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', + 'settings' => array(), + ), + + ); + + $configurations = array_merge( $configurations, $config ); + } + + return $configurations; + + } + } +} + + +new Astra_Footer_Layout_Configs(); diff --git a/inc/customizer/configurations/layout/class-astra-header-layout-configs.php b/inc/customizer/configurations/layout/class-astra-header-layout-configs.php index 29d25df..8c6549e 100644 --- a/inc/customizer/configurations/layout/class-astra-header-layout-configs.php +++ b/inc/customizer/configurations/layout/class-astra-header-layout-configs.php @@ -1,684 +1,684 @@ - ASTRA_THEME_SETTINGS . '[header-layouts]', - 'default' => astra_get_option( 'header-layouts' ), - 'section' => 'section-header', - 'priority' => 4, - 'title' => __( 'Layout', 'astra' ), - 'type' => 'control', - 'control' => 'ast-radio-image', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), - 'choices' => array( - 'header-main-layout-1' => array( - 'label' => __( 'Logo Left', 'astra' ), - 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'header-main-layout-1' ), - ), - 'header-main-layout-2' => array( - 'label' => __( 'Logo Center', 'astra' ), - 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'header-main-layout-2' ), - ), - 'header-main-layout-3' => array( - 'label' => __( 'Logo Right', 'astra' ), - 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'header-main-layout-3' ), - ), - ), - ), - - /** - * Option: Header Width - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-layout-width]', - 'default' => astra_get_option( 'header-main-layout-width' ), - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-header', - 'priority' => 4, - 'title' => __( 'Width', 'astra' ), - 'choices' => array( - 'full' => __( 'Full Width', 'astra' ), - 'content' => __( 'Content Width', 'astra' ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Bottom Border Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-sep]', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'header-main-sep' ), - 'type' => 'control', - 'control' => 'number', - 'section' => 'section-header', - 'priority' => 4, - 'title' => __( 'Bottom Border Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - 'step' => 1, - 'max' => 600, - ), - ), - - /** - * Option: Bottom Border Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-sep-color]', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'header-main-sep-color' ), - 'type' => 'control', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-sep]', - 'operator' => '>=', - 'value' => 1, - ), - ), - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'section' => 'section-header', - 'priority' => 4, - 'title' => __( 'Bottom Border Color', 'astra' ), - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]', - 'default' => astra_get_option( 'disable-primary-nav' ), - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'section' => 'section-primary-menu', - 'title' => __( 'Disable Menu', 'astra' ), - 'priority' => 5, - 'partial' => array( - 'selector' => '.main-header-bar .main-navigation', - 'container_inclusive' => false, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'default' => astra_get_option( 'header-main-rt-section' ), - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-primary-menu', - 'priority' => 7, - 'title' => __( 'Last Item in Menu', 'astra' ), - 'choices' => apply_filters( - 'astra_header_section_elements', - array( - 'none' => __( 'None', 'astra' ), - 'search' => __( 'Search', 'astra' ), - 'button' => __( 'Button', 'astra' ), - 'text-html' => __( 'Text / HTML', 'astra' ), - 'widget' => __( 'Widget', 'astra' ), - ), - 'primary-header' - ), - 'partial' => array( - 'selector' => '.main-header-bar .main-navigation .main-header-menu .ast-masthead-custom-menu-items.search-custom-menu-item .ast-search-icon .astra-search-icon, .main-header-bar .main-navigation .main-header-menu .ast-masthead-custom-menu-items.woocommerce-custom-menu-item, .main-header-bar .ast-masthead-custom-menu-items.widget-custom-menu-item .ast-header-widget-area .widget.ast-no-widget-row, .main-header-bar .main-navigation .main-header-menu .ast-masthead-custom-menu-items.edd-custom-menu-item', - 'container_inclusive' => false, - ), - ), - - /** - * Option: Button Text - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-text]', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'header-main-rt-section-button-text' ), - 'type' => 'control', - 'control' => 'text', - 'section' => 'section-primary-menu', - 'partial' => array( - 'selector' => '.button-custom-menu-item', - 'container_inclusive' => false, - 'render_callback' => 'Astra_Customizer_Partials::render_header_main_rt_section_button_text', - ), - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => '===', - 'value' => 'button', - ), - ), - 'priority' => 10, - 'title' => __( 'Button Text', 'astra' ), - ), - - /** - * Option: Button Link - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-link-option]', - 'default' => astra_get_option( 'header-main-rt-section-button-link-option' ), - 'type' => 'control', - 'control' => 'ast-link', - 'section' => 'section-primary-menu', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => '===', - 'value' => 'button', - ), - ), - 'priority' => 10, - 'title' => __( 'Button Link', 'astra' ), - ), - - /** - * Option: Button Style - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', - 'default' => astra_get_option( 'header-main-rt-section-button-style' ), - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-primary-menu', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => '===', - 'value' => 'button', - ), - ), - 'priority' => 10, - 'choices' => array( - 'theme-button' => __( 'Theme Button', 'astra' ), - 'custom-button' => __( 'Header Button', 'astra' ), - ), - 'title' => __( 'Button Style', 'astra' ), - ), - - /** - * Option: Theme Button Style edit link - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-button-style-link]', - 'default' => astra_get_option( 'header-button-style-link' ), - 'type' => 'control', - 'control' => 'ast-customizer-link', - 'section' => 'section-primary-menu', - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => '===', - 'value' => 'button', - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', - 'operator' => '===', - 'value' => 'theme-button', - ), - ), - 'priority' => 10, - 'link_type' => 'section', - 'linked' => 'section-buttons', - 'link_text' => __( 'Customize Button Style.', 'astra' ), - ), - - /** - * Option: Right Section Text / HTML - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-html]', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'header-main-rt-section-html' ), - 'type' => 'control', - 'control' => 'textarea', - 'section' => 'section-primary-menu', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => '===', - 'value' => 'text-html', - ), - ), - 'priority' => 10, - 'partial' => array( - 'selector' => '.main-header-bar .ast-masthead-custom-menu-items .ast-custom-html', - 'container_inclusive' => false, - 'render_callback' => 'Astra_Customizer_Partials::render_header_main_rt_section_html', - ), - 'title' => __( 'Custom Menu Text / HTML', 'astra' ), - ), - - array( - 'name' => 'primary-header-sub-menu-label-divider', - 'type' => 'control', - 'control' => 'ast-heading', - 'priority' => 30, - 'title' => __( 'Sub Menu', 'astra' ), - 'section' => 'section-primary-menu', - 'settings' => array(), - ), - - /** - * Option: Submenu Container Animation - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-submenu-container-animation]', - 'default' => astra_get_option( 'header-main-submenu-container-animation' ), - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-primary-menu', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]', - 'operator' => '!=', - 'value' => true, - ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'priority' => 30, - 'title' => __( 'Submenu Animation', 'astra' ), - 'choices' => array( - '' => __( 'None', 'astra' ), - 'slide-down' => __( 'Slide Down', 'astra' ), - 'slide-up' => __( 'Slide Up', 'astra' ), - 'fade' => __( 'Fade', 'astra' ), - ), - ), - - // Option: Primary Menu Border. - array( - 'type' => 'control', - 'control' => 'ast-border', - 'transport' => 'postMessage', - 'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-border]', - 'section' => 'section-primary-menu', - 'linked_choices' => true, - 'priority' => 30, - 'default' => astra_get_option( 'primary-submenu-border' ), - 'title' => __( 'Container Border', 'astra' ), - 'choices' => array( - 'top' => __( 'Top', 'astra' ), - 'right' => __( 'Right', 'astra' ), - 'bottom' => __( 'Bottom', 'astra' ), - 'left' => __( 'Left', 'astra' ), - ), - ), - - // Option: Submenu Container Border Color. - array( - 'type' => 'control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'transport' => 'postMessage', - 'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-b-color]', - 'default' => astra_get_option( 'primary-submenu-b-color' ), - 'title' => __( 'Border Color', 'astra' ), - 'section' => 'section-primary-menu', - 'priority' => 30, - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - array( - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'transport' => 'postMessage', - 'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-item-border]', - 'section' => 'section-primary-menu', - 'priority' => 30, - 'default' => astra_get_option( 'primary-submenu-item-border' ), - 'title' => __( 'Submenu Divider', 'astra' ), - ), - - // Option: Submenu item Border Color. - array( - 'type' => 'control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'transport' => 'postMessage', - 'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-item-b-color]', - 'default' => astra_get_option( 'primary-submenu-item-b-color' ), - 'title' => __( 'Divider Color', 'astra' ), - 'section' => 'section-primary-menu', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[primary-submenu-item-border]', - 'operator' => '==', - 'value' => true, - ), - ), - 'priority' => 30, - ), - - /** - * Option: Mobile Menu Label Divider - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-menu-label-divider]', - 'type' => 'control', - 'control' => 'ast-heading', - 'section' => 'section-header', - 'priority' => 35, - 'title' => __( 'Mobile Header', 'astra' ), - 'settings' => array(), - ), - - /** - * Option: Mobile Menu Alignment - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-menu-align]', - 'default' => astra_get_option( 'header-main-menu-align' ), - 'type' => 'control', - 'control' => 'ast-radio-image', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), - 'choices' => array( - 'inline' => array( - 'label' => __( 'Inline', 'astra' ), - 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'menu-inline' ), - ), - 'stack' => array( - 'label' => __( 'Stack', 'astra' ), - 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'menu-stack' ), - ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'section' => 'section-header', - 'priority' => 40, - 'title' => __( 'Layout', 'astra' ), - ), - - /** - * Option: Hide Last item in Menu on mobile device - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[hide-custom-menu-mobile]', - 'default' => astra_get_option( 'hide-custom-menu-mobile' ), - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => 'in', - 'value' => array( 'button', 'text-html' ), - ), - ), - 'section' => 'section-primary-menu', - 'title' => __( 'Hide Last Item in Menu on Mobile', 'astra' ), - 'priority' => 7, - 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), - ), - - /** - * Option: Display outside menu - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-display-outside-menu]', - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[hide-custom-menu-mobile]', - 'operator' => '!=', - 'value' => '1', - ), - ), - 'default' => astra_get_option( 'header-display-outside-menu' ), - 'section' => 'section-primary-menu', - 'title' => __( 'Take Last Item Outside Menu', 'astra' ), - 'priority' => 7, - ), - - array( - 'name' => 'primary-menu-label-divider', - 'type' => 'control', - 'control' => 'ast-heading', - 'priority' => 39, - 'title' => __( 'Mobile Menu', 'astra' ), - 'section' => 'section-primary-menu', - 'settings' => array(), - ), - - /** - * Option: Mobile Header Breakpoint - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-breakpoint]', - 'default' => astra_get_option( 'mobile-header-breakpoint' ), - 'type' => 'control', - 'control' => 'ast-slider', - 'section' => 'section-primary-menu', - 'priority' => 40, - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'title' => __( 'Menu Breakpoint', 'astra' ), - 'suffix' => 'px', - 'input_attrs' => array( - 'min' => 0, - 'step' => 10, - 'max' => 6000, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Notice to add # link to parent menu when Link option selected in Dropdown Target. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-target-link-notice]', - 'type' => 'control', - 'control' => 'ast-description', - 'section' => 'section-header', - 'priority' => 41, - 'title' => '', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-target]', - 'operator' => '==', - 'value' => 'link', - ), - ), - 'help' => __( 'The parent menu should have a # link for the submenu to open on a link.', 'astra' ), - 'settings' => array(), - ), - - /** - * Option: Mobile Menu Label. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-main-menu-label]', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'header-main-menu-label' ), - 'section' => 'section-primary-menu', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'context' => array( - 'relation' => 'AND', - ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab, - array( - 'relation' => 'OR', - array( - 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', - 'operator' => '!=', - 'value' => array( 'none' ), - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]', - 'operator' => '!=', - 'value' => array( '1' ), - ), - ), - ), - 'priority' => 40, - 'title' => __( 'Menu Label', 'astra' ), - 'type' => 'control', - 'control' => 'text', - 'partial' => array( - 'selector' => '.ast-button-wrap', - 'container_inclusive' => false, - 'render_callback' => 'Astra_Customizer_Partials::mobile_toggle_menu', - ), - ), - - /** - * Option: Toggle Button Style - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style]', - 'default' => astra_get_option( 'mobile-header-toggle-btn-style' ), - 'section' => 'section-primary-menu', - 'title' => __( 'Toggle Button Style', 'astra' ), - 'type' => 'control', - 'control' => 'ast-select', - 'priority' => 42, - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]', - 'operator' => '!=', - 'value' => true, - ), - ), - 'choices' => array( - 'fill' => __( 'Fill', 'astra' ), - 'outline' => __( 'Outline', 'astra' ), - 'minimal' => __( 'Minimal', 'astra' ), - ), - ), - - /** - * Option: Toggle Button Color - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style-color]', - 'default' => astra_get_option( 'mobile-header-toggle-btn-style-color' ), - 'type' => 'control', - 'control' => 'ast-color', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[mobile-menu-style]', - 'operator' => '!=', - 'value' => 'no-toggle', - ), - ), - 'title' => __( 'Toggle Button Color', 'astra' ), - 'section' => 'section-primary-menu', - 'transport' => 'postMessage', - 'priority' => 42, - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Border Radius - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-border-radius]', - 'default' => astra_get_option( 'mobile-header-toggle-btn-border-radius' ), - 'type' => 'control', - 'control' => 'ast-slider', - 'section' => 'section-primary-menu', - 'title' => __( 'Border Radius', 'astra' ), - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style]', - 'operator' => '!=', - 'value' => 'minimal', - ), - ), - 'priority' => 42, - 'suffix' => 'px', - 'transport' => 'postMessage', - 'input_attrs' => array( - 'min' => 0, - 'step' => 1, - 'max' => 100, - ), - ), - - /** - * Option: Toggle on click of button or link. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-target]', - 'default' => astra_get_option( 'mobile-header-toggle-target' ), - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-primary-menu', - 'priority' => 42, - 'title' => __( 'Dropdown Target', 'astra' ), - 'suffix' => '', - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'choices' => array( - 'icon' => __( 'Icon', 'astra' ), - 'link' => __( 'Link', 'astra' ), - ), - ), - - ); - - $configurations = array_merge( $configurations, $_configs ); - - // Learn More link if Astra Pro is not activated. - if ( ! defined( 'ASTRA_EXT_VER' ) ) { - - $config = array( - - /** - * Option: Learn More about Mobile Header - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-more-feature-description]', - 'type' => 'control', - 'control' => 'ast-description', - 'section' => 'section-header', - 'priority' => 999, - 'title' => '', - 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', - 'settings' => array(), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - ); - - $configurations = array_merge( $configurations, $config ); - } - - return $configurations; - } - } -} - - -new Astra_Header_Layout_Configs(); + ASTRA_THEME_SETTINGS . '[header-layouts]', + 'default' => astra_get_option( 'header-layouts' ), + 'section' => 'section-header', + 'priority' => 4, + 'title' => __( 'Layout', 'astra' ), + 'type' => 'control', + 'control' => 'ast-radio-image', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), + 'choices' => array( + 'header-main-layout-1' => array( + 'label' => __( 'Logo Left', 'astra' ), + 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'header-main-layout-1' ), + ), + 'header-main-layout-2' => array( + 'label' => __( 'Logo Center', 'astra' ), + 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'header-main-layout-2' ), + ), + 'header-main-layout-3' => array( + 'label' => __( 'Logo Right', 'astra' ), + 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'header-main-layout-3' ), + ), + ), + ), + + /** + * Option: Header Width + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-layout-width]', + 'default' => astra_get_option( 'header-main-layout-width' ), + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-header', + 'priority' => 4, + 'title' => __( 'Width', 'astra' ), + 'choices' => array( + 'full' => __( 'Full Width', 'astra' ), + 'content' => __( 'Content Width', 'astra' ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Bottom Border Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-sep]', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'header-main-sep' ), + 'type' => 'control', + 'control' => 'number', + 'section' => 'section-header', + 'priority' => 4, + 'title' => __( 'Bottom Border Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + 'step' => 1, + 'max' => 600, + ), + ), + + /** + * Option: Bottom Border Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-sep-color]', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'header-main-sep-color' ), + 'type' => 'control', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-sep]', + 'operator' => '>=', + 'value' => 1, + ), + ), + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'section' => 'section-header', + 'priority' => 4, + 'title' => __( 'Bottom Border Color', 'astra' ), + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]', + 'default' => astra_get_option( 'disable-primary-nav' ), + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'section' => 'section-primary-menu', + 'title' => __( 'Disable Menu', 'astra' ), + 'priority' => 5, + 'partial' => array( + 'selector' => '.main-header-bar .main-navigation', + 'container_inclusive' => false, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'default' => astra_get_option( 'header-main-rt-section' ), + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-primary-menu', + 'priority' => 7, + 'title' => __( 'Last Item in Menu', 'astra' ), + 'choices' => apply_filters( + 'astra_header_section_elements', + array( + 'none' => __( 'None', 'astra' ), + 'search' => __( 'Search', 'astra' ), + 'button' => __( 'Button', 'astra' ), + 'text-html' => __( 'Text / HTML', 'astra' ), + 'widget' => __( 'Widget', 'astra' ), + ), + 'primary-header' + ), + 'partial' => array( + 'selector' => '.main-header-bar .main-navigation .main-header-menu .ast-masthead-custom-menu-items.search-custom-menu-item .ast-search-icon .astra-search-icon, .main-header-bar .main-navigation .main-header-menu .ast-masthead-custom-menu-items.woocommerce-custom-menu-item, .main-header-bar .ast-masthead-custom-menu-items.widget-custom-menu-item .ast-header-widget-area .widget.ast-no-widget-row, .main-header-bar .main-navigation .main-header-menu .ast-masthead-custom-menu-items.edd-custom-menu-item', + 'container_inclusive' => false, + ), + ), + + /** + * Option: Button Text + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-text]', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'header-main-rt-section-button-text' ), + 'type' => 'control', + 'control' => 'text', + 'section' => 'section-primary-menu', + 'partial' => array( + 'selector' => '.button-custom-menu-item', + 'container_inclusive' => false, + 'render_callback' => 'Astra_Customizer_Partials::render_header_main_rt_section_button_text', + ), + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => '===', + 'value' => 'button', + ), + ), + 'priority' => 10, + 'title' => __( 'Button Text', 'astra' ), + ), + + /** + * Option: Button Link + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-link-option]', + 'default' => astra_get_option( 'header-main-rt-section-button-link-option' ), + 'type' => 'control', + 'control' => 'ast-link', + 'section' => 'section-primary-menu', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => '===', + 'value' => 'button', + ), + ), + 'priority' => 10, + 'title' => __( 'Button Link', 'astra' ), + ), + + /** + * Option: Button Style + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', + 'default' => astra_get_option( 'header-main-rt-section-button-style' ), + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-primary-menu', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => '===', + 'value' => 'button', + ), + ), + 'priority' => 10, + 'choices' => array( + 'theme-button' => __( 'Theme Button', 'astra' ), + 'custom-button' => __( 'Header Button', 'astra' ), + ), + 'title' => __( 'Button Style', 'astra' ), + ), + + /** + * Option: Theme Button Style edit link + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-button-style-link]', + 'default' => astra_get_option( 'header-button-style-link' ), + 'type' => 'control', + 'control' => 'ast-customizer-link', + 'section' => 'section-primary-menu', + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => '===', + 'value' => 'button', + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]', + 'operator' => '===', + 'value' => 'theme-button', + ), + ), + 'priority' => 10, + 'link_type' => 'section', + 'linked' => 'section-buttons', + 'link_text' => __( 'Customize Button Style.', 'astra' ), + ), + + /** + * Option: Right Section Text / HTML + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-html]', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'header-main-rt-section-html' ), + 'type' => 'control', + 'control' => 'textarea', + 'section' => 'section-primary-menu', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => '===', + 'value' => 'text-html', + ), + ), + 'priority' => 10, + 'partial' => array( + 'selector' => '.main-header-bar .ast-masthead-custom-menu-items .ast-custom-html', + 'container_inclusive' => false, + 'render_callback' => 'Astra_Customizer_Partials::render_header_main_rt_section_html', + ), + 'title' => __( 'Custom Menu Text / HTML', 'astra' ), + ), + + array( + 'name' => 'primary-header-sub-menu-label-divider', + 'type' => 'control', + 'control' => 'ast-heading', + 'priority' => 30, + 'title' => __( 'Sub Menu', 'astra' ), + 'section' => 'section-primary-menu', + 'settings' => array(), + ), + + /** + * Option: Submenu Container Animation + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-submenu-container-animation]', + 'default' => astra_get_option( 'header-main-submenu-container-animation' ), + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-primary-menu', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]', + 'operator' => '!=', + 'value' => true, + ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'priority' => 30, + 'title' => __( 'Submenu Animation', 'astra' ), + 'choices' => array( + '' => __( 'None', 'astra' ), + 'slide-down' => __( 'Slide Down', 'astra' ), + 'slide-up' => __( 'Slide Up', 'astra' ), + 'fade' => __( 'Fade', 'astra' ), + ), + ), + + // Option: Primary Menu Border. + array( + 'type' => 'control', + 'control' => 'ast-border', + 'transport' => 'postMessage', + 'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-border]', + 'section' => 'section-primary-menu', + 'linked_choices' => true, + 'priority' => 30, + 'default' => astra_get_option( 'primary-submenu-border' ), + 'title' => __( 'Container Border', 'astra' ), + 'choices' => array( + 'top' => __( 'Top', 'astra' ), + 'right' => __( 'Right', 'astra' ), + 'bottom' => __( 'Bottom', 'astra' ), + 'left' => __( 'Left', 'astra' ), + ), + ), + + // Option: Submenu Container Border Color. + array( + 'type' => 'control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'transport' => 'postMessage', + 'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-b-color]', + 'default' => astra_get_option( 'primary-submenu-b-color' ), + 'title' => __( 'Border Color', 'astra' ), + 'section' => 'section-primary-menu', + 'priority' => 30, + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + array( + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'transport' => 'postMessage', + 'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-item-border]', + 'section' => 'section-primary-menu', + 'priority' => 30, + 'default' => astra_get_option( 'primary-submenu-item-border' ), + 'title' => __( 'Submenu Divider', 'astra' ), + ), + + // Option: Submenu item Border Color. + array( + 'type' => 'control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'transport' => 'postMessage', + 'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-item-b-color]', + 'default' => astra_get_option( 'primary-submenu-item-b-color' ), + 'title' => __( 'Divider Color', 'astra' ), + 'section' => 'section-primary-menu', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[primary-submenu-item-border]', + 'operator' => '==', + 'value' => true, + ), + ), + 'priority' => 30, + ), + + /** + * Option: Mobile Menu Label Divider + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-menu-label-divider]', + 'type' => 'control', + 'control' => 'ast-heading', + 'section' => 'section-header', + 'priority' => 35, + 'title' => __( 'Mobile Header', 'astra' ), + 'settings' => array(), + ), + + /** + * Option: Mobile Menu Alignment + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-menu-align]', + 'default' => astra_get_option( 'header-main-menu-align' ), + 'type' => 'control', + 'control' => 'ast-radio-image', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), + 'choices' => array( + 'inline' => array( + 'label' => __( 'Inline', 'astra' ), + 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'menu-inline' ), + ), + 'stack' => array( + 'label' => __( 'Stack', 'astra' ), + 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'menu-stack' ), + ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'section' => 'section-header', + 'priority' => 40, + 'title' => __( 'Layout', 'astra' ), + ), + + /** + * Option: Hide Last item in Menu on mobile device + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[hide-custom-menu-mobile]', + 'default' => astra_get_option( 'hide-custom-menu-mobile' ), + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => 'in', + 'value' => array( 'button', 'text-html' ), + ), + ), + 'section' => 'section-primary-menu', + 'title' => __( 'Hide Last Item in Menu on Mobile', 'astra' ), + 'priority' => 7, + 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), + ), + + /** + * Option: Display outside menu + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-display-outside-menu]', + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[hide-custom-menu-mobile]', + 'operator' => '!=', + 'value' => '1', + ), + ), + 'default' => astra_get_option( 'header-display-outside-menu' ), + 'section' => 'section-primary-menu', + 'title' => __( 'Take Last Item Outside Menu', 'astra' ), + 'priority' => 7, + ), + + array( + 'name' => 'primary-menu-label-divider', + 'type' => 'control', + 'control' => 'ast-heading', + 'priority' => 39, + 'title' => __( 'Mobile Menu', 'astra' ), + 'section' => 'section-primary-menu', + 'settings' => array(), + ), + + /** + * Option: Mobile Header Breakpoint + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-breakpoint]', + 'default' => astra_get_option( 'mobile-header-breakpoint' ), + 'type' => 'control', + 'control' => 'ast-slider', + 'section' => 'section-primary-menu', + 'priority' => 40, + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'title' => __( 'Menu Breakpoint', 'astra' ), + 'suffix' => 'px', + 'input_attrs' => array( + 'min' => 0, + 'step' => 10, + 'max' => 6000, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Notice to add # link to parent menu when Link option selected in Dropdown Target. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-target-link-notice]', + 'type' => 'control', + 'control' => 'ast-description', + 'section' => 'section-header', + 'priority' => 41, + 'title' => '', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-target]', + 'operator' => '==', + 'value' => 'link', + ), + ), + 'help' => __( 'The parent menu should have a # link for the submenu to open on a link.', 'astra' ), + 'settings' => array(), + ), + + /** + * Option: Mobile Menu Label. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-main-menu-label]', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'header-main-menu-label' ), + 'section' => 'section-primary-menu', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'context' => array( + 'relation' => 'AND', + ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab, + array( + 'relation' => 'OR', + array( + 'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]', + 'operator' => '!=', + 'value' => array( 'none' ), + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]', + 'operator' => '!=', + 'value' => array( '1' ), + ), + ), + ), + 'priority' => 40, + 'title' => __( 'Menu Label', 'astra' ), + 'type' => 'control', + 'control' => 'text', + 'partial' => array( + 'selector' => '.ast-button-wrap', + 'container_inclusive' => false, + 'render_callback' => 'Astra_Customizer_Partials::mobile_toggle_menu', + ), + ), + + /** + * Option: Toggle Button Style + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style]', + 'default' => astra_get_option( 'mobile-header-toggle-btn-style' ), + 'section' => 'section-primary-menu', + 'title' => __( 'Toggle Button Style', 'astra' ), + 'type' => 'control', + 'control' => 'ast-select', + 'priority' => 42, + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]', + 'operator' => '!=', + 'value' => true, + ), + ), + 'choices' => array( + 'fill' => __( 'Fill', 'astra' ), + 'outline' => __( 'Outline', 'astra' ), + 'minimal' => __( 'Minimal', 'astra' ), + ), + ), + + /** + * Option: Toggle Button Color + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style-color]', + 'default' => astra_get_option( 'mobile-header-toggle-btn-style-color' ), + 'type' => 'control', + 'control' => 'ast-color', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[mobile-menu-style]', + 'operator' => '!=', + 'value' => 'no-toggle', + ), + ), + 'title' => __( 'Toggle Button Color', 'astra' ), + 'section' => 'section-primary-menu', + 'transport' => 'postMessage', + 'priority' => 42, + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Border Radius + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-border-radius]', + 'default' => astra_get_option( 'mobile-header-toggle-btn-border-radius' ), + 'type' => 'control', + 'control' => 'ast-slider', + 'section' => 'section-primary-menu', + 'title' => __( 'Border Radius', 'astra' ), + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style]', + 'operator' => '!=', + 'value' => 'minimal', + ), + ), + 'priority' => 42, + 'suffix' => 'px', + 'transport' => 'postMessage', + 'input_attrs' => array( + 'min' => 0, + 'step' => 1, + 'max' => 100, + ), + ), + + /** + * Option: Toggle on click of button or link. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-target]', + 'default' => astra_get_option( 'mobile-header-toggle-target' ), + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-primary-menu', + 'priority' => 42, + 'title' => __( 'Dropdown Target', 'astra' ), + 'suffix' => '', + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'choices' => array( + 'icon' => __( 'Icon', 'astra' ), + 'link' => __( 'Link', 'astra' ), + ), + ), + + ); + + $configurations = array_merge( $configurations, $_configs ); + + // Learn More link if Astra Pro is not activated. + if ( ! defined( 'ASTRA_EXT_VER' ) ) { + + $config = array( + + /** + * Option: Learn More about Mobile Header + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-more-feature-description]', + 'type' => 'control', + 'control' => 'ast-description', + 'section' => 'section-header', + 'priority' => 999, + 'title' => '', + 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', + 'settings' => array(), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + ); + + $configurations = array_merge( $configurations, $config ); + } + + return $configurations; + } + } +} + + +new Astra_Header_Layout_Configs(); diff --git a/inc/customizer/configurations/layout/class-astra-sidebar-layout-configs.php b/inc/customizer/configurations/layout/class-astra-sidebar-layout-configs.php index 279675d..14a303b 100644 --- a/inc/customizer/configurations/layout/class-astra-sidebar-layout-configs.php +++ b/inc/customizer/configurations/layout/class-astra-sidebar-layout-configs.php @@ -1,155 +1,155 @@ - ASTRA_THEME_SETTINGS . '[site-sidebar-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-sidebars', - 'default' => astra_get_option( 'site-sidebar-layout' ), - 'priority' => 5, - 'title' => __( 'Default Layout', 'astra' ), - 'choices' => array( - 'no-sidebar' => __( 'No Sidebar', 'astra' ), - 'left-sidebar' => __( 'Left Sidebar', 'astra' ), - 'right-sidebar' => __( 'Right Sidebar', 'astra' ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Page - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[single-page-sidebar-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-sidebars', - 'default' => astra_get_option( 'single-page-sidebar-layout' ), - 'priority' => 5, - 'title' => __( 'Pages', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'no-sidebar' => __( 'No Sidebar', 'astra' ), - 'left-sidebar' => __( 'Left Sidebar', 'astra' ), - 'right-sidebar' => __( 'Right Sidebar', 'astra' ), - ), - ), - - /** - * Option: Blog Post - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[single-post-sidebar-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'default' => astra_get_option( 'single-post-sidebar-layout' ), - 'section' => 'section-sidebars', - 'priority' => 5, - 'title' => __( 'Blog Posts', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'no-sidebar' => __( 'No Sidebar', 'astra' ), - 'left-sidebar' => __( 'Left Sidebar', 'astra' ), - 'right-sidebar' => __( 'Right Sidebar', 'astra' ), - ), - ), - - /** - * Option: Blog Post Archive - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[archive-post-sidebar-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'default' => astra_get_option( 'archive-post-sidebar-layout' ), - 'section' => 'section-sidebars', - 'priority' => 5, - 'title' => __( 'Archives', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'no-sidebar' => __( 'No Sidebar', 'astra' ), - 'left-sidebar' => __( 'Left Sidebar', 'astra' ), - 'right-sidebar' => __( 'Right Sidebar', 'astra' ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Primary Content Width - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[site-sidebar-width]', - 'type' => 'control', - 'control' => 'ast-slider', - 'default' => astra_get_option( 'site-sidebar-width' ), - 'section' => 'section-sidebars', - 'priority' => 15, - 'title' => __( 'Sidebar Width', 'astra' ), - 'suffix' => '%', - 'transport' => 'postMessage', - 'input_attrs' => array( - 'min' => 15, - 'step' => 1, - 'max' => 50, - ), - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[site-sidebar-width-description]', - 'type' => 'control', - 'control' => 'ast-description', - 'section' => 'section-sidebars', - 'priority' => 15, - 'title' => '', - 'help' => __( 'Sidebar width will apply only when one of the above sidebar is set.', 'astra' ), - 'settings' => array(), - ), - ); - - return array_merge( $configurations, $_configs ); - } - } -} - - -new Astra_Sidebar_Layout_Configs(); - - - - - + ASTRA_THEME_SETTINGS . '[site-sidebar-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-sidebars', + 'default' => astra_get_option( 'site-sidebar-layout' ), + 'priority' => 5, + 'title' => __( 'Default Layout', 'astra' ), + 'choices' => array( + 'no-sidebar' => __( 'No Sidebar', 'astra' ), + 'left-sidebar' => __( 'Left Sidebar', 'astra' ), + 'right-sidebar' => __( 'Right Sidebar', 'astra' ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Page + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[single-page-sidebar-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-sidebars', + 'default' => astra_get_option( 'single-page-sidebar-layout' ), + 'priority' => 5, + 'title' => __( 'Pages', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'no-sidebar' => __( 'No Sidebar', 'astra' ), + 'left-sidebar' => __( 'Left Sidebar', 'astra' ), + 'right-sidebar' => __( 'Right Sidebar', 'astra' ), + ), + ), + + /** + * Option: Blog Post + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[single-post-sidebar-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'default' => astra_get_option( 'single-post-sidebar-layout' ), + 'section' => 'section-sidebars', + 'priority' => 5, + 'title' => __( 'Blog Posts', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'no-sidebar' => __( 'No Sidebar', 'astra' ), + 'left-sidebar' => __( 'Left Sidebar', 'astra' ), + 'right-sidebar' => __( 'Right Sidebar', 'astra' ), + ), + ), + + /** + * Option: Blog Post Archive + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[archive-post-sidebar-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'default' => astra_get_option( 'archive-post-sidebar-layout' ), + 'section' => 'section-sidebars', + 'priority' => 5, + 'title' => __( 'Archives', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'no-sidebar' => __( 'No Sidebar', 'astra' ), + 'left-sidebar' => __( 'Left Sidebar', 'astra' ), + 'right-sidebar' => __( 'Right Sidebar', 'astra' ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Primary Content Width + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[site-sidebar-width]', + 'type' => 'control', + 'control' => 'ast-slider', + 'default' => astra_get_option( 'site-sidebar-width' ), + 'section' => 'section-sidebars', + 'priority' => 15, + 'title' => __( 'Sidebar Width', 'astra' ), + 'suffix' => '%', + 'transport' => 'postMessage', + 'input_attrs' => array( + 'min' => 15, + 'step' => 1, + 'max' => 50, + ), + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[site-sidebar-width-description]', + 'type' => 'control', + 'control' => 'ast-description', + 'section' => 'section-sidebars', + 'priority' => 15, + 'title' => '', + 'help' => __( 'Sidebar width will apply only when one of the above sidebar is set.', 'astra' ), + 'settings' => array(), + ), + ); + + return array_merge( $configurations, $_configs ); + } + } +} + + +new Astra_Sidebar_Layout_Configs(); + + + + + diff --git a/inc/customizer/configurations/layout/class-astra-site-container-layout-configs.php b/inc/customizer/configurations/layout/class-astra-site-container-layout-configs.php index e930c89..cb38b95 100644 --- a/inc/customizer/configurations/layout/class-astra-site-container-layout-configs.php +++ b/inc/customizer/configurations/layout/class-astra-site-container-layout-configs.php @@ -1,157 +1,157 @@ - ASTRA_THEME_SETTINGS . '[site-content-layout]', - 'type' => 'control', - 'default' => astra_get_option( 'site-content-layout' ), - 'control' => 'ast-select', - 'section' => 'section-container-layout', - 'priority' => 50, - 'title' => __( 'Layout', 'astra' ), - 'choices' => array( - 'boxed-container' => __( 'Boxed', 'astra' ), - 'content-boxed-container' => __( 'Content Boxed', 'astra' ), - 'plain-container' => __( 'Full Width / Contained', 'astra' ), - 'page-builder' => __( 'Full Width / Stretched', 'astra' ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Single Page Content Layout - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[single-page-content-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'default' => astra_get_option( 'single-page-content-layout' ), - 'section' => 'section-container-layout', - 'title' => __( 'Page Layout', 'astra' ), - 'priority' => 55, - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'boxed-container' => __( 'Boxed', 'astra' ), - 'content-boxed-container' => __( 'Content Boxed', 'astra' ), - 'plain-container' => __( 'Full Width / Contained', 'astra' ), - 'page-builder' => __( 'Full Width / Stretched', 'astra' ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[single-post-content-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'default' => astra_get_option( 'single-post-content-layout' ), - 'section' => 'section-container-layout', - 'priority' => 60, - 'title' => __( 'Blog Post Layout', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'boxed-container' => __( 'Boxed', 'astra' ), - 'content-boxed-container' => __( 'Content Boxed', 'astra' ), - 'plain-container' => __( 'Full Width / Contained', 'astra' ), - 'page-builder' => __( 'Full Width / Stretched', 'astra' ), - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Archive Post Content Layout - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[archive-post-content-layout]', - 'type' => 'control', - 'control' => 'ast-select', - 'default' => astra_get_option( 'archive-post-content-layout' ), - 'section' => 'section-container-layout', - 'priority' => 65, - 'title' => __( 'Archives Layout', 'astra' ), - 'choices' => array( - 'default' => __( 'Default', 'astra' ), - 'boxed-container' => __( 'Boxed', 'astra' ), - 'content-boxed-container' => __( 'Content Boxed', 'astra' ), - 'plain-container' => __( 'Full Width / Contained', 'astra' ), - 'page-builder' => __( 'Full Width / Stretched', 'astra' ), - ), - ), - - /** - * Option: Body Background - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[site-layout-outside-bg-obj-responsive]', - 'type' => 'control', - 'control' => 'ast-responsive-background', - 'default' => astra_get_option( 'site-layout-outside-bg-obj-responsive' ), - 'section' => ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) ) ? 'section-colors-body' : 'section-colors-background', - 'transport' => 'postMessage', - 'priority' => 25, - 'title' => __( 'Background', 'astra' ), - ), - ); - - $configurations = array_merge( $configurations, $_configs ); - - // Learn More link if Astra Pro is not activated. - if ( ! defined( 'ASTRA_EXT_VER' ) ) { - - $config = array( - - array( - 'name' => ASTRA_THEME_SETTINGS . '[ast-container-more-feature-description]', - 'type' => 'control', - 'control' => 'ast-description', - 'section' => 'section-container-layout', - 'priority' => 999, - 'title' => '', - 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', - 'settings' => array(), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - ); - - $configurations = array_merge( $configurations, $config ); - } - - return $configurations; - } - } -} - -new Astra_Site_Container_Layout_Configs(); + ASTRA_THEME_SETTINGS . '[site-content-layout]', + 'type' => 'control', + 'default' => astra_get_option( 'site-content-layout' ), + 'control' => 'ast-select', + 'section' => 'section-container-layout', + 'priority' => 50, + 'title' => __( 'Layout', 'astra' ), + 'choices' => array( + 'boxed-container' => __( 'Boxed', 'astra' ), + 'content-boxed-container' => __( 'Content Boxed', 'astra' ), + 'plain-container' => __( 'Full Width / Contained', 'astra' ), + 'page-builder' => __( 'Full Width / Stretched', 'astra' ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Single Page Content Layout + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[single-page-content-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'default' => astra_get_option( 'single-page-content-layout' ), + 'section' => 'section-container-layout', + 'title' => __( 'Page Layout', 'astra' ), + 'priority' => 55, + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'boxed-container' => __( 'Boxed', 'astra' ), + 'content-boxed-container' => __( 'Content Boxed', 'astra' ), + 'plain-container' => __( 'Full Width / Contained', 'astra' ), + 'page-builder' => __( 'Full Width / Stretched', 'astra' ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[single-post-content-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'default' => astra_get_option( 'single-post-content-layout' ), + 'section' => 'section-container-layout', + 'priority' => 60, + 'title' => __( 'Blog Post Layout', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'boxed-container' => __( 'Boxed', 'astra' ), + 'content-boxed-container' => __( 'Content Boxed', 'astra' ), + 'plain-container' => __( 'Full Width / Contained', 'astra' ), + 'page-builder' => __( 'Full Width / Stretched', 'astra' ), + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Archive Post Content Layout + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[archive-post-content-layout]', + 'type' => 'control', + 'control' => 'ast-select', + 'default' => astra_get_option( 'archive-post-content-layout' ), + 'section' => 'section-container-layout', + 'priority' => 65, + 'title' => __( 'Archives Layout', 'astra' ), + 'choices' => array( + 'default' => __( 'Default', 'astra' ), + 'boxed-container' => __( 'Boxed', 'astra' ), + 'content-boxed-container' => __( 'Content Boxed', 'astra' ), + 'plain-container' => __( 'Full Width / Contained', 'astra' ), + 'page-builder' => __( 'Full Width / Stretched', 'astra' ), + ), + ), + + /** + * Option: Body Background + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[site-layout-outside-bg-obj-responsive]', + 'type' => 'control', + 'control' => 'ast-responsive-background', + 'default' => astra_get_option( 'site-layout-outside-bg-obj-responsive' ), + 'section' => ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) ) ? 'section-colors-body' : 'section-colors-background', + 'transport' => 'postMessage', + 'priority' => 25, + 'title' => __( 'Background', 'astra' ), + ), + ); + + $configurations = array_merge( $configurations, $_configs ); + + // Learn More link if Astra Pro is not activated. + if ( ! defined( 'ASTRA_EXT_VER' ) ) { + + $config = array( + + array( + 'name' => ASTRA_THEME_SETTINGS . '[ast-container-more-feature-description]', + 'type' => 'control', + 'control' => 'ast-description', + 'section' => 'section-container-layout', + 'priority' => 999, + 'title' => '', + 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', + 'settings' => array(), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + ); + + $configurations = array_merge( $configurations, $config ); + } + + return $configurations; + } + } +} + +new Astra_Site_Container_Layout_Configs(); diff --git a/inc/customizer/configurations/layout/class-astra-site-identity-configs.php b/inc/customizer/configurations/layout/class-astra-site-identity-configs.php index d01af50..c046a97 100644 --- a/inc/customizer/configurations/layout/class-astra-site-identity-configs.php +++ b/inc/customizer/configurations/layout/class-astra-site-identity-configs.php @@ -1,495 +1,495 @@ - ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-header-logo]', - 'type' => 'control', - 'control' => 'ast-description', - 'section' => $_section, - 'priority' => 1, - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', - 'operator' => '==', - 'value' => true, - ), - ), - 'active_callback' => array( $this, 'is_transparent_header_enabled' ), - 'help' => $this->get_help_text_notice( 'transparent-header' ), - ), - - /** - * Option: Transparent Header Section - Link. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-header-logo-link]', - 'type' => 'control', - 'control' => 'ast-customizer-link', - 'section' => $_section, - 'priority' => 1, - 'link_type' => 'control', - 'linked' => ASTRA_THEME_SETTINGS . '[transparent-header-logo]', - 'context' => array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', - 'operator' => '==', - 'value' => true, - ), - ), - 'link_text' => '' . __( 'Customize Transparent Header.', 'astra' ) . '', - 'active_callback' => array( $this, 'is_transparent_header_enabled' ), - ), - - - /** - * Option: Different retina logo - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[different-retina-logo]', - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'section' => $_section, - 'title' => __( 'Different Logo For Retina Devices?', 'astra' ), - 'default' => astra_get_option( 'different-retina-logo' ), - 'priority' => 5, - 'transport' => 'postMessage', - 'divider' => array( 'ast_class' => 'ast-top-divider' ), - 'context' => array( - array( - 'setting' => 'custom_logo', - 'operator' => '!=', - 'value' => '', - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'partial' => array( - 'selector' => '.site-branding', - 'container_inclusive' => false, - 'render_callback' => 'Astra_Builder_Header::site_identity', - ), - ), - - /** - * Option: Retina logo selector - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[ast-header-retina-logo]', - 'default' => astra_get_option( 'ast-header-retina-logo' ), - 'type' => 'control', - 'control' => 'image', - 'sanitize_callback' => 'esc_url_raw', - 'section' => 'title_tagline', - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[different-retina-logo]', - 'operator' => '!=', - 'value' => 0, - ), - Astra_Builder_Helper::$general_tab_config, - ), - 'priority' => 6, - 'title' => __( 'Retina Logo', 'astra' ), - 'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ), - 'transport' => 'postMessage', - 'partial' => array( - 'selector' => '.site-branding', - 'container_inclusive' => false, - 'render_callback' => 'Astra_Builder_Header::site_identity', - ), - ), - - /** - * Option: Inherit Desktop logo - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[different-mobile-logo]', - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'default' => astra_get_option( 'different-mobile-logo' ), - 'section' => 'title_tagline', - 'title' => __( 'Different Logo For Mobile Devices?', 'astra' ), - 'priority' => 5, - 'context' => array( - array( - 'setting' => 'custom_logo', - 'operator' => '!=', - 'value' => '', - ), - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => 'ast_selected_device', - 'operator' => 'in', - 'value' => array( 'tablet', 'mobile' ), - ), - ), - 'transport' => 'postMessage', - 'partial' => array( - 'selector' => '.site-branding', - 'container_inclusive' => false, - 'render_callback' => 'Astra_Builder_Header::site_identity', - ), - ), - - /** - * Option: Mobile header logo - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-logo]', - 'default' => astra_get_option( 'mobile-header-logo' ), - 'type' => 'control', - 'control' => 'image', - 'sanitize_callback' => 'esc_url_raw', - 'section' => 'title_tagline', - 'priority' => 5.5, - 'title' => __( 'Mobile Logo (optional)', 'astra' ), - 'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'context' => array( - array( - 'setting' => ASTRA_THEME_SETTINGS . '[different-mobile-logo]', - 'operator' => '==', - 'value' => '1', - ), - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => 'ast_selected_device', - 'operator' => 'in', - 'value' => array( 'tablet', 'mobile' ), - ), - ), - ), - - /** - * Option: Logo Width - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[ast-header-responsive-logo-width]', - 'type' => 'control', - 'control' => 'ast-responsive-slider', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), - 'section' => $_section, - 'transport' => 'postMessage', - 'default' => astra_get_option( 'ast-header-responsive-logo-width' ), - 'priority' => 7, - 'title' => __( 'Logo Width', 'astra' ), - 'suffix' => 'px', - 'input_attrs' => array( - 'min' => 0, - 'step' => 1, - 'max' => 600, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), - ), - - /** - * Option: Display Title - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', - 'type' => 'control', - 'control' => 'ast-responsive-toggle-control', - 'default' => astra_get_option( 'display-site-title-responsive' ), - 'section' => 'title_tagline', - 'title' => __( 'Display Site Title', 'astra' ), - 'priority' => 7, - 'transport' => 'postMessage', - 'partial' => array( - 'selector' => '.site-branding', - 'container_inclusive' => false, - 'render_callback' => 'Astra_Builder_Header::site_identity', - ), - ), - - /** - * Option: Divider - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[ast-site-title-tagline-divider]', - 'type' => 'control', - 'section' => $_section, - 'control' => 'ast-divider', - 'priority' => 13, - 'settings' => array(), - 'context' => array( Astra_Builder_Helper::$general_tab_config ), - ), - - /** - * Option: Display Tagline - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', - 'type' => 'control', - 'control' => 'ast-responsive-toggle-control', - 'default' => astra_get_option( 'display-site-tagline-responsive' ), - 'section' => 'title_tagline', - 'priority' => 11, - 'title' => __( 'Display Site Tagline', 'astra' ), - 'transport' => 'postMessage', - 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), - 'partial' => array( - - 'selector' => '.site-branding', - 'container_inclusive' => false, - 'render_callback' => 'Astra_Builder_Header::site_identity', - ), - ), - - /** - * Option: Logo inline title. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[logo-title-inline]', - 'default' => astra_get_option( 'logo-title-inline' ), - 'type' => 'control', - 'context' => array( Astra_Builder_Helper::$general_tab_config ), - 'control' => 'ast-toggle-control', - 'divider' => array( 'ast_class' => 'ast-top-divider' ), - 'section' => $_section, - 'title' => __( 'Inline Logo & Site Title', 'astra' ), - 'priority' => 8, - 'transport' => 'postMessage', - 'partial' => array( - 'selector' => '.site-branding', - 'container_inclusive' => false, - 'render_callback' => 'Astra_Builder_Header::site_identity', - ), - ), - ); - - /** - * We adding this control only to maintain backwards. Remove this condition after 2-3 updates of add-on. - * Moving Site Title color & Tagline color option into theme. - * - * @since 3.5.0 - */ - $load_site_tagline_color_controls = true; - if ( is_astra_addon_3_5_0_version() ) { - $load_site_tagline_color_controls = false; - } - - if ( $load_site_tagline_color_controls ) { - $_configs = array_merge( - $_configs, - array( - // Color Group control for site title colors. - array( - 'name' => ASTRA_THEME_SETTINGS . '[site-identity-title-color-group]', - 'default' => astra_get_option( 'site-identity-title-color-group' ), - 'type' => 'control', - 'control' => 'ast-color-group', - 'title' => Astra_Builder_Helper::$is_header_footer_builder_active ? __( 'Title Color', 'astra' ) : __( 'Colors', 'astra' ), - 'section' => $_section, - 'responsive' => false, - 'transport' => 'postMessage', - 'priority' => 8, - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '', - ), - - // Option: Site Title Color. - array( - 'name' => 'header-color-site-title', - 'parent' => ASTRA_THEME_SETTINGS . '[site-identity-title-color-group]', - 'section' => 'title_tagline', - 'type' => 'sub-control', - 'control' => 'ast-color', - 'priority' => 5, - 'default' => astra_get_option( 'header-color-site-title' ), - 'transport' => 'postMessage', - 'title' => __( 'Normal', 'astra' ), - 'context' => Astra_Builder_Helper::$design_tab, - ), - - // Option: Site Title Hover Color. - array( - 'name' => 'header-color-h-site-title', - 'parent' => ASTRA_THEME_SETTINGS . '[site-identity-title-color-group]', - 'section' => 'title_tagline', - 'type' => 'sub-control', - 'control' => 'ast-color', - 'priority' => 10, - 'transport' => 'postMessage', - 'default' => astra_get_option( 'header-color-h-site-title' ), - 'title' => __( 'Hover', 'astra' ), - 'context' => Astra_Builder_Helper::$design_tab, - ), - - // Option: Site Tagline Color. - array( - 'name' => ASTRA_THEME_SETTINGS . '[header-color-site-tagline]', - 'type' => 'control', - 'control' => 'ast-color', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'header-color-site-tagline' ), - 'title' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? __( 'Tagline', 'astra' ) : __( 'Color', 'astra' ), - 'section' => 'title_tagline', - 'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 8 : 12, - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '', - ), - ) - ); - } - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - - $_configs = array_merge( - $_configs, - array( - /** - * Notice - Transparent meta header enabled on page. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-meta-enabled]', - 'type' => 'control', - 'control' => 'ast-description', - 'section' => 'section-header-builder-layout', - 'priority' => 1, - 'active_callback' => array( $this, 'is_transparent_header_enabled' ), - 'help' => $this->get_help_text_notice( 'transparent-meta' ), - ), - - /** - * Notice Link - Transparent meta header enabled on page. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-header-meta-link]', - 'type' => 'control', - 'control' => 'ast-customizer-link', - 'section' => 'section-header-builder-layout', - 'priority' => 1, - 'link_type' => 'section', - 'linked' => 'section-transparent-header', - 'link_text' => '' . __( 'Customize Transparent Header.', 'astra' ) . '', - 'active_callback' => array( $this, 'is_transparent_header_enabled' ), - ), - ) - ); - } - - if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) { - - $new_configs = array( - - /** - * Option: Header Site Title. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[site-title-typography]', - 'default' => astra_get_option( 'site-title-typography' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? __( 'Title Font', 'astra' ) : __( 'Typography', 'astra' ), - 'section' => $_section, - 'transport' => 'postMessage', - 'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 16 : 8, - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '', - ), - - /** - * Options: Site Tagline. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[site-tagline-typography]', - 'default' => astra_get_option( 'site-tagline-typography' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? __( 'Tagline Font', 'astra' ) : __( 'Typography', 'astra' ), - 'section' => $_section, - 'transport' => 'postMessage', - 'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 20 : 11, - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '', - ), - ); - - $_configs = array_merge( $_configs, $new_configs ); - } - - $configurations = array_merge( $configurations, $_configs ); - return $configurations; - - } - - /** - * Check if transparent header is enabled on the page being previewed. - * - * @since 2.4.5 - * @return boolean True - If Transparent Header is enabled, False if not. - */ - public function is_transparent_header_enabled() { - $status = Astra_Ext_Transparent_Header_Markup::is_transparent_header(); - return ( true === $status ? true : false ); - } - - /** - * Help notice message to be displayed when the page that is being previewed has Logo set from Transparent Header. - * - * @since 2.4.5 - * @param String $context Type of notice message to be returned. - * @return String HTML Markup for the help notice. - */ - private function get_help_text_notice( $context ) { - - switch ( $context ) { - case 'transparent-header': - $notice = '

    The Logo on this page is set from the Transparent Header Section. Please click the link below to customize Transparent Header Logo.

    '; - break; - case 'transparent-meta': - $notice = '

    The header on this page is set from the Transparent Header.

    Please click the link below to customize Transparent Header

    '; - break; - default: - $notice = ''; - } - return $notice; - } - } -} - - -new Astra_Site_Identity_Configs(); + ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-header-logo]', + 'type' => 'control', + 'control' => 'ast-description', + 'section' => $_section, + 'priority' => 1, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', + 'operator' => '==', + 'value' => true, + ), + ), + 'active_callback' => array( $this, 'is_transparent_header_enabled' ), + 'help' => $this->get_help_text_notice( 'transparent-header' ), + ), + + /** + * Option: Transparent Header Section - Link. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-header-logo-link]', + 'type' => 'control', + 'control' => 'ast-customizer-link', + 'section' => $_section, + 'priority' => 1, + 'link_type' => 'control', + 'linked' => ASTRA_THEME_SETTINGS . '[transparent-header-logo]', + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]', + 'operator' => '==', + 'value' => true, + ), + ), + 'link_text' => '' . __( 'Customize Transparent Header.', 'astra' ) . '', + 'active_callback' => array( $this, 'is_transparent_header_enabled' ), + ), + + + /** + * Option: Different retina logo + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[different-retina-logo]', + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'section' => $_section, + 'title' => __( 'Different Logo For Retina Devices?', 'astra' ), + 'default' => astra_get_option( 'different-retina-logo' ), + 'priority' => 5, + 'transport' => 'postMessage', + 'divider' => array( 'ast_class' => 'ast-top-divider' ), + 'context' => array( + array( + 'setting' => 'custom_logo', + 'operator' => '!=', + 'value' => '', + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'partial' => array( + 'selector' => '.site-branding', + 'container_inclusive' => false, + 'render_callback' => 'Astra_Builder_Header::site_identity', + ), + ), + + /** + * Option: Retina logo selector + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[ast-header-retina-logo]', + 'default' => astra_get_option( 'ast-header-retina-logo' ), + 'type' => 'control', + 'control' => 'image', + 'sanitize_callback' => 'esc_url_raw', + 'section' => 'title_tagline', + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[different-retina-logo]', + 'operator' => '!=', + 'value' => 0, + ), + Astra_Builder_Helper::$general_tab_config, + ), + 'priority' => 6, + 'title' => __( 'Retina Logo', 'astra' ), + 'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ), + 'transport' => 'postMessage', + 'partial' => array( + 'selector' => '.site-branding', + 'container_inclusive' => false, + 'render_callback' => 'Astra_Builder_Header::site_identity', + ), + ), + + /** + * Option: Inherit Desktop logo + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[different-mobile-logo]', + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'default' => astra_get_option( 'different-mobile-logo' ), + 'section' => 'title_tagline', + 'title' => __( 'Different Logo For Mobile Devices?', 'astra' ), + 'priority' => 5, + 'context' => array( + array( + 'setting' => 'custom_logo', + 'operator' => '!=', + 'value' => '', + ), + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => 'ast_selected_device', + 'operator' => 'in', + 'value' => array( 'tablet', 'mobile' ), + ), + ), + 'transport' => 'postMessage', + 'partial' => array( + 'selector' => '.site-branding', + 'container_inclusive' => false, + 'render_callback' => 'Astra_Builder_Header::site_identity', + ), + ), + + /** + * Option: Mobile header logo + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[mobile-header-logo]', + 'default' => astra_get_option( 'mobile-header-logo' ), + 'type' => 'control', + 'control' => 'image', + 'sanitize_callback' => 'esc_url_raw', + 'section' => 'title_tagline', + 'priority' => 5.5, + 'title' => __( 'Mobile Logo (optional)', 'astra' ), + 'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'context' => array( + array( + 'setting' => ASTRA_THEME_SETTINGS . '[different-mobile-logo]', + 'operator' => '==', + 'value' => '1', + ), + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => 'ast_selected_device', + 'operator' => 'in', + 'value' => array( 'tablet', 'mobile' ), + ), + ), + ), + + /** + * Option: Logo Width + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[ast-header-responsive-logo-width]', + 'type' => 'control', + 'control' => 'ast-responsive-slider', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), + 'section' => $_section, + 'transport' => 'postMessage', + 'default' => astra_get_option( 'ast-header-responsive-logo-width' ), + 'priority' => 7, + 'title' => __( 'Logo Width', 'astra' ), + 'suffix' => 'px', + 'input_attrs' => array( + 'min' => 0, + 'step' => 1, + 'max' => 600, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), + ), + + /** + * Option: Display Title + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', + 'type' => 'control', + 'control' => 'ast-responsive-toggle-control', + 'default' => astra_get_option( 'display-site-title-responsive' ), + 'section' => 'title_tagline', + 'title' => __( 'Display Site Title', 'astra' ), + 'priority' => 7, + 'transport' => 'postMessage', + 'partial' => array( + 'selector' => '.site-branding', + 'container_inclusive' => false, + 'render_callback' => 'Astra_Builder_Header::site_identity', + ), + ), + + /** + * Option: Divider + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[ast-site-title-tagline-divider]', + 'type' => 'control', + 'section' => $_section, + 'control' => 'ast-divider', + 'priority' => 13, + 'settings' => array(), + 'context' => array( Astra_Builder_Helper::$general_tab_config ), + ), + + /** + * Option: Display Tagline + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', + 'type' => 'control', + 'control' => 'ast-responsive-toggle-control', + 'default' => astra_get_option( 'display-site-tagline-responsive' ), + 'section' => 'title_tagline', + 'priority' => 11, + 'title' => __( 'Display Site Tagline', 'astra' ), + 'transport' => 'postMessage', + 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ), + 'partial' => array( + + 'selector' => '.site-branding', + 'container_inclusive' => false, + 'render_callback' => 'Astra_Builder_Header::site_identity', + ), + ), + + /** + * Option: Logo inline title. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[logo-title-inline]', + 'default' => astra_get_option( 'logo-title-inline' ), + 'type' => 'control', + 'context' => array( Astra_Builder_Helper::$general_tab_config ), + 'control' => 'ast-toggle-control', + 'divider' => array( 'ast_class' => 'ast-top-divider' ), + 'section' => $_section, + 'title' => __( 'Inline Logo & Site Title', 'astra' ), + 'priority' => 8, + 'transport' => 'postMessage', + 'partial' => array( + 'selector' => '.site-branding', + 'container_inclusive' => false, + 'render_callback' => 'Astra_Builder_Header::site_identity', + ), + ), + ); + + /** + * We adding this control only to maintain backwards. Remove this condition after 2-3 updates of add-on. + * Moving Site Title color & Tagline color option into theme. + * + * @since 3.5.0 + */ + $load_site_tagline_color_controls = true; + if ( is_astra_addon_3_5_0_version() ) { + $load_site_tagline_color_controls = false; + } + + if ( $load_site_tagline_color_controls ) { + $_configs = array_merge( + $_configs, + array( + // Color Group control for site title colors. + array( + 'name' => ASTRA_THEME_SETTINGS . '[site-identity-title-color-group]', + 'default' => astra_get_option( 'site-identity-title-color-group' ), + 'type' => 'control', + 'control' => 'ast-color-group', + 'title' => Astra_Builder_Helper::$is_header_footer_builder_active ? __( 'Title Color', 'astra' ) : __( 'Colors', 'astra' ), + 'section' => $_section, + 'responsive' => false, + 'transport' => 'postMessage', + 'priority' => 8, + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '', + ), + + // Option: Site Title Color. + array( + 'name' => 'header-color-site-title', + 'parent' => ASTRA_THEME_SETTINGS . '[site-identity-title-color-group]', + 'section' => 'title_tagline', + 'type' => 'sub-control', + 'control' => 'ast-color', + 'priority' => 5, + 'default' => astra_get_option( 'header-color-site-title' ), + 'transport' => 'postMessage', + 'title' => __( 'Normal', 'astra' ), + 'context' => Astra_Builder_Helper::$design_tab, + ), + + // Option: Site Title Hover Color. + array( + 'name' => 'header-color-h-site-title', + 'parent' => ASTRA_THEME_SETTINGS . '[site-identity-title-color-group]', + 'section' => 'title_tagline', + 'type' => 'sub-control', + 'control' => 'ast-color', + 'priority' => 10, + 'transport' => 'postMessage', + 'default' => astra_get_option( 'header-color-h-site-title' ), + 'title' => __( 'Hover', 'astra' ), + 'context' => Astra_Builder_Helper::$design_tab, + ), + + // Option: Site Tagline Color. + array( + 'name' => ASTRA_THEME_SETTINGS . '[header-color-site-tagline]', + 'type' => 'control', + 'control' => 'ast-color', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'header-color-site-tagline' ), + 'title' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? __( 'Tagline', 'astra' ) : __( 'Color', 'astra' ), + 'section' => 'title_tagline', + 'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 8 : 12, + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '', + ), + ) + ); + } + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + $_configs = array_merge( + $_configs, + array( + /** + * Notice - Transparent meta header enabled on page. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-meta-enabled]', + 'type' => 'control', + 'control' => 'ast-description', + 'section' => 'section-header-builder-layout', + 'priority' => 1, + 'active_callback' => array( $this, 'is_transparent_header_enabled' ), + 'help' => $this->get_help_text_notice( 'transparent-meta' ), + ), + + /** + * Notice Link - Transparent meta header enabled on page. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-header-meta-link]', + 'type' => 'control', + 'control' => 'ast-customizer-link', + 'section' => 'section-header-builder-layout', + 'priority' => 1, + 'link_type' => 'section', + 'linked' => 'section-transparent-header', + 'link_text' => '' . __( 'Customize Transparent Header.', 'astra' ) . '', + 'active_callback' => array( $this, 'is_transparent_header_enabled' ), + ), + ) + ); + } + + if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) { + + $new_configs = array( + + /** + * Option: Header Site Title. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[site-title-typography]', + 'default' => astra_get_option( 'site-title-typography' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? __( 'Title Font', 'astra' ) : __( 'Typography', 'astra' ), + 'section' => $_section, + 'transport' => 'postMessage', + 'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 16 : 8, + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '', + ), + + /** + * Options: Site Tagline. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[site-tagline-typography]', + 'default' => astra_get_option( 'site-tagline-typography' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? __( 'Tagline Font', 'astra' ) : __( 'Typography', 'astra' ), + 'section' => $_section, + 'transport' => 'postMessage', + 'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 20 : 11, + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '', + ), + ); + + $_configs = array_merge( $_configs, $new_configs ); + } + + $configurations = array_merge( $configurations, $_configs ); + return $configurations; + + } + + /** + * Check if transparent header is enabled on the page being previewed. + * + * @since 2.4.5 + * @return boolean True - If Transparent Header is enabled, False if not. + */ + public function is_transparent_header_enabled() { + $status = Astra_Ext_Transparent_Header_Markup::is_transparent_header(); + return ( true === $status ? true : false ); + } + + /** + * Help notice message to be displayed when the page that is being previewed has Logo set from Transparent Header. + * + * @since 2.4.5 + * @param String $context Type of notice message to be returned. + * @return String HTML Markup for the help notice. + */ + private function get_help_text_notice( $context ) { + + switch ( $context ) { + case 'transparent-header': + $notice = '

    The Logo on this page is set from the Transparent Header Section. Please click the link below to customize Transparent Header Logo.

    '; + break; + case 'transparent-meta': + $notice = '

    The header on this page is set from the Transparent Header.

    Please click the link below to customize Transparent Header

    '; + break; + default: + $notice = ''; + } + return $notice; + } + } +} + + +new Astra_Site_Identity_Configs(); diff --git a/inc/customizer/configurations/layout/class-astra-site-layout-configs.php b/inc/customizer/configurations/layout/class-astra-site-layout-configs.php index caf3e85..e8af125 100644 --- a/inc/customizer/configurations/layout/class-astra-site-layout-configs.php +++ b/inc/customizer/configurations/layout/class-astra-site-layout-configs.php @@ -1,69 +1,69 @@ - ASTRA_THEME_SETTINGS . '[site-content-width]', - 'type' => 'control', - 'control' => 'ast-slider', - 'default' => astra_get_option( 'site-content-width' ), - 'section' => 'section-container-layout', - 'priority' => 10, - 'title' => __( 'Container Width', 'astra' ), - 'context' => ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'site-layouts' ) ) ? array( - Astra_Builder_Helper::$general_tab_config, - array( - 'setting' => ASTRA_THEME_SETTINGS . '[site-layout]', - 'operator' => '==', - 'value' => 'ast-full-width-layout', - ), - ) : array(), - 'suffix' => 'px', - 'input_attrs' => array( - 'min' => 768, - 'step' => 1, - 'max' => 1920, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - ); - - return array_merge( $configurations, $_configs ); - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -new Astra_Site_Layout_Configs(); + ASTRA_THEME_SETTINGS . '[site-content-width]', + 'type' => 'control', + 'control' => 'ast-slider', + 'default' => astra_get_option( 'site-content-width' ), + 'section' => 'section-container-layout', + 'priority' => 10, + 'title' => __( 'Container Width', 'astra' ), + 'context' => ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'site-layouts' ) ) ? array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[site-layout]', + 'operator' => '==', + 'value' => 'ast-full-width-layout', + ), + ) : array(), + 'suffix' => 'px', + 'input_attrs' => array( + 'min' => 768, + 'step' => 1, + 'max' => 1920, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + ); + + return array_merge( $configurations, $_configs ); + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +new Astra_Site_Layout_Configs(); diff --git a/inc/customizer/configurations/typography/class-astra-archive-typo-configs.php b/inc/customizer/configurations/typography/class-astra-archive-typo-configs.php index 746ccd3..71ee4d6 100644 --- a/inc/customizer/configurations/typography/class-astra-archive-typo-configs.php +++ b/inc/customizer/configurations/typography/class-astra-archive-typo-configs.php @@ -1,197 +1,197 @@ - ASTRA_THEME_SETTINGS . '[ast-blog-typography-more-feature-description]', - 'type' => 'control', - 'control' => 'ast-description', - 'section' => 'section-blog', - 'priority' => 999, - 'title' => '', - 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', - 'settings' => array(), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - ); - } - - if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) { - - $new_configs = array( - - /** - * Option: Blog / Archive Typography - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[blog-content-archive-summary-typo]', - 'default' => astra_get_option( 'blog-content-archive-summary-typo' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Archive Title Font', 'astra' ), - 'section' => 'section-blog', - 'transport' => 'postMessage', - 'priority' => 140, - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? - Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - ), - - /** - * Option: Archive Summary Box Title Font Size - */ - array( - 'name' => 'font-size-archive-summary-title', - 'parent' => ASTRA_THEME_SETTINGS . '[blog-content-archive-summary-typo]', - 'section' => 'section-blog', - 'type' => 'sub-control', - 'control' => 'ast-responsive', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'font-size-archive-summary-title' ), - 'priority' => 8, - 'title' => __( 'Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - - array( - 'name' => ASTRA_THEME_SETTINGS . '[blog-content-blog-post-title-typo]', - 'default' => astra_get_option( 'blog-content-blog-post-title-typo' ), - 'type' => 'control', - 'control' => 'ast-settings-group', - 'title' => __( 'Post Title Font', 'astra' ), - 'section' => 'section-blog', - 'transport' => 'postMessage', - 'priority' => 140, - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? - Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - ), - - /** - * Option: Blog - Post Title Font Size - */ - array( - 'name' => 'font-size-page-title', - 'parent' => ASTRA_THEME_SETTINGS . '[blog-content-blog-post-title-typo]', - 'section' => 'section-blog', - 'type' => 'sub-control', - 'control' => 'ast-responsive', - 'transport' => 'postMessage', - 'priority' => 2, - 'default' => astra_get_option( 'font-size-page-title' ), - 'title' => __( 'Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - ); - } else { - - $new_configs = array( - - /** - * Option: Archive Summary Box Title Font Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-archive-summary-title]', - 'section' => 'section-blog', - 'type' => 'control', - 'control' => 'ast-responsive', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'font-size-archive-summary-title' ), - 'title' => __( 'Archive Title Font Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - 'priority' => 140, - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? - Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - ), - - /** - * Option: Blog - Post Title Font Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-page-title]', - 'section' => 'section-blog', - 'type' => 'control', - 'control' => 'ast-responsive', - 'transport' => 'postMessage', - 'default' => astra_get_option( 'font-size-page-title' ), - 'title' => __( 'Post Title Font Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - 'priority' => 140, - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? - Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - ), - ); - } - - $_configs = array_merge( $_configs, $new_configs ); - - $configurations = array_merge( $configurations, $_configs ); - - return $configurations; - } - } -} - -new Astra_Archive_Typo_Configs(); + ASTRA_THEME_SETTINGS . '[ast-blog-typography-more-feature-description]', + 'type' => 'control', + 'control' => 'ast-description', + 'section' => 'section-blog', + 'priority' => 999, + 'title' => '', + 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', + 'settings' => array(), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + ); + } + + if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) { + + $new_configs = array( + + /** + * Option: Blog / Archive Typography + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[blog-content-archive-summary-typo]', + 'default' => astra_get_option( 'blog-content-archive-summary-typo' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Archive Title Font', 'astra' ), + 'section' => 'section-blog', + 'transport' => 'postMessage', + 'priority' => 140, + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? + Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + ), + + /** + * Option: Archive Summary Box Title Font Size + */ + array( + 'name' => 'font-size-archive-summary-title', + 'parent' => ASTRA_THEME_SETTINGS . '[blog-content-archive-summary-typo]', + 'section' => 'section-blog', + 'type' => 'sub-control', + 'control' => 'ast-responsive', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'font-size-archive-summary-title' ), + 'priority' => 8, + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + array( + 'name' => ASTRA_THEME_SETTINGS . '[blog-content-blog-post-title-typo]', + 'default' => astra_get_option( 'blog-content-blog-post-title-typo' ), + 'type' => 'control', + 'control' => 'ast-settings-group', + 'title' => __( 'Post Title Font', 'astra' ), + 'section' => 'section-blog', + 'transport' => 'postMessage', + 'priority' => 140, + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? + Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + ), + + /** + * Option: Blog - Post Title Font Size + */ + array( + 'name' => 'font-size-page-title', + 'parent' => ASTRA_THEME_SETTINGS . '[blog-content-blog-post-title-typo]', + 'section' => 'section-blog', + 'type' => 'sub-control', + 'control' => 'ast-responsive', + 'transport' => 'postMessage', + 'priority' => 2, + 'default' => astra_get_option( 'font-size-page-title' ), + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + ); + } else { + + $new_configs = array( + + /** + * Option: Archive Summary Box Title Font Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-archive-summary-title]', + 'section' => 'section-blog', + 'type' => 'control', + 'control' => 'ast-responsive', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'font-size-archive-summary-title' ), + 'title' => __( 'Archive Title Font Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + 'priority' => 140, + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? + Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + ), + + /** + * Option: Blog - Post Title Font Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-page-title]', + 'section' => 'section-blog', + 'type' => 'control', + 'control' => 'ast-responsive', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'font-size-page-title' ), + 'title' => __( 'Post Title Font Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + 'priority' => 140, + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? + Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + ), + ); + } + + $_configs = array_merge( $_configs, $new_configs ); + + $configurations = array_merge( $configurations, $_configs ); + + return $configurations; + } + } +} + +new Astra_Archive_Typo_Configs(); diff --git a/inc/customizer/configurations/typography/class-astra-body-typo-configs.php b/inc/customizer/configurations/typography/class-astra-body-typo-configs.php index 400af19..21276a1 100644 --- a/inc/customizer/configurations/typography/class-astra-body-typo-configs.php +++ b/inc/customizer/configurations/typography/class-astra-body-typo-configs.php @@ -1,277 +1,277 @@ - ASTRA_THEME_SETTINGS . '[body-font-family]', - 'type' => 'control', - 'control' => 'ast-font', - 'font-type' => 'ast-font-family', - 'ast_inherit' => __( 'Default System Font', 'astra' ), - 'default' => astra_get_option( 'body-font-family' ), - 'section' => 'section-body-typo', - 'priority' => 5, - 'title' => __( 'Body Font Family', 'astra' ), - 'connect' => ASTRA_THEME_SETTINGS . '[body-font-weight]', - 'variant' => ASTRA_THEME_SETTINGS . '[body-font-variant]', - ), - - /** - * Option: Font Variant - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[body-font-variant]', - 'type' => 'control', - 'control' => 'ast-font-variant', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_variant' ), - 'default' => astra_get_option( 'body-font-variant' ), - 'ast_inherit' => __( 'Default', 'astra' ), - 'section' => 'section-body-typo', - 'priority' => 6, - 'title' => __( 'Variants', 'astra' ), - 'variant' => ASTRA_THEME_SETTINGS . '[body-font-family]', - ), - - /** - * Option: Font Weight - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[body-font-weight]', - 'type' => 'control', - 'control' => 'ast-font', - 'font-type' => 'ast-font-weight', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), - 'default' => astra_get_option( 'body-font-weight' ), - 'ast_inherit' => __( 'Default', 'astra' ), - 'section' => 'section-body-typo', - 'priority' => 15, - 'title' => __( 'Weight', 'astra' ), - 'connect' => ASTRA_THEME_SETTINGS . '[body-font-family]', - ), - - /** - * Option: Body Text Transform - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[body-text-transform]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-body-typo', - 'default' => astra_get_option( 'body-text-transform' ), - 'priority' => 20, - 'title' => __( 'Text Transform', 'astra' ), - 'choices' => array( - '' => __( 'Default', 'astra' ), - 'none' => __( 'None', 'astra' ), - 'capitalize' => __( 'Capitalize', 'astra' ), - 'uppercase' => __( 'Uppercase', 'astra' ), - 'lowercase' => __( 'Lowercase', 'astra' ), - ), - ), - - /** - * Option: Body Font Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-body]', - 'type' => 'control', - 'control' => 'ast-responsive-slider', - 'section' => 'section-body-typo', - 'default' => astra_get_option( 'font-size-body' ), - 'priority' => 10, - 'title' => __( 'Size', 'astra' ), - 'suffix' => 'px', - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - ), - ), - - /** - * Option: Body Line Height - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[body-line-height]', - 'type' => 'control', - 'control' => 'ast-slider', - 'section' => 'section-body-typo', - 'default' => astra_get_option( 'body-line-height' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'priority' => 25, - 'title' => __( 'Line Height', 'astra' ), - 'suffix' => 'em', - 'input_attrs' => array( - 'min' => 1, - 'step' => 0.01, - 'max' => 5, - ), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - /** - * Option: Paragraph Margin Bottom - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[para-margin-bottom]', - 'type' => 'control', - 'control' => 'ast-slider', - 'default' => astra_get_option( 'para-margin-bottom' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'transport' => 'postMessage', - 'section' => 'section-body-typo', - 'priority' => 25, - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - 'title' => __( 'Paragraph Margin Bottom', 'astra' ), - 'suffix' => 'em', - 'input_attrs' => array( - 'min' => 0.5, - 'step' => 0.01, - 'max' => 5, - ), - ), - - /** - * Option: Underline links in entry-content. - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[underline-content-links]', - 'default' => astra_get_option( 'underline-content-links' ), - 'type' => 'control', - 'control' => 'ast-toggle-control', - 'section' => 'section-body-typo', - 'priority' => 27, - 'title' => __( 'Underline Content Links', 'astra' ), - 'transport' => 'postMessage', - ), - - /** - * Option: Headings Font Family - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[headings-font-family]', - 'type' => 'control', - 'control' => 'ast-font', - 'font-type' => 'ast-font-family', - 'default' => astra_get_option( 'headings-font-family' ), - 'title' => __( 'Heading Font Family', 'astra' ), - 'section' => 'section-content-typo', - 'priority' => 3, - 'connect' => ASTRA_THEME_SETTINGS . '[headings-font-weight]', - 'variant' => ASTRA_THEME_SETTINGS . '[headings-font-variant]', - ), - - /** - * Option: Font Variant - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[headings-font-variant]', - 'type' => 'control', - 'control' => 'ast-font-variant', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_variant' ), - 'default' => astra_get_option( 'headings-font-variant' ), - 'ast_inherit' => __( 'Default', 'astra' ), - 'section' => 'section-content-typo', - 'priority' => 3, - 'title' => __( 'Variants', 'astra' ), - 'variant' => ASTRA_THEME_SETTINGS . '[headings-font-family]', - ), - - /** - * Option: Headings Font Weight - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[headings-font-weight]', - 'type' => 'control', - 'control' => 'ast-font', - 'font-type' => 'ast-font-weight', - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), - 'default' => astra_get_option( 'headings-font-weight' ), - 'title' => __( 'Weight', 'astra' ), - 'section' => 'section-content-typo', - 'priority' => 3, - 'connect' => ASTRA_THEME_SETTINGS . '[headings-font-family]', - ), - - /** - * Option: Headings Text Transform - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[headings-text-transform]', - 'type' => 'control', - 'control' => 'ast-select', - 'section' => 'section-content-typo', - 'title' => __( 'Text Transform', 'astra' ), - 'default' => astra_get_option( 'headings-text-transform' ), - 'priority' => 3, - 'choices' => array( - '' => __( 'Inherit', 'astra' ), - 'none' => __( 'None', 'astra' ), - 'capitalize' => __( 'Capitalize', 'astra' ), - 'uppercase' => __( 'Uppercase', 'astra' ), - 'lowercase' => __( 'Lowercase', 'astra' ), - ), - ), - - /** - * Option: Heading

    Line Height - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[headings-line-height]', - 'section' => 'section-content-typo', - 'default' => astra_get_option( 'headings-line-height' ), - 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), - 'type' => 'control', - 'control' => 'ast-slider', - 'title' => __( 'Line Height', 'astra' ), - 'transport' => 'postMessage', - 'priority' => 4, - 'suffix' => 'em', - 'input_attrs' => array( - 'min' => 1, - 'step' => 0.01, - 'max' => 5, - ), - ), - ); - - return array_merge( $configurations, $_configs ); - } - } -} - -new Astra_Body_Typo_Configs(); + ASTRA_THEME_SETTINGS . '[body-font-family]', + 'type' => 'control', + 'control' => 'ast-font', + 'font-type' => 'ast-font-family', + 'ast_inherit' => __( 'Default System Font', 'astra' ), + 'default' => astra_get_option( 'body-font-family' ), + 'section' => 'section-body-typo', + 'priority' => 5, + 'title' => __( 'Body Font Family', 'astra' ), + 'connect' => ASTRA_THEME_SETTINGS . '[body-font-weight]', + 'variant' => ASTRA_THEME_SETTINGS . '[body-font-variant]', + ), + + /** + * Option: Font Variant + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[body-font-variant]', + 'type' => 'control', + 'control' => 'ast-font-variant', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_variant' ), + 'default' => astra_get_option( 'body-font-variant' ), + 'ast_inherit' => __( 'Default', 'astra' ), + 'section' => 'section-body-typo', + 'priority' => 6, + 'title' => __( 'Variants', 'astra' ), + 'variant' => ASTRA_THEME_SETTINGS . '[body-font-family]', + ), + + /** + * Option: Font Weight + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[body-font-weight]', + 'type' => 'control', + 'control' => 'ast-font', + 'font-type' => 'ast-font-weight', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), + 'default' => astra_get_option( 'body-font-weight' ), + 'ast_inherit' => __( 'Default', 'astra' ), + 'section' => 'section-body-typo', + 'priority' => 15, + 'title' => __( 'Weight', 'astra' ), + 'connect' => ASTRA_THEME_SETTINGS . '[body-font-family]', + ), + + /** + * Option: Body Text Transform + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[body-text-transform]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-body-typo', + 'default' => astra_get_option( 'body-text-transform' ), + 'priority' => 20, + 'title' => __( 'Text Transform', 'astra' ), + 'choices' => array( + '' => __( 'Default', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + ), + + /** + * Option: Body Font Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-body]', + 'type' => 'control', + 'control' => 'ast-responsive-slider', + 'section' => 'section-body-typo', + 'default' => astra_get_option( 'font-size-body' ), + 'priority' => 10, + 'title' => __( 'Size', 'astra' ), + 'suffix' => 'px', + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + ), + ), + + /** + * Option: Body Line Height + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[body-line-height]', + 'type' => 'control', + 'control' => 'ast-slider', + 'section' => 'section-body-typo', + 'default' => astra_get_option( 'body-line-height' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'priority' => 25, + 'title' => __( 'Line Height', 'astra' ), + 'suffix' => 'em', + 'input_attrs' => array( + 'min' => 1, + 'step' => 0.01, + 'max' => 5, + ), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + /** + * Option: Paragraph Margin Bottom + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[para-margin-bottom]', + 'type' => 'control', + 'control' => 'ast-slider', + 'default' => astra_get_option( 'para-margin-bottom' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'transport' => 'postMessage', + 'section' => 'section-body-typo', + 'priority' => 25, + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + 'title' => __( 'Paragraph Margin Bottom', 'astra' ), + 'suffix' => 'em', + 'input_attrs' => array( + 'min' => 0.5, + 'step' => 0.01, + 'max' => 5, + ), + ), + + /** + * Option: Underline links in entry-content. + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[underline-content-links]', + 'default' => astra_get_option( 'underline-content-links' ), + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'section' => 'section-body-typo', + 'priority' => 27, + 'title' => __( 'Underline Content Links', 'astra' ), + 'transport' => 'postMessage', + ), + + /** + * Option: Headings Font Family + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[headings-font-family]', + 'type' => 'control', + 'control' => 'ast-font', + 'font-type' => 'ast-font-family', + 'default' => astra_get_option( 'headings-font-family' ), + 'title' => __( 'Heading Font Family', 'astra' ), + 'section' => 'section-content-typo', + 'priority' => 3, + 'connect' => ASTRA_THEME_SETTINGS . '[headings-font-weight]', + 'variant' => ASTRA_THEME_SETTINGS . '[headings-font-variant]', + ), + + /** + * Option: Font Variant + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[headings-font-variant]', + 'type' => 'control', + 'control' => 'ast-font-variant', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_variant' ), + 'default' => astra_get_option( 'headings-font-variant' ), + 'ast_inherit' => __( 'Default', 'astra' ), + 'section' => 'section-content-typo', + 'priority' => 3, + 'title' => __( 'Variants', 'astra' ), + 'variant' => ASTRA_THEME_SETTINGS . '[headings-font-family]', + ), + + /** + * Option: Headings Font Weight + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[headings-font-weight]', + 'type' => 'control', + 'control' => 'ast-font', + 'font-type' => 'ast-font-weight', + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), + 'default' => astra_get_option( 'headings-font-weight' ), + 'title' => __( 'Weight', 'astra' ), + 'section' => 'section-content-typo', + 'priority' => 3, + 'connect' => ASTRA_THEME_SETTINGS . '[headings-font-family]', + ), + + /** + * Option: Headings Text Transform + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[headings-text-transform]', + 'type' => 'control', + 'control' => 'ast-select', + 'section' => 'section-content-typo', + 'title' => __( 'Text Transform', 'astra' ), + 'default' => astra_get_option( 'headings-text-transform' ), + 'priority' => 3, + 'choices' => array( + '' => __( 'Inherit', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + ), + + /** + * Option: Heading

    Line Height + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[headings-line-height]', + 'section' => 'section-content-typo', + 'default' => astra_get_option( 'headings-line-height' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'type' => 'control', + 'control' => 'ast-slider', + 'title' => __( 'Line Height', 'astra' ), + 'transport' => 'postMessage', + 'priority' => 4, + 'suffix' => 'em', + 'input_attrs' => array( + 'min' => 1, + 'step' => 0.01, + 'max' => 5, + ), + ), + ); + + return array_merge( $configurations, $_configs ); + } + } +} + +new Astra_Body_Typo_Configs(); diff --git a/inc/customizer/configurations/typography/class-astra-content-typo-configs.php b/inc/customizer/configurations/typography/class-astra-content-typo-configs.php index e6a99d2..777d9a0 100644 --- a/inc/customizer/configurations/typography/class-astra-content-typo-configs.php +++ b/inc/customizer/configurations/typography/class-astra-content-typo-configs.php @@ -1,272 +1,272 @@ - ASTRA_THEME_SETTINGS . '[divider-section-h1]', - 'type' => 'control', - 'control' => 'ast-heading', - 'section' => 'section-content-typo', - 'priority' => 4, - 'title' => __( 'Heading 1', 'astra' ), - 'settings' => array(), - ), - - /** - * Option: Heading 1 (H1) Font Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-h1]', - 'type' => 'control', - 'control' => 'ast-responsive', - 'section' => 'section-content-typo', - 'default' => astra_get_option( 'font-size-h1' ), - 'transport' => 'postMessage', - 'priority' => 6, - 'title' => __( 'Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - - /** - * Option: Heading 2 (H2) Divider - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[divider-section-h2]', - 'type' => 'control', - 'control' => 'ast-heading', - 'section' => 'section-content-typo', - 'priority' => 9, - 'title' => __( 'Heading 2', 'astra' ), - 'settings' => array(), - ), - - /** - * Option: Heading 2 (H2) Font Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-h2]', - 'type' => 'control', - 'control' => 'ast-responsive', - 'section' => 'section-content-typo', - 'default' => astra_get_option( 'font-size-h2' ), - 'transport' => 'postMessage', - 'priority' => 11, - 'title' => __( 'Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - - /** - * Option: Heading 3 (H3) Divider - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[divider-section-h3]', - 'type' => 'control', - 'control' => 'ast-heading', - 'section' => 'section-content-typo', - 'priority' => 15, - 'title' => __( 'Heading 3', 'astra' ), - 'settings' => array(), - ), - - /** - * Option: Heading 3 (H3) Font Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-h3]', - 'type' => 'control', - 'control' => 'ast-responsive', - 'section' => 'section-content-typo', - 'priority' => 16, - 'default' => astra_get_option( 'font-size-h3' ), - 'transport' => 'postMessage', - 'title' => __( 'Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - - /** - * Option: Heading 4 (H4) Divider - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[divider-section-h4]', - 'type' => 'control', - 'title' => __( 'Heading 4', 'astra' ), - 'section' => 'section-content-typo', - 'control' => 'ast-heading', - 'priority' => 20, - 'settings' => array(), - ), - - /** - * Option: Heading 4 (H4) Font Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-h4]', - 'type' => 'control', - 'control' => 'ast-responsive', - 'section' => 'section-content-typo', - 'default' => astra_get_option( 'font-size-h4' ), - 'transport' => 'postMessage', - 'priority' => 21, - 'title' => __( 'Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - - /** - * Option: Heading 5 (H5) Divider - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[divider-section-h5]', - 'type' => 'control', - 'control' => 'ast-heading', - 'section' => 'section-content-typo', - 'priority' => 25, - 'title' => __( 'Heading 5', 'astra' ), - 'settings' => array(), - ), - - /** - * Option: Heading 5 (H5) Font Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-h5]', - 'type' => 'control', - 'control' => 'ast-responsive', - 'section' => 'section-content-typo', - 'default' => astra_get_option( 'font-size-h5' ), - 'transport' => 'postMessage', - 'priority' => 26, - 'title' => __( 'Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - - /** - * Option: Heading 6 (H6) Divider - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[divider-section-h6]', - 'type' => 'control', - 'control' => 'ast-heading', - 'title' => __( 'Heading 6', 'astra' ), - 'section' => 'section-content-typo', - 'priority' => 30, - 'settings' => array(), - ), - - /** - * Option: Heading 6 (H6) Font Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-h6]', - 'type' => 'control', - 'control' => 'ast-responsive', - 'section' => 'section-content-typo', - 'default' => astra_get_option( 'font-size-h6' ), - 'transport' => 'postMessage', - 'priority' => 31, - 'title' => __( 'Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - ); - - $configurations = array_merge( $configurations, $_configs ); - - // Learn More link if Astra Pro is not activated. - if ( ! defined( 'ASTRA_EXT_VER' ) ) { - - $_configs = array( - /** - * Option: Learn More about Contant Typography - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[ast-content-typography-more-feature-description]', - 'type' => 'control', - 'control' => 'ast-description', - 'section' => 'section-content-typo', - 'priority' => 999, - 'title' => '', - 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', - 'settings' => array(), - ), - ); - - $configurations = array_merge( $configurations, $_configs ); - - } - - return $configurations; - } - } -} - -new Astra_Content_Typo_Configs(); - - + ASTRA_THEME_SETTINGS . '[divider-section-h1]', + 'type' => 'control', + 'control' => 'ast-heading', + 'section' => 'section-content-typo', + 'priority' => 4, + 'title' => __( 'Heading 1', 'astra' ), + 'settings' => array(), + ), + + /** + * Option: Heading 1 (H1) Font Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-h1]', + 'type' => 'control', + 'control' => 'ast-responsive', + 'section' => 'section-content-typo', + 'default' => astra_get_option( 'font-size-h1' ), + 'transport' => 'postMessage', + 'priority' => 6, + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Heading 2 (H2) Divider + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[divider-section-h2]', + 'type' => 'control', + 'control' => 'ast-heading', + 'section' => 'section-content-typo', + 'priority' => 9, + 'title' => __( 'Heading 2', 'astra' ), + 'settings' => array(), + ), + + /** + * Option: Heading 2 (H2) Font Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-h2]', + 'type' => 'control', + 'control' => 'ast-responsive', + 'section' => 'section-content-typo', + 'default' => astra_get_option( 'font-size-h2' ), + 'transport' => 'postMessage', + 'priority' => 11, + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Heading 3 (H3) Divider + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[divider-section-h3]', + 'type' => 'control', + 'control' => 'ast-heading', + 'section' => 'section-content-typo', + 'priority' => 15, + 'title' => __( 'Heading 3', 'astra' ), + 'settings' => array(), + ), + + /** + * Option: Heading 3 (H3) Font Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-h3]', + 'type' => 'control', + 'control' => 'ast-responsive', + 'section' => 'section-content-typo', + 'priority' => 16, + 'default' => astra_get_option( 'font-size-h3' ), + 'transport' => 'postMessage', + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Heading 4 (H4) Divider + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[divider-section-h4]', + 'type' => 'control', + 'title' => __( 'Heading 4', 'astra' ), + 'section' => 'section-content-typo', + 'control' => 'ast-heading', + 'priority' => 20, + 'settings' => array(), + ), + + /** + * Option: Heading 4 (H4) Font Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-h4]', + 'type' => 'control', + 'control' => 'ast-responsive', + 'section' => 'section-content-typo', + 'default' => astra_get_option( 'font-size-h4' ), + 'transport' => 'postMessage', + 'priority' => 21, + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Heading 5 (H5) Divider + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[divider-section-h5]', + 'type' => 'control', + 'control' => 'ast-heading', + 'section' => 'section-content-typo', + 'priority' => 25, + 'title' => __( 'Heading 5', 'astra' ), + 'settings' => array(), + ), + + /** + * Option: Heading 5 (H5) Font Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-h5]', + 'type' => 'control', + 'control' => 'ast-responsive', + 'section' => 'section-content-typo', + 'default' => astra_get_option( 'font-size-h5' ), + 'transport' => 'postMessage', + 'priority' => 26, + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Heading 6 (H6) Divider + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[divider-section-h6]', + 'type' => 'control', + 'control' => 'ast-heading', + 'title' => __( 'Heading 6', 'astra' ), + 'section' => 'section-content-typo', + 'priority' => 30, + 'settings' => array(), + ), + + /** + * Option: Heading 6 (H6) Font Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-h6]', + 'type' => 'control', + 'control' => 'ast-responsive', + 'section' => 'section-content-typo', + 'default' => astra_get_option( 'font-size-h6' ), + 'transport' => 'postMessage', + 'priority' => 31, + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + ); + + $configurations = array_merge( $configurations, $_configs ); + + // Learn More link if Astra Pro is not activated. + if ( ! defined( 'ASTRA_EXT_VER' ) ) { + + $_configs = array( + /** + * Option: Learn More about Contant Typography + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[ast-content-typography-more-feature-description]', + 'type' => 'control', + 'control' => 'ast-description', + 'section' => 'section-content-typo', + 'priority' => 999, + 'title' => '', + 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', + 'settings' => array(), + ), + ); + + $configurations = array_merge( $configurations, $_configs ); + + } + + return $configurations; + } + } +} + +new Astra_Content_Typo_Configs(); + + diff --git a/inc/customizer/configurations/typography/class-astra-header-typo-configs.php b/inc/customizer/configurations/typography/class-astra-header-typo-configs.php index 6bff400..f1d0d64 100644 --- a/inc/customizer/configurations/typography/class-astra-header-typo-configs.php +++ b/inc/customizer/configurations/typography/class-astra-header-typo-configs.php @@ -1,230 +1,230 @@ - 'font-size-site-title', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[site-title-typography]', - 'section' => 'title_tagline', - 'control' => 'ast-responsive', - 'default' => astra_get_option( 'font-size-site-title' ), - 'transport' => 'postMessage', - 'priority' => 9, - 'title' => __( 'Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - - /** - * Option: Site Tagline Font Size - */ - array( - 'name' => 'font-size-site-tagline', - 'type' => 'sub-control', - 'parent' => ASTRA_THEME_SETTINGS . '[site-tagline-typography]', - 'section' => 'title_tagline', - 'control' => 'ast-responsive', - 'default' => astra_get_option( 'font-size-site-tagline' ), - 'transport' => 'postMessage', - 'priority' => 14, - 'title' => __( 'Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - ); - } else { - - $_configs = array( - - /** - * Option: Site Title Font Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-site-title]', - 'type' => 'control', - 'section' => 'title_tagline', - 'control' => 'ast-responsive', - 'default' => astra_get_option( 'font-size-site-title' ), - 'transport' => 'postMessage', - 'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 16 : 8, - 'title' => __( 'Title Font Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( - Astra_Builder_Helper::$design_tab_config, - array( - 'relation' => 'OR', - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', - 'setting-key' => 'desktop', - 'operator' => '==', - 'value' => true, - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', - 'setting-key' => 'tablet', - 'operator' => '==', - 'value' => true, - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', - 'setting-key' => 'mobile', - 'operator' => '==', - 'value' => true, - ), - ), - ) : array( - array( - 'relation' => 'OR', - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', - 'setting-key' => 'desktop', - 'operator' => '==', - 'value' => true, - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', - 'setting-key' => 'tablet', - 'operator' => '==', - 'value' => true, - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', - 'setting-key' => 'mobile', - 'operator' => '==', - 'value' => true, - ), - ), - ), - ), - - /** - * Option: Site Tagline Font Size - */ - array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-site-tagline]', - 'type' => 'control', - 'section' => 'title_tagline', - 'control' => 'ast-responsive', - 'default' => astra_get_option( 'font-size-site-tagline' ), - 'transport' => 'postMessage', - 'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 20 : 12, - 'title' => __( 'Tagline Font Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( - Astra_Builder_Helper::$design_tab_config, - array( - 'relation' => 'OR', - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', - 'setting-key' => 'desktop', - 'operator' => '==', - 'value' => true, - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', - 'setting-key' => 'tablet', - 'operator' => '==', - 'value' => true, - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', - 'setting-key' => 'mobile', - 'operator' => '==', - 'value' => true, - ), - ), - ) : array( - array( - 'relation' => 'OR', - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', - 'setting-key' => 'desktop', - 'operator' => '==', - 'value' => true, - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', - 'setting-key' => 'tablet', - 'operator' => '==', - 'value' => true, - ), - array( - 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', - 'setting-key' => 'mobile', - 'operator' => '==', - 'value' => true, - ), - ), - ), - ), - ); - } - - $configurations = array_merge( $configurations, $_configs ); - - return $configurations; - } - } -} - -new Astra_Header_Typo_Configs(); - - + 'font-size-site-title', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[site-title-typography]', + 'section' => 'title_tagline', + 'control' => 'ast-responsive', + 'default' => astra_get_option( 'font-size-site-title' ), + 'transport' => 'postMessage', + 'priority' => 9, + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Site Tagline Font Size + */ + array( + 'name' => 'font-size-site-tagline', + 'type' => 'sub-control', + 'parent' => ASTRA_THEME_SETTINGS . '[site-tagline-typography]', + 'section' => 'title_tagline', + 'control' => 'ast-responsive', + 'default' => astra_get_option( 'font-size-site-tagline' ), + 'transport' => 'postMessage', + 'priority' => 14, + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + ); + } else { + + $_configs = array( + + /** + * Option: Site Title Font Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-site-title]', + 'type' => 'control', + 'section' => 'title_tagline', + 'control' => 'ast-responsive', + 'default' => astra_get_option( 'font-size-site-title' ), + 'transport' => 'postMessage', + 'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 16 : 8, + 'title' => __( 'Title Font Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( + Astra_Builder_Helper::$design_tab_config, + array( + 'relation' => 'OR', + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', + 'setting-key' => 'desktop', + 'operator' => '==', + 'value' => true, + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', + 'setting-key' => 'tablet', + 'operator' => '==', + 'value' => true, + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', + 'setting-key' => 'mobile', + 'operator' => '==', + 'value' => true, + ), + ), + ) : array( + array( + 'relation' => 'OR', + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', + 'setting-key' => 'desktop', + 'operator' => '==', + 'value' => true, + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', + 'setting-key' => 'tablet', + 'operator' => '==', + 'value' => true, + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]', + 'setting-key' => 'mobile', + 'operator' => '==', + 'value' => true, + ), + ), + ), + ), + + /** + * Option: Site Tagline Font Size + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-site-tagline]', + 'type' => 'control', + 'section' => 'title_tagline', + 'control' => 'ast-responsive', + 'default' => astra_get_option( 'font-size-site-tagline' ), + 'transport' => 'postMessage', + 'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 20 : 12, + 'title' => __( 'Tagline Font Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( + Astra_Builder_Helper::$design_tab_config, + array( + 'relation' => 'OR', + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', + 'setting-key' => 'desktop', + 'operator' => '==', + 'value' => true, + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', + 'setting-key' => 'tablet', + 'operator' => '==', + 'value' => true, + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', + 'setting-key' => 'mobile', + 'operator' => '==', + 'value' => true, + ), + ), + ) : array( + array( + 'relation' => 'OR', + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', + 'setting-key' => 'desktop', + 'operator' => '==', + 'value' => true, + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', + 'setting-key' => 'tablet', + 'operator' => '==', + 'value' => true, + ), + array( + 'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]', + 'setting-key' => 'mobile', + 'operator' => '==', + 'value' => true, + ), + ), + ), + ), + ); + } + + $configurations = array_merge( $configurations, $_configs ); + + return $configurations; + } + } +} + +new Astra_Header_Typo_Configs(); + + diff --git a/inc/customizer/configurations/typography/class-astra-single-typo-configs.php b/inc/customizer/configurations/typography/class-astra-single-typo-configs.php index a1dd398..2977f4a 100644 --- a/inc/customizer/configurations/typography/class-astra-single-typo-configs.php +++ b/inc/customizer/configurations/typography/class-astra-single-typo-configs.php @@ -1,136 +1,136 @@ - ASTRA_THEME_SETTINGS . '[ast-sngle-blog-typography-more-feature-description]', - 'type' => 'control', - 'control' => 'ast-description', - 'section' => 'section-blog-single', - 'priority' => 999, - 'title' => '', - 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', - 'settings' => array(), - 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), - ), - - ); - } - - if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) { - - $new_configs = array( - - array( - 'name' => ASTRA_THEME_SETTINGS . '[blog-single-title-typo]', - 'type' => 'control', - 'priority' => Astra_Builder_Helper::$is_header_footer_builder_active ? - 13 : 20, - 'control' => 'ast-settings-group', - 'title' => __( 'Post / Page Title Font', 'astra' ), - 'section' => 'section-blog-single', - 'transport' => 'postMessage', - 'context' => Astra_Builder_Helper::$is_header_footer_builder_active ? - Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - ), - - /** - * Option: Single Post / Page Title Font Size - */ - array( - 'name' => 'font-size-entry-title', - 'parent' => ASTRA_THEME_SETTINGS . '[blog-single-title-typo]', - 'section' => 'section-blog-single', - 'type' => 'sub-control', - 'control' => 'ast-responsive', - 'default' => astra_get_option( 'font-size-entry-title' ), - 'transport' => 'postMessage', - 'priority' => 8, - 'title' => __( 'Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - ), - ); - } else { - - $new_configs = array(); - - /** - * Option: Single Post / Page Title Font Size - */ - $new_configs[] = array( - 'name' => ASTRA_THEME_SETTINGS . '[font-size-entry-title]', - 'section' => 'section-blog-single', - 'type' => 'control', - 'control' => 'ast-responsive', - 'default' => astra_get_option( 'font-size-entry-title' ), - 'transport' => 'postMessage', - 'priority' => 9, - 'title' => __( 'Post / Page Title Font Size', 'astra' ), - 'input_attrs' => array( - 'min' => 0, - ), - 'units' => array( - 'px' => 'px', - 'em' => 'em', - ), - 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? - Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, - ); - } - - $_configs = array_merge( $_configs, $new_configs ); - - $configurations = array_merge( $configurations, $_configs ); - - return $configurations; - } - } -} - -new Astra_Single_Typo_Configs(); + ASTRA_THEME_SETTINGS . '[ast-sngle-blog-typography-more-feature-description]', + 'type' => 'control', + 'control' => 'ast-description', + 'section' => 'section-blog-single', + 'priority' => 999, + 'title' => '', + 'help' => '

    ' . __( 'More Options Available in Astra Pro!', 'astra' ) . '

    ' . __( 'Learn More', 'astra' ) . '', + 'settings' => array(), + 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), + ), + + ); + } + + if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) { + + $new_configs = array( + + array( + 'name' => ASTRA_THEME_SETTINGS . '[blog-single-title-typo]', + 'type' => 'control', + 'priority' => Astra_Builder_Helper::$is_header_footer_builder_active ? + 13 : 20, + 'control' => 'ast-settings-group', + 'title' => __( 'Post / Page Title Font', 'astra' ), + 'section' => 'section-blog-single', + 'transport' => 'postMessage', + 'context' => Astra_Builder_Helper::$is_header_footer_builder_active ? + Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + ), + + /** + * Option: Single Post / Page Title Font Size + */ + array( + 'name' => 'font-size-entry-title', + 'parent' => ASTRA_THEME_SETTINGS . '[blog-single-title-typo]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'control' => 'ast-responsive', + 'default' => astra_get_option( 'font-size-entry-title' ), + 'transport' => 'postMessage', + 'priority' => 8, + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + ); + } else { + + $new_configs = array(); + + /** + * Option: Single Post / Page Title Font Size + */ + $new_configs[] = array( + 'name' => ASTRA_THEME_SETTINGS . '[font-size-entry-title]', + 'section' => 'section-blog-single', + 'type' => 'control', + 'control' => 'ast-responsive', + 'default' => astra_get_option( 'font-size-entry-title' ), + 'transport' => 'postMessage', + 'priority' => 9, + 'title' => __( 'Post / Page Title Font Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + 'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? + Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab, + ); + } + + $_configs = array_merge( $_configs, $new_configs ); + + $configurations = array_merge( $configurations, $_configs ); + + return $configurations; + } + } +} + +new Astra_Single_Typo_Configs(); diff --git a/inc/customizer/custom-controls/class-astra-customizer-control-base.php b/inc/customizer/custom-controls/class-astra-customizer-control-base.php index 8af15db..da1d0ae 100644 --- a/inc/customizer/custom-controls/class-astra-customizer-control-base.php +++ b/inc/customizer/custom-controls/class-astra-customizer-control-base.php @@ -1,238 +1,238 @@ - __( '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' ), - ); - - wp_localize_script( 'astra-custom-control-script', 'astraTypo', $astra_typo_localize ); - $localize_array = array( - 'colors' => astra_color_palette(), - ); - - wp_localize_script( 'astra-custom-control-script', 'astColorPalette', $localize_array ); - - } else { - - // Enqueue Customizer Plain script. - $custom_controls_plain_deps = array( - 'jquery', - 'customize-base', - 'jquery-ui-tabs', - 'jquery-ui-sortable', - ); - wp_enqueue_script( 'astra-custom-control-plain-script', $js_uri . 'custom-controls-plain' . $file_prefix . '.js', $custom_controls_plain_deps, ASTRA_THEME_VERSION, true ); - - // Enqueue Customizer React.JS script. - $custom_controls_react_deps = array( - 'astra-custom-control-plain-script', - 'wp-i18n', - 'wp-components', - 'wp-element', - 'wp-media-utils', - 'wp-block-editor', - ); - - $css_uri = ASTRA_THEME_URI . 'inc/customizer/custom-controls/typography/'; - - wp_enqueue_style( 'astra-select-woo-style', $css_uri . 'selectWoo.css', null, ASTRA_THEME_VERSION ); - - wp_enqueue_script( 'astra-custom-control-react-script', ASTRA_THEME_URI . 'inc/customizer/extend-custom-controls/build/index.js', $custom_controls_react_deps, ASTRA_THEME_VERSION, true ); - - $localize_array = array( - 'colors' => astra_color_palette(), - ); - - $astra_typo_localize = 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' ), - ); - - wp_localize_script( 'astra-custom-control-react-script', 'astColorPalette', $localize_array ); - wp_localize_script( 'astra-custom-control-react-script', 'astraTypo', $astra_typo_localize ); - } - } - - /** - * Add Control to self::$controls and Register control to WordPress Customizer. - * - * @param String $name Slug for the control. - * @param Array $atts Control Attributes. - * @return void - */ - public static function add_control( $name, $atts ) { - global $wp_customize; - self::$controls[ $name ] = $atts; - - if ( isset( $atts['callback'] ) ) { - /** - * Register controls - */ - $wp_customize->register_control_type( $atts['callback'] ); - } - } - - /** - * Returns control instance - * - * @param string $control_type control type. - * @since 1.4.3 - * @return string - */ - public static function get_control_instance( $control_type ) { - $control_class = self::get_control( $control_type ); - - if ( isset( $control_class['callback'] ) ) { - return class_exists( $control_class['callback'] ) ? $control_class['callback'] : false; - } - - return false; - } - - /** - * Returns control and its attributes - * - * @param string $control_type control type. - * @since 1.4.3 - * @return array - */ - public static function get_control( $control_type ) { - if ( isset( self::$controls[ $control_type ] ) ) { - return self::$controls[ $control_type ]; - } - - return array(); - } - - /** - * Returns Santize callback for control - * - * @param string $control control. - * @since 1.4.3 - * @return string - */ - public static function get_sanitize_call( $control ) { - - if ( isset( self::$controls[ $control ]['sanitize_callback'] ) ) { - return self::$controls[ $control ]['sanitize_callback']; - } - - return false; - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -new Astra_Customizer_Control_Base(); + __( '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' ), + ); + + wp_localize_script( 'astra-custom-control-script', 'astraTypo', $astra_typo_localize ); + $localize_array = array( + 'colors' => astra_color_palette(), + ); + + wp_localize_script( 'astra-custom-control-script', 'astColorPalette', $localize_array ); + + } else { + + // Enqueue Customizer Plain script. + $custom_controls_plain_deps = array( + 'jquery', + 'customize-base', + 'jquery-ui-tabs', + 'jquery-ui-sortable', + ); + wp_enqueue_script( 'astra-custom-control-plain-script', $js_uri . 'custom-controls-plain' . $file_prefix . '.js', $custom_controls_plain_deps, ASTRA_THEME_VERSION, true ); + + // Enqueue Customizer React.JS script. + $custom_controls_react_deps = array( + 'astra-custom-control-plain-script', + 'wp-i18n', + 'wp-components', + 'wp-element', + 'wp-media-utils', + 'wp-block-editor', + ); + + $css_uri = ASTRA_THEME_URI . 'inc/customizer/custom-controls/typography/'; + + wp_enqueue_style( 'astra-select-woo-style', $css_uri . 'selectWoo.css', null, ASTRA_THEME_VERSION ); + + wp_enqueue_script( 'astra-custom-control-react-script', ASTRA_THEME_URI . 'inc/customizer/extend-custom-controls/build/index.js', $custom_controls_react_deps, ASTRA_THEME_VERSION, true ); + + $localize_array = array( + 'colors' => astra_color_palette(), + ); + + $astra_typo_localize = 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' ), + ); + + wp_localize_script( 'astra-custom-control-react-script', 'astColorPalette', $localize_array ); + wp_localize_script( 'astra-custom-control-react-script', 'astraTypo', $astra_typo_localize ); + } + } + + /** + * Add Control to self::$controls and Register control to WordPress Customizer. + * + * @param String $name Slug for the control. + * @param Array $atts Control Attributes. + * @return void + */ + public static function add_control( $name, $atts ) { + global $wp_customize; + self::$controls[ $name ] = $atts; + + if ( isset( $atts['callback'] ) ) { + /** + * Register controls + */ + $wp_customize->register_control_type( $atts['callback'] ); + } + } + + /** + * Returns control instance + * + * @param string $control_type control type. + * @since 1.4.3 + * @return string + */ + public static function get_control_instance( $control_type ) { + $control_class = self::get_control( $control_type ); + + if ( isset( $control_class['callback'] ) ) { + return class_exists( $control_class['callback'] ) ? $control_class['callback'] : false; + } + + return false; + } + + /** + * Returns control and its attributes + * + * @param string $control_type control type. + * @since 1.4.3 + * @return array + */ + public static function get_control( $control_type ) { + if ( isset( self::$controls[ $control_type ] ) ) { + return self::$controls[ $control_type ]; + } + + return array(); + } + + /** + * Returns Santize callback for control + * + * @param string $control control. + * @since 1.4.3 + * @return string + */ + public static function get_sanitize_call( $control ) { + + if ( isset( self::$controls[ $control ]['sanitize_callback'] ) ) { + return self::$controls[ $control ]['sanitize_callback']; + } + + return false; + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +new Astra_Customizer_Control_Base(); diff --git a/inc/customizer/custom-controls/customizer-link/class-astra-control-customizer-link.php b/inc/customizer/custom-controls/customizer-link/class-astra-control-customizer-link.php index a1af417..14ce81a 100644 --- a/inc/customizer/custom-controls/customizer-link/class-astra-control-customizer-link.php +++ b/inc/customizer/custom-controls/customizer-link/class-astra-control-customizer-link.php @@ -1,69 +1,69 @@ -json['link_text'] = $this->link_text; - $this->json['linked'] = $this->linked; - $this->json['link_type'] = $this->link_type; - } - - /** - * Render the control's content. - * - * @see WP_Customize_Control::render_content() - */ - protected function render_content() {} -} +json['link_text'] = $this->link_text; + $this->json['linked'] = $this->linked; + $this->json['link_type'] = $this->link_type; + } + + /** + * Render the control's content. + * + * @see WP_Customize_Control::render_content() + */ + protected function render_content() {} +} diff --git a/inc/customizer/custom-controls/description/class-astra-control-description.php b/inc/customizer/custom-controls/description/class-astra-control-description.php index dd38119..66edf42 100644 --- a/inc/customizer/custom-controls/description/class-astra-control-description.php +++ b/inc/customizer/custom-controls/description/class-astra-control-description.php @@ -1,57 +1,57 @@ -json['label'] = esc_html( $this->label ); - $this->json['description'] = $this->description; - $this->json['help'] = $this->help; - } - - /** - * Render the control's content. - * - * @see WP_Customize_Control::render_content() - */ - protected function render_content() {} -} +json['label'] = esc_html( $this->label ); + $this->json['description'] = $this->description; + $this->json['help'] = $this->help; + } + + /** + * Render the control's content. + * + * @see WP_Customize_Control::render_content() + */ + protected function render_content() {} +} diff --git a/inc/customizer/custom-controls/index.php b/inc/customizer/custom-controls/index.php index 8b96815..820bcb9 100644 --- a/inc/customizer/custom-controls/index.php +++ b/inc/customizer/custom-controls/index.php @@ -1,9 +1,9 @@ -ast_inherit = __( 'Inherit', 'astra' ); - $this->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' ), - ); - parent::__construct( $manager, $id, $args ); - } - - /** - * Refresh the parameters passed to the JavaScript via JSON. - * - * @see WP_Customize_Control::to_json() - */ - public function to_json() { - - parent::to_json(); - - $this->json['label'] = esc_html( $this->label ); - $this->json['description'] = $this->description; - $this->json['name'] = $this->name; - $this->json['value'] = $this->value(); - $this->json['connect'] = $this->connect; - $this->json['variant'] = $this->variant; - $this->json['link'] = $this->get_link(); - $this->json['ast_all_font_weight'] = $this->ast_all_font_weight; - } - - /** - * An Underscore (JS) template for this control's content (but not its container). - * - * Class variables for this control class are available in the `data` JS object; - * export custom variables by overriding {@see WP_Customize_Control::to_json()}. - * - * @see WP_Customize_Control::print_template() - * - * @access protected - */ - protected function content_template() { - - ?> - - - - - ast_inherit = __( 'Inherit', 'astra' ); + $this->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' ), + ); + parent::__construct( $manager, $id, $args ); + } + + /** + * Refresh the parameters passed to the JavaScript via JSON. + * + * @see WP_Customize_Control::to_json() + */ + public function to_json() { + + parent::to_json(); + + $this->json['label'] = esc_html( $this->label ); + $this->json['description'] = $this->description; + $this->json['name'] = $this->name; + $this->json['value'] = $this->value(); + $this->json['connect'] = $this->connect; + $this->json['variant'] = $this->variant; + $this->json['link'] = $this->get_link(); + $this->json['ast_all_font_weight'] = $this->ast_all_font_weight; + } + + /** + * An Underscore (JS) template for this control's content (but not its container). + * + * Class variables for this control class are available in the `data` JS object; + * export custom variables by overriding {@see WP_Customize_Control::to_json()}. + * + * @see WP_Customize_Control::print_template() + * + * @access protected + */ + protected function content_template() { + + ?> + + + + + title, ENT_QUOTES, get_bloginfo( 'charset' ) ); - $array['content'] = $this->get_content(); - $array['active'] = $this->active(); - $array['instanceNumber'] = $this->instance_number; - - return $array; - } - } - -} - +title, ENT_QUOTES, get_bloginfo( 'charset' ) ); + $array['content'] = $this->get_content(); + $array['active'] = $this->active(); + $array['instanceNumber'] = $this->instance_number; + + return $array; + } + } + +} + diff --git a/inc/customizer/extend-customizer/class-astra-wp-customize-section.php b/inc/customizer/extend-customizer/class-astra-wp-customize-section.php index 363ff36..cd2719a 100644 --- a/inc/customizer/extend-customizer/class-astra-wp-customize-section.php +++ b/inc/customizer/extend-customizer/class-astra-wp-customize-section.php @@ -1,68 +1,68 @@ -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; - } - } -} +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; + } + } +} diff --git a/inc/customizer/extend-customizer/class-astra-wp-customize-separator.php b/inc/customizer/extend-customizer/class-astra-wp-customize-separator.php index 0f195f7..a2f1ab1 100644 --- a/inc/customizer/extend-customizer/class-astra-wp-customize-separator.php +++ b/inc/customizer/extend-customizer/class-astra-wp-customize-separator.php @@ -1,49 +1,49 @@ - -
  • - +
  • + 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; -$wp_customize->get_control( 'site_icon' )->priority = 16; -$wp_customize->get_control( 'site_icon' )->label = ''; - -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_store_notice' )->priority = 9; - $wp_customize->get_section( 'woocommerce_product_catalog' )->priority = 11; - $wp_customize->get_section( 'woocommerce_checkout' )->priority = 21; - $wp_customize->get_panel( 'woocommerce' )->priority = 70; -} +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; +$wp_customize->get_control( 'site_icon' )->priority = 16; +$wp_customize->get_control( 'site_icon' )->label = ''; + +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_store_notice' )->priority = 9; + $wp_customize->get_section( 'woocommerce_product_catalog' )->priority = 11; + $wp_customize->get_section( 'woocommerce_checkout' )->priority = 21; + $wp_customize->get_panel( 'woocommerce' )->priority = 70; +} diff --git a/inc/extras.php b/inc/extras.php index 4e5fde0..f7ed19a 100644 --- a/inc/extras.php +++ b/inc/extras.php @@ -1,675 +1,675 @@ - array( - 'max-width' => '100%', - 'padding-left' => '35px', - 'padding-right' => '35px', - ), - ); - $padding_below_breakpoint = array( - '#masthead .ast-container, .ast-header-breadcrumb .ast-container' => array( - 'padding-left' => '20px', - 'padding-right' => '20px', - ), - ); - - /* Parse CSS from array()*/ - $dynamic_css .= astra_parse_css( $genral_global_responsive ); - $dynamic_css .= astra_parse_css( $padding_below_breakpoint, '', $header_break_point ); - - // trim white space for faster page loading. - $dynamic_css .= Astra_Enqueue_Scripts::trim_css( $dynamic_css ); - } - - return $dynamic_css; - } -} - -add_filter( 'astra_dynamic_theme_css', 'astra_header_breakpoint_style' ); - -/** - * Function to filter comment form arguments - */ -if ( ! function_exists( 'astra_404_page_layout' ) ) { - - /** - * Function filter comment form arguments - * - * @since 1.0.0 - * @param array $layout Comment form arguments. - * @return array - */ - function astra_404_page_layout( $layout ) { - - if ( is_404() ) { - $layout = 'no-sidebar'; - } - - return apply_filters( 'astra_404_page_layout', $layout ); - } -} - -add_filter( 'astra_page_layout', 'astra_404_page_layout', 10, 1 ); - -/** - * Return current content layout - */ -if ( ! function_exists( 'astra_get_content_layout' ) ) { - - /** - * Return current content layout - * - * @since 1.0.0 - * @return boolean content layout. - */ - function astra_get_content_layout() { - - if ( is_singular() ) { - - // If post meta value is empty, - // Then get the POST_TYPE content layout. - $content_layout = astra_get_option_meta( 'site-content-layout', '', true ); - - if ( empty( $content_layout ) ) { - - $post_type = get_post_type(); - - if ( 'post' === $post_type || 'page' === $post_type ) { - $content_layout = astra_get_option( 'single-' . get_post_type() . '-content-layout' ); - } - - if ( 'default' == $content_layout || empty( $content_layout ) ) { - - // Get the GLOBAL content layout value. - // NOTE: Here not used `true` in the below function call. - $content_layout = astra_get_option( 'site-content-layout', 'full-width' ); - } - } - } else { - - $content_layout = ''; - $post_type = get_post_type(); - - if ( 'post' === $post_type ) { - $content_layout = astra_get_option( 'archive-' . get_post_type() . '-content-layout' ); - } - - if ( is_search() ) { - $content_layout = astra_get_option( 'archive-post-content-layout' ); - } - - if ( 'default' == $content_layout || empty( $content_layout ) ) { - - // Get the GLOBAL content layout value. - // NOTE: Here not used `true` in the below function call. - $content_layout = astra_get_option( 'site-content-layout', 'full-width' ); - } - } - - return apply_filters( 'astra_get_content_layout', $content_layout ); - } -} - -/** - * Function to check if it is Internet Explorer - */ -if ( ! function_exists( 'astra_check_is_ie' ) ) : - - /** - * Function to check if it is Internet Explorer. - * - * @return true | false boolean - */ - function astra_check_is_ie() { - - $is_ie = false; - - if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) { - $ua = htmlentities( sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ), ENT_QUOTES, 'UTF-8' ); - if ( strpos( $ua, 'Trident/7.0' ) !== false ) { - $is_ie = true; - } - } - - return apply_filters( 'astra_check_is_ie', $is_ie ); - } - -endif; - -/** - * Replace header logo. - */ -if ( ! function_exists( 'astra_replace_header_logo' ) ) : - - /** - * Replace header logo. - * - * @param array $image Size. - * @param int $attachment_id Image id. - * @param sting $size Size name. - * @param string $icon Icon. - * - * @return array Size of image - */ - function astra_replace_header_logo( $image, $attachment_id, $size, $icon ) { - - $custom_logo_id = get_theme_mod( 'custom_logo' ); - - if ( ! is_customize_preview() && $custom_logo_id == $attachment_id && 'full' == $size ) { - - $data = wp_get_attachment_image_src( $attachment_id, 'ast-logo-size' ); - - if ( false != $data ) { - $image = $data; - } - } - - return apply_filters( 'astra_replace_header_logo', $image ); - } - -endif; - -if ( ! function_exists( 'astra_strposa' ) ) : - - /** - * Strpos over an array. - * - * @since 1.2.4 - * @param String $haystack The string to search in. - * @param Array $needles Array of needles to be passed to strpos(). - * @param integer $offset If specified, search will start this number of characters counted from the beginning of the string. If the offset is negative, the search will start this number of characters counted from the end of the string. - * - * @return bool True if haystack if part of any of the $needles. - */ - function astra_strposa( $haystack, $needles, $offset = 0 ) { - - if ( ! is_array( $needles ) ) { - $needles = array( $needles ); - } - - foreach ( $needles as $query ) { - - if ( strpos( $haystack, $query, $offset ) !== false ) { - // stop on first true result. - return true; - } - } - - return false; - } - -endif; - -if ( ! function_exists( 'astra_get_prop' ) ) : - - /** - * Get a specific property of an array without needing to check if that property exists. - * - * Provide a default value if you want to return a specific value if the property is not set. - * - * @since 1.2.7 - * @access public - * @author Gravity Forms - Easiest Tool to Create Advanced Forms for Your WordPress-Powered Website. - * @link https://www.gravityforms.com/ - * - * @param array $array Array from which the property's value should be retrieved. - * @param string $prop Name of the property to be retrieved. - * @param string $default Optional. Value that should be returned if the property is not set or empty. Defaults to null. - * - * @return null|string|mixed The value - */ - function astra_get_prop( $array, $prop, $default = null ) { - - if ( ! is_array( $array ) && ! ( is_object( $array ) && $array instanceof ArrayAccess ) ) { - return $default; - } - - if ( ( isset( $array[ $prop ] ) && false === $array[ $prop ] ) ) { - return false; - } - - if ( isset( $array[ $prop ] ) ) { - $value = $array[ $prop ]; - } else { - $value = ''; - } - - return empty( $value ) && null !== $default ? $default : $value; - } - -endif; - -/** - * Build list of attributes into a string and apply contextual filter on string. - * - * The contextual filter is of the form `astra_attr_{context}_output`. - * - * @since 1.6.2 - * @credits - Genesis Theme By StudioPress. - * - * @param string $context The context, to build filter name. - * @param array $attributes Optional. Extra attributes to merge with defaults. - * @param array $args Optional. Custom data to pass to filter. - * @return string String of HTML attributes and values. - */ -function astra_attr( $context, $attributes = array(), $args = array() ) { - return Astra_Attr::get_instance()->astra_attr( $context, $attributes, $args ); -} - -/** - * Check the WordPress version. - * - * @since 2.5.4 - * @param string $version WordPress version to compare with the current version. - * @param string $compare Comparison value i.e > or < etc. - * @return bool True/False based on the $version and $compare value. - */ -function astra_wp_version_compare( $version, $compare ) { - - return version_compare( get_bloginfo( 'version' ), $version, $compare ); -} - -/** - * Get the theme author details - * - * @since 3.1.0 - * @return array Return theme author URL and name. - */ -function astra_get_theme_author_details() { - - $theme_author = apply_filters( - 'astra_theme_author', - array( - 'theme_name' => __( 'Astra WordPress Theme', 'astra' ), - 'theme_author_url' => 'https://wpastra.com/', - ) - ); - - return $theme_author; -} - -/** - * Remove Base Color > Background Color option from the customize array. - * - * @since 2.4.0 - * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager. - * @return $wp_customize - */ -function astra_remove_controls( $wp_customize ) { - - if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '2.4.0', '<=' ) ) { - $layout = array( - array( - 'name' => ASTRA_THEME_SETTINGS . '[site-layout-outside-bg-obj]', - 'type' => 'control', - 'transport' => 'postMessage', - 'control' => 'ast-hidden', - 'section' => 'section-colors-body', - 'priority' => 25, - ), - ); - - $wp_customize = array_merge( $wp_customize, $layout ); - } - - return $wp_customize; -} - -add_filter( 'astra_customizer_configurations', 'astra_remove_controls', 99 ); - -/** - * Add dropdown icon if menu item has children. - * - * @since 3.3.0 - * - * @param string $title The menu item title. - * @param WP_Post $item All of our menu item data. - * @param stdClass $args All of our menu item args. - * @param int $depth Depth of menu item. - * @return string The menu item. - */ -function astra_dropdown_icon_to_menu_link( $title, $item, $args, $depth ) { - $role = 'presentation'; - $tabindex = '0'; - $icon = ''; - - /** - * These menus are not overriden by the 'Astra_Custom_Nav_Walker' class present in Addon - Nav Menu module. - * - * Hence skipping these menus from getting overriden by blank SVG Icons and adding the icons from theme. - * - * @since 3.3.0 - */ - $astra_menu_locations = array( - 'ast-hf-menu-1', // Builder - Primary menu. - 'ast-hf-menu-2', // Builder - Secondary menu. - 'ast-hf-menu-3', - 'ast-hf-menu-4', - 'ast-hf-menu-5', - 'ast-hf-menu-6', - 'ast-hf-menu-7', - 'ast-hf-menu-8', - 'ast-hf-menu-9', - 'ast-hf-menu-10', // Cloned builder menus. - 'ast-hf-mobile-menu', // Builder - Mobile Menu. - 'ast-hf-account-menu', // Builder - Login Account Menu. - 'primary-menu', // Old header - Primary Menu. - 'above_header-menu', // Old header - Above Menu. - 'below_header-menu', // Old header - Below Menu. - ); - - $load_svg_menu_icons = false; - - if ( defined( 'ASTRA_EXT_VER' ) ) { - // Check whether Astra Pro is active + Nav menu addon is deactivate + menu registered by Astra only. - if ( ! Astra_Ext_Extension::is_active( 'nav-menu' ) && in_array( $args->menu_id, $astra_menu_locations ) ) { - $load_svg_menu_icons = true; - } - } else { - // Check menu registered by Astra only. - if ( in_array( $args->menu_id, $astra_menu_locations ) ) { - $load_svg_menu_icons = true; - } - } - - if ( $load_svg_menu_icons ) { - // Assign icons to only those menu which are registered by Astra. - $icon = Astra_Icons::get_icons( 'arrow' ); - } - foreach ( $item->classes as $value ) { - if ( 'menu-item-has-children' === $value ) { - $title = $title . '' . $icon . ''; - } - } - if ( 0 < $depth ) { - $title = $icon . $title; - } - return $title; -} - -if ( Astra_Icons::is_svg_icons() ) { - add_filter( 'nav_menu_item_title', 'astra_dropdown_icon_to_menu_link', 10, 4 ); -} - -/** - * Is theme existing header footer configs enable. - * - * @since 3.0.0 - * - * @return boolean true/false. - */ -function astra_existing_header_footer_configs() { - - return apply_filters( 'astra_existing_header_footer_configs', true ); -} - -/** - * Get Spacing value - * - * @param array $value Responsive spacing value with unit. - * @param string $operation + | - | * | /. - * @param string $from Perform operation from the value. - * @param string $from_unit Perform operation from the value of unit. - * - * @since 3.0.0 - * @return mixed - */ -function astra_calculate_spacing( $value, $operation = '', $from = '', $from_unit = '' ) { - - $css = ''; - if ( ! empty( $value ) ) { - $css = $value; - if ( ! empty( $operation ) && ! empty( $from ) ) { - if ( ! empty( $from_unit ) ) { - $css = 'calc( ' . $value . ' ' . $operation . ' ' . $from . $from_unit . ' )'; - } - if ( '*' === $operation || '/' === $operation ) { - $css = 'calc( ' . $value . ' ' . $operation . ' ' . $from . ' )'; - } - } - } - - return $css; -} - -/** - * Generate HTML Open markup - * - * @param string $context unique markup key. - * @param array $args { - * Contains markup arguments. - * @type array attrs Initial attributes to apply to `open` markup. - * @type bool echo Flag indicating whether to echo or return the resultant string. - * } - * @since 3.3.0 - * @return mixed - */ -function astra_markup_open( $context, $args = array() ) { - $defaults = array( - 'open' => '', - 'attrs' => array(), - 'echo' => true, - 'content' => '', - ); - - $args = wp_parse_args( $args, $defaults ); - if ( $context ) { - $args = apply_filters( "astra_markup_{$context}_open", $args ); - $open_tag = $args['open'] ? sprintf( $args['open'], astra_attr( $context, $args['attrs'] ) ) : ''; - - if ( $args['echo'] ) { - echo $open_tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } else { - return $open_tag; - } - } - return false; -} - -/** - * Generate HTML close markup - * - * @param string $context unique markup key. - * @param array $args { - * Contains markup arguments. - * @type string close Closing HTML markup. - * @type array attrs Initial attributes to apply to `open` markup. - * @type bool echo Flag indicating whether to echo or return the resultant string. - * } - * @since 3.3.0 - * @return mixed - */ -function astra_markup_close( $context, $args = array() ) { - $defaults = array( - 'close' => '', - 'attrs' => array(), - 'echo' => true, - ); - - $args = wp_parse_args( $args, $defaults ); - if ( $context ) { - $args = apply_filters( "astra_markup_{$context}_close", $args ); - $close_tag = $args['close']; - if ( $args['echo'] ) { - echo $close_tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } else { - return $close_tag; - } - } - return false; -} - -/** - * Provision to update display rules for visibility of Related Posts section in Astra. - * - * @since 3.4.0 - * @return bool - */ -function astra_target_rules_for_related_posts() { - - $allow_related_posts = false; - $supported_post_type = apply_filters( 'astra_related_posts_supported_post_types', 'post' ); - - if ( astra_get_option( 'enable-related-posts' ) && is_singular( $supported_post_type ) ) { - $allow_related_posts = true; - } - - return apply_filters( 'astra_showcase_related_posts', $allow_related_posts ); -} - -/** - * Check the Astra addon 3.5.0 version is using or not. - * As this is major update and frequently we used version_compare, added a function for this for easy maintenance. - * - * @since 3.5.0 - */ -function is_astra_addon_3_5_0_version() { - return defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '3.5.0', '<' ); -} - -/** - * Get a stylesheet URL for a webfont. - * - * @since 3.6.0 - * - * @param string $url The URL of the remote webfont. - * @param string $format The font-format. If you need to support IE, change this to "woff". - * - * @return string Returns the CSS. - */ -function ast_get_webfont_url( $url, $format = 'woff2' ) { - - // Check if already Google font URL present or not. Basically avoiding 'Astra_WebFont_Loader' class rendering. - $astra_font_url = astra_get_option( 'astra_font_url', false ); - if ( $astra_font_url ) { - return json_decode( $astra_font_url ); - } - - // Now create font URL if its not present. - $font = astra_webfont_loader_instance( $url ); - $font->set_font_format( $format ); - return $font->get_url(); -} - -/** - * Get the file preloads. - * - * @param string $url The URL of the remote webfont. - * @param string $format The font-format. If you need to support IE, change this to "woff". - */ -function ast_load_preload_local_fonts( $url, $format = 'woff2' ) { - - // Check if cached font files data preset present or not. Basically avoiding 'Astra_WebFont_Loader' class rendering. - $astra_local_font_files = get_site_option( 'astra_local_font_files', false ); - - if ( is_array( $astra_local_font_files ) && ! empty( $astra_local_font_files ) ) { - $font_format = apply_filters( 'astra_local_google_fonts_format', $format ); - foreach ( $astra_local_font_files as $key => $local_font ) { - if ( $local_font ) { - echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - } - return; - } - - // Now preload font data after processing it, as we didn't get stored data. - $font = astra_webfont_loader_instance( $url ); - $font->set_font_format( $format ); - $font->preload_local_fonts(); -} - -/** - * Set flag to manage backward compatibility for v3.5.0 earlier users for the transparent header border bottom default value changed. - * - * @since 3.6.0 - */ -function astra_get_transparent_header_default_value() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['transparent-header-default-border'] = isset( $astra_settings['transparent-header-default-border'] ) ? false : true; - return apply_filters( 'astra_transparent_header_default_border', $astra_settings['transparent-header-default-border'] ); -} - -/** - * Check whether user is exising or new to apply the updated default values for button padding & support GB button paddings with global button padding options. - * - * @since 3.6.3 - * @return string - */ -function astra_button_default_padding_updated() { - $astra_settings = get_option( ASTRA_THEME_SETTINGS ); - $astra_settings['btn-default-padding-updated'] = isset( $astra_settings['btn-default-padding-updated'] ) ? $astra_settings['btn-default-padding-updated'] : true; - return apply_filters( 'astra_update_button_padding_defaults', $astra_settings['btn-default-padding-updated'] ); -} - -/** - * Check is WordPress version is greater than or equal to beta 5.8 version. - * - * @since 3.6.5 - * @return boolean - */ -function astra_has_widgets_block_editor() { - if ( ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '10.6.2', '>' ) ) - || version_compare( get_bloginfo( 'version' ), '5.8-alpha', '>=' ) ) { - return true; - } - return false; -} + array( + 'max-width' => '100%', + 'padding-left' => '35px', + 'padding-right' => '35px', + ), + ); + $padding_below_breakpoint = array( + '#masthead .ast-container, .ast-header-breadcrumb .ast-container' => array( + 'padding-left' => '20px', + 'padding-right' => '20px', + ), + ); + + /* Parse CSS from array()*/ + $dynamic_css .= astra_parse_css( $genral_global_responsive ); + $dynamic_css .= astra_parse_css( $padding_below_breakpoint, '', $header_break_point ); + + // trim white space for faster page loading. + $dynamic_css .= Astra_Enqueue_Scripts::trim_css( $dynamic_css ); + } + + return $dynamic_css; + } +} + +add_filter( 'astra_dynamic_theme_css', 'astra_header_breakpoint_style' ); + +/** + * Function to filter comment form arguments + */ +if ( ! function_exists( 'astra_404_page_layout' ) ) { + + /** + * Function filter comment form arguments + * + * @since 1.0.0 + * @param array $layout Comment form arguments. + * @return array + */ + function astra_404_page_layout( $layout ) { + + if ( is_404() ) { + $layout = 'no-sidebar'; + } + + return apply_filters( 'astra_404_page_layout', $layout ); + } +} + +add_filter( 'astra_page_layout', 'astra_404_page_layout', 10, 1 ); + +/** + * Return current content layout + */ +if ( ! function_exists( 'astra_get_content_layout' ) ) { + + /** + * Return current content layout + * + * @since 1.0.0 + * @return boolean content layout. + */ + function astra_get_content_layout() { + + if ( is_singular() ) { + + // If post meta value is empty, + // Then get the POST_TYPE content layout. + $content_layout = astra_get_option_meta( 'site-content-layout', '', true ); + + if ( empty( $content_layout ) ) { + + $post_type = get_post_type(); + + if ( 'post' === $post_type || 'page' === $post_type ) { + $content_layout = astra_get_option( 'single-' . get_post_type() . '-content-layout' ); + } + + if ( 'default' == $content_layout || empty( $content_layout ) ) { + + // Get the GLOBAL content layout value. + // NOTE: Here not used `true` in the below function call. + $content_layout = astra_get_option( 'site-content-layout', 'full-width' ); + } + } + } else { + + $content_layout = ''; + $post_type = get_post_type(); + + if ( 'post' === $post_type ) { + $content_layout = astra_get_option( 'archive-' . get_post_type() . '-content-layout' ); + } + + if ( is_search() ) { + $content_layout = astra_get_option( 'archive-post-content-layout' ); + } + + if ( 'default' == $content_layout || empty( $content_layout ) ) { + + // Get the GLOBAL content layout value. + // NOTE: Here not used `true` in the below function call. + $content_layout = astra_get_option( 'site-content-layout', 'full-width' ); + } + } + + return apply_filters( 'astra_get_content_layout', $content_layout ); + } +} + +/** + * Function to check if it is Internet Explorer + */ +if ( ! function_exists( 'astra_check_is_ie' ) ) : + + /** + * Function to check if it is Internet Explorer. + * + * @return true | false boolean + */ + function astra_check_is_ie() { + + $is_ie = false; + + if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + $ua = htmlentities( sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ), ENT_QUOTES, 'UTF-8' ); + if ( strpos( $ua, 'Trident/7.0' ) !== false ) { + $is_ie = true; + } + } + + return apply_filters( 'astra_check_is_ie', $is_ie ); + } + +endif; + +/** + * Replace header logo. + */ +if ( ! function_exists( 'astra_replace_header_logo' ) ) : + + /** + * Replace header logo. + * + * @param array $image Size. + * @param int $attachment_id Image id. + * @param sting $size Size name. + * @param string $icon Icon. + * + * @return array Size of image + */ + function astra_replace_header_logo( $image, $attachment_id, $size, $icon ) { + + $custom_logo_id = get_theme_mod( 'custom_logo' ); + + if ( ! is_customize_preview() && $custom_logo_id == $attachment_id && 'full' == $size ) { + + $data = wp_get_attachment_image_src( $attachment_id, 'ast-logo-size' ); + + if ( false != $data ) { + $image = $data; + } + } + + return apply_filters( 'astra_replace_header_logo', $image ); + } + +endif; + +if ( ! function_exists( 'astra_strposa' ) ) : + + /** + * Strpos over an array. + * + * @since 1.2.4 + * @param String $haystack The string to search in. + * @param Array $needles Array of needles to be passed to strpos(). + * @param integer $offset If specified, search will start this number of characters counted from the beginning of the string. If the offset is negative, the search will start this number of characters counted from the end of the string. + * + * @return bool True if haystack if part of any of the $needles. + */ + function astra_strposa( $haystack, $needles, $offset = 0 ) { + + if ( ! is_array( $needles ) ) { + $needles = array( $needles ); + } + + foreach ( $needles as $query ) { + + if ( strpos( $haystack, $query, $offset ) !== false ) { + // stop on first true result. + return true; + } + } + + return false; + } + +endif; + +if ( ! function_exists( 'astra_get_prop' ) ) : + + /** + * Get a specific property of an array without needing to check if that property exists. + * + * Provide a default value if you want to return a specific value if the property is not set. + * + * @since 1.2.7 + * @access public + * @author Gravity Forms - Easiest Tool to Create Advanced Forms for Your WordPress-Powered Website. + * @link https://www.gravityforms.com/ + * + * @param array $array Array from which the property's value should be retrieved. + * @param string $prop Name of the property to be retrieved. + * @param string $default Optional. Value that should be returned if the property is not set or empty. Defaults to null. + * + * @return null|string|mixed The value + */ + function astra_get_prop( $array, $prop, $default = null ) { + + if ( ! is_array( $array ) && ! ( is_object( $array ) && $array instanceof ArrayAccess ) ) { + return $default; + } + + if ( ( isset( $array[ $prop ] ) && false === $array[ $prop ] ) ) { + return false; + } + + if ( isset( $array[ $prop ] ) ) { + $value = $array[ $prop ]; + } else { + $value = ''; + } + + return empty( $value ) && null !== $default ? $default : $value; + } + +endif; + +/** + * Build list of attributes into a string and apply contextual filter on string. + * + * The contextual filter is of the form `astra_attr_{context}_output`. + * + * @since 1.6.2 + * @credits - Genesis Theme By StudioPress. + * + * @param string $context The context, to build filter name. + * @param array $attributes Optional. Extra attributes to merge with defaults. + * @param array $args Optional. Custom data to pass to filter. + * @return string String of HTML attributes and values. + */ +function astra_attr( $context, $attributes = array(), $args = array() ) { + return Astra_Attr::get_instance()->astra_attr( $context, $attributes, $args ); +} + +/** + * Check the WordPress version. + * + * @since 2.5.4 + * @param string $version WordPress version to compare with the current version. + * @param string $compare Comparison value i.e > or < etc. + * @return bool True/False based on the $version and $compare value. + */ +function astra_wp_version_compare( $version, $compare ) { + + return version_compare( get_bloginfo( 'version' ), $version, $compare ); +} + +/** + * Get the theme author details + * + * @since 3.1.0 + * @return array Return theme author URL and name. + */ +function astra_get_theme_author_details() { + + $theme_author = apply_filters( + 'astra_theme_author', + array( + 'theme_name' => __( 'Adélie Linux WordPress Theme', 'astra' ), + 'theme_author_url' => 'https://git.adelielinux.org/adelie/blog-ng/', + ) + ); + + return $theme_author; +} + +/** + * Remove Base Color > Background Color option from the customize array. + * + * @since 2.4.0 + * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager. + * @return $wp_customize + */ +function astra_remove_controls( $wp_customize ) { + + if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '2.4.0', '<=' ) ) { + $layout = array( + array( + 'name' => ASTRA_THEME_SETTINGS . '[site-layout-outside-bg-obj]', + 'type' => 'control', + 'transport' => 'postMessage', + 'control' => 'ast-hidden', + 'section' => 'section-colors-body', + 'priority' => 25, + ), + ); + + $wp_customize = array_merge( $wp_customize, $layout ); + } + + return $wp_customize; +} + +add_filter( 'astra_customizer_configurations', 'astra_remove_controls', 99 ); + +/** + * Add dropdown icon if menu item has children. + * + * @since 3.3.0 + * + * @param string $title The menu item title. + * @param WP_Post $item All of our menu item data. + * @param stdClass $args All of our menu item args. + * @param int $depth Depth of menu item. + * @return string The menu item. + */ +function astra_dropdown_icon_to_menu_link( $title, $item, $args, $depth ) { + $role = 'presentation'; + $tabindex = '0'; + $icon = ''; + + /** + * These menus are not overriden by the 'Astra_Custom_Nav_Walker' class present in Addon - Nav Menu module. + * + * Hence skipping these menus from getting overriden by blank SVG Icons and adding the icons from theme. + * + * @since 3.3.0 + */ + $astra_menu_locations = array( + 'ast-hf-menu-1', // Builder - Primary menu. + 'ast-hf-menu-2', // Builder - Secondary menu. + 'ast-hf-menu-3', + 'ast-hf-menu-4', + 'ast-hf-menu-5', + 'ast-hf-menu-6', + 'ast-hf-menu-7', + 'ast-hf-menu-8', + 'ast-hf-menu-9', + 'ast-hf-menu-10', // Cloned builder menus. + 'ast-hf-mobile-menu', // Builder - Mobile Menu. + 'ast-hf-account-menu', // Builder - Login Account Menu. + 'primary-menu', // Old header - Primary Menu. + 'above_header-menu', // Old header - Above Menu. + 'below_header-menu', // Old header - Below Menu. + ); + + $load_svg_menu_icons = false; + + if ( defined( 'ASTRA_EXT_VER' ) ) { + // Check whether Astra Pro is active + Nav menu addon is deactivate + menu registered by Astra only. + if ( ! Astra_Ext_Extension::is_active( 'nav-menu' ) && in_array( $args->menu_id, $astra_menu_locations ) ) { + $load_svg_menu_icons = true; + } + } else { + // Check menu registered by Astra only. + if ( in_array( $args->menu_id, $astra_menu_locations ) ) { + $load_svg_menu_icons = true; + } + } + + if ( $load_svg_menu_icons ) { + // Assign icons to only those menu which are registered by Astra. + $icon = Astra_Icons::get_icons( 'arrow' ); + } + foreach ( $item->classes as $value ) { + if ( 'menu-item-has-children' === $value ) { + $title = $title . '' . $icon . ''; + } + } + if ( 0 < $depth ) { + $title = $icon . $title; + } + return $title; +} + +if ( Astra_Icons::is_svg_icons() ) { + add_filter( 'nav_menu_item_title', 'astra_dropdown_icon_to_menu_link', 10, 4 ); +} + +/** + * Is theme existing header footer configs enable. + * + * @since 3.0.0 + * + * @return boolean true/false. + */ +function astra_existing_header_footer_configs() { + + return apply_filters( 'astra_existing_header_footer_configs', true ); +} + +/** + * Get Spacing value + * + * @param array $value Responsive spacing value with unit. + * @param string $operation + | - | * | /. + * @param string $from Perform operation from the value. + * @param string $from_unit Perform operation from the value of unit. + * + * @since 3.0.0 + * @return mixed + */ +function astra_calculate_spacing( $value, $operation = '', $from = '', $from_unit = '' ) { + + $css = ''; + if ( ! empty( $value ) ) { + $css = $value; + if ( ! empty( $operation ) && ! empty( $from ) ) { + if ( ! empty( $from_unit ) ) { + $css = 'calc( ' . $value . ' ' . $operation . ' ' . $from . $from_unit . ' )'; + } + if ( '*' === $operation || '/' === $operation ) { + $css = 'calc( ' . $value . ' ' . $operation . ' ' . $from . ' )'; + } + } + } + + return $css; +} + +/** + * Generate HTML Open markup + * + * @param string $context unique markup key. + * @param array $args { + * Contains markup arguments. + * @type array attrs Initial attributes to apply to `open` markup. + * @type bool echo Flag indicating whether to echo or return the resultant string. + * } + * @since 3.3.0 + * @return mixed + */ +function astra_markup_open( $context, $args = array() ) { + $defaults = array( + 'open' => '', + 'attrs' => array(), + 'echo' => true, + 'content' => '', + ); + + $args = wp_parse_args( $args, $defaults ); + if ( $context ) { + $args = apply_filters( "astra_markup_{$context}_open", $args ); + $open_tag = $args['open'] ? sprintf( $args['open'], astra_attr( $context, $args['attrs'] ) ) : ''; + + if ( $args['echo'] ) { + echo $open_tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } else { + return $open_tag; + } + } + return false; +} + +/** + * Generate HTML close markup + * + * @param string $context unique markup key. + * @param array $args { + * Contains markup arguments. + * @type string close Closing HTML markup. + * @type array attrs Initial attributes to apply to `open` markup. + * @type bool echo Flag indicating whether to echo or return the resultant string. + * } + * @since 3.3.0 + * @return mixed + */ +function astra_markup_close( $context, $args = array() ) { + $defaults = array( + 'close' => '', + 'attrs' => array(), + 'echo' => true, + ); + + $args = wp_parse_args( $args, $defaults ); + if ( $context ) { + $args = apply_filters( "astra_markup_{$context}_close", $args ); + $close_tag = $args['close']; + if ( $args['echo'] ) { + echo $close_tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } else { + return $close_tag; + } + } + return false; +} + +/** + * Provision to update display rules for visibility of Related Posts section in Astra. + * + * @since 3.4.0 + * @return bool + */ +function astra_target_rules_for_related_posts() { + + $allow_related_posts = false; + $supported_post_type = apply_filters( 'astra_related_posts_supported_post_types', 'post' ); + + if ( astra_get_option( 'enable-related-posts' ) && is_singular( $supported_post_type ) ) { + $allow_related_posts = true; + } + + return apply_filters( 'astra_showcase_related_posts', $allow_related_posts ); +} + +/** + * Check the Astra addon 3.5.0 version is using or not. + * As this is major update and frequently we used version_compare, added a function for this for easy maintenance. + * + * @since 3.5.0 + */ +function is_astra_addon_3_5_0_version() { + return defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '3.5.0', '<' ); +} + +/** + * Get a stylesheet URL for a webfont. + * + * @since 3.6.0 + * + * @param string $url The URL of the remote webfont. + * @param string $format The font-format. If you need to support IE, change this to "woff". + * + * @return string Returns the CSS. + */ +function ast_get_webfont_url( $url, $format = 'woff2' ) { + + // Check if already Google font URL present or not. Basically avoiding 'Astra_WebFont_Loader' class rendering. + $astra_font_url = astra_get_option( 'astra_font_url', false ); + if ( $astra_font_url ) { + return json_decode( $astra_font_url ); + } + + // Now create font URL if its not present. + $font = astra_webfont_loader_instance( $url ); + $font->set_font_format( $format ); + return $font->get_url(); +} + +/** + * Get the file preloads. + * + * @param string $url The URL of the remote webfont. + * @param string $format The font-format. If you need to support IE, change this to "woff". + */ +function ast_load_preload_local_fonts( $url, $format = 'woff2' ) { + + // Check if cached font files data preset present or not. Basically avoiding 'Astra_WebFont_Loader' class rendering. + $astra_local_font_files = get_site_option( 'astra_local_font_files', false ); + + if ( is_array( $astra_local_font_files ) && ! empty( $astra_local_font_files ) ) { + $font_format = apply_filters( 'astra_local_google_fonts_format', $format ); + foreach ( $astra_local_font_files as $key => $local_font ) { + if ( $local_font ) { + echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } + } + return; + } + + // Now preload font data after processing it, as we didn't get stored data. + $font = astra_webfont_loader_instance( $url ); + $font->set_font_format( $format ); + $font->preload_local_fonts(); +} + +/** + * Set flag to manage backward compatibility for v3.5.0 earlier users for the transparent header border bottom default value changed. + * + * @since 3.6.0 + */ +function astra_get_transparent_header_default_value() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['transparent-header-default-border'] = isset( $astra_settings['transparent-header-default-border'] ) ? false : true; + return apply_filters( 'astra_transparent_header_default_border', $astra_settings['transparent-header-default-border'] ); +} + +/** + * Check whether user is exising or new to apply the updated default values for button padding & support GB button paddings with global button padding options. + * + * @since 3.6.3 + * @return string + */ +function astra_button_default_padding_updated() { + $astra_settings = get_option( ASTRA_THEME_SETTINGS ); + $astra_settings['btn-default-padding-updated'] = isset( $astra_settings['btn-default-padding-updated'] ) ? $astra_settings['btn-default-padding-updated'] : true; + return apply_filters( 'astra_update_button_padding_defaults', $astra_settings['btn-default-padding-updated'] ); +} + +/** + * Check is WordPress version is greater than or equal to beta 5.8 version. + * + * @since 3.6.5 + * @return boolean + */ +function astra_has_widgets_block_editor() { + if ( ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '10.6.2', '>' ) ) + || version_compare( get_bloginfo( 'version' ), '5.8-alpha', '>=' ) ) { + return true; + } + return false; +} diff --git a/inc/google-fonts.php b/inc/google-fonts.php index 597b456..11ec0a9 100644 --- a/inc/google-fonts.php +++ b/inc/google-fonts.php @@ -1,6402 +1,6402 @@ - array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Abel' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Abhaya Libre' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'serif', - ), - ), - array( - 'Abril Fatface' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Aclonica' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Acme' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Actor' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Adamina' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Advent Pro' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Aguafina Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Akaya Kanadaka' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Akaya Telivigala' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Akronim' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Aladin' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Alata' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Alatsi' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Aldrich' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Alef' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Alegreya' => array( - 'variants' => array( 'regular', '500', '600', '700', '800', '900', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Alegreya SC' => array( - 'variants' => array( 'regular', 'italic', '500', '500italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Alegreya Sans' => array( - 'variants' => array( '100', '100italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Alegreya Sans SC' => array( - 'variants' => array( '100', '100italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Aleo' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Alex Brush' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Alfa Slab One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Alice' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Alike' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Alike Angular' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Allan' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Allerta' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Allerta Stencil' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Allura' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Almarai' => array( - 'variants' => array( '300', 'regular', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Almendra' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Almendra Display' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Almendra SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Amarante' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Amaranth' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Amatic SC' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'handwriting', - ), - ), - array( - 'Amethysta' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Amiko' => array( - 'variants' => array( 'regular', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Amiri' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Amita' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'handwriting', - ), - ), - array( - 'Anaheim' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Andada' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Andika' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Andika New Basic' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Angkor' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Annie Use Your Telescope' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Anonymous Pro' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'monospace', - ), - ), - array( - 'Antic' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Antic Didone' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Antic Slab' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Anton' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Antonio' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Arapey' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Arbutus' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Arbutus Slab' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Architects Daughter' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Archivo' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Archivo Black' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Archivo Narrow' => array( - 'variants' => array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Aref Ruqaa' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Arima Madurai' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '700', '800', '900' ), - 'category' => 'display', - ), - ), - array( - 'Arimo' => array( - 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Arizonia' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Armata' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Arsenal' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Artifika' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Arvo' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Arya' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Asap' => array( - 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Asap Condensed' => array( - 'variants' => array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Asar' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Asset' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Assistant' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Astloch' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Asul' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Athiti' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Atma' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'display', - ), - ), - array( - 'Atomic Age' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Aubrey' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Audiowide' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Autour One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Average' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Average Sans' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Averia Gruesa Libre' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Averia Libre' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), - 'category' => 'display', - ), - ), - array( - 'Averia Sans Libre' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), - 'category' => 'display', - ), - ), - array( - 'Averia Serif Libre' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), - 'category' => 'display', - ), - ), - array( - 'B612' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'B612 Mono' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'monospace', - ), - ), - array( - 'Bad Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Bahiana' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bahianita' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bai Jamjuree' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Ballet' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Baloo 2' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Baloo Bhai 2' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Baloo Bhaina 2' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Baloo Chettan 2' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Baloo Da 2' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Baloo Paaji 2' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Baloo Tamma 2' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Baloo Tammudu 2' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Baloo Thambi 2' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Balsamiq Sans' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'display', - ), - ), - array( - 'Balthazar' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Bangers' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Barlow' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Barlow Condensed' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Barlow Semi Condensed' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Barriecito' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Barrio' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Basic' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Baskervville' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Battambang' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Baumans' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bayon' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Be Vietnam' => array( - 'variants' => array( '100', '100italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Bebas Neue' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Belgrano' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Bellefair' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Belleza' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Bellota' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), - 'category' => 'display', - ), - ), - array( - 'Bellota Text' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), - 'category' => 'display', - ), - ), - array( - 'BenchNine' => array( - 'variants' => array( '300', 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Benne' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Bentham' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Berkshire Swash' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Beth Ellen' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Bevan' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Big Shoulders Display' => array( - 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'display', - ), - ), - array( - 'Big Shoulders Inline Display' => array( - 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'display', - ), - ), - array( - 'Big Shoulders Inline Text' => array( - 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'display', - ), - ), - array( - 'Big Shoulders Stencil Display' => array( - 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'display', - ), - ), - array( - 'Big Shoulders Stencil Text' => array( - 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'display', - ), - ), - array( - 'Big Shoulders Text' => array( - 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'display', - ), - ), - array( - 'Bigelow Rules' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bigshot One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bilbo' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Bilbo Swash Caps' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'BioRhyme' => array( - 'variants' => array( '200', '300', 'regular', '700', '800' ), - 'category' => 'serif', - ), - ), - array( - 'BioRhyme Expanded' => array( - 'variants' => array( '200', '300', 'regular', '700', '800' ), - 'category' => 'serif', - ), - ), - array( - 'Biryani' => array( - 'variants' => array( '200', '300', 'regular', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Bitter' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Black And White Picture' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Black Han Sans' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Black Ops One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Blinker' => array( - 'variants' => array( '100', '200', '300', 'regular', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Bodoni Moda' => array( - 'variants' => array( 'regular', '500', '600', '700', '800', '900', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Bokor' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bona Nova' => array( - 'variants' => array( 'regular', 'italic', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Bonbon' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Boogaloo' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bowlby One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bowlby One SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Brawler' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Bree Serif' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Brygada 1918' => array( - 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Bubblegum Sans' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bubbler One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Buda' => array( - 'variants' => array( '300' ), - 'category' => 'display', - ), - ), - array( - 'Buenard' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Bungee' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bungee Hairline' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bungee Inline' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bungee Outline' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Bungee Shade' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Butcherman' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Butterfly Kids' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Cabin' => array( - 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Cabin Condensed' => array( - 'variants' => array( 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Cabin Sketch' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Caesar Dressing' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Cagliostro' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Cairo' => array( - 'variants' => array( '200', '300', 'regular', '600', '700', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Caladea' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Calistoga' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Calligraffitti' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Cambay' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Cambo' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Candal' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Cantarell' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Cantata One' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Cantora One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Capriola' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Cardo' => array( - 'variants' => array( 'regular', 'italic', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Carme' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Carrois Gothic' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Carrois Gothic SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Carter One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Castoro' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Catamaran' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Caudex' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Caveat' => array( - 'variants' => array( 'regular', '500', '600', '700' ), - 'category' => 'handwriting', - ), - ), - array( - 'Caveat Brush' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Cedarville Cursive' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Ceviche One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Chakra Petch' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Changa' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Changa One' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'display', - ), - ), - array( - 'Chango' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Charm' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'handwriting', - ), - ), - array( - 'Charmonman' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'handwriting', - ), - ), - array( - 'Chathura' => array( - 'variants' => array( '100', '300', 'regular', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Chau Philomene One' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Chela One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Chelsea Market' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Chenla' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Cherry Cream Soda' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Cherry Swash' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Chewy' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Chicle' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Chilanka' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Chivo' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Chonburi' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Cinzel' => array( - 'variants' => array( 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Cinzel Decorative' => array( - 'variants' => array( 'regular', '700', '900' ), - 'category' => 'display', - ), - ), - array( - 'Clicker Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Coda' => array( - 'variants' => array( 'regular', '800' ), - 'category' => 'display', - ), - ), - array( - 'Coda Caption' => array( - 'variants' => array( '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Codystar' => array( - 'variants' => array( '300', 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Coiny' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Combo' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Comfortaa' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'display', - ), - ), - array( - 'Comic Neue' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), - 'category' => 'handwriting', - ), - ), - array( - 'Coming Soon' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Commissioner' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Concert One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Condiment' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Content' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Contrail One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Convergence' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Cookie' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Copse' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Corben' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Cormorant' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Cormorant Garamond' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Cormorant Infant' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Cormorant SC' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Cormorant Unicase' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Cormorant Upright' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Courgette' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Courier Prime' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'monospace', - ), - ), - array( - 'Cousine' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'monospace', - ), - ), - array( - 'Coustard' => array( - 'variants' => array( 'regular', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Covered By Your Grace' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Crafty Girls' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Creepster' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Crete Round' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Crimson Pro' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '900', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Crimson Text' => array( - 'variants' => array( 'regular', 'italic', '600', '600italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Croissant One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Crushed' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Cuprum' => array( - 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Cute Font' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Cutive' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Cutive Mono' => array( - 'variants' => array( 'regular' ), - 'category' => 'monospace', - ), - ), - array( - 'DM Mono' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic' ), - 'category' => 'monospace', - ), - ), - array( - 'DM Sans' => array( - 'variants' => array( 'regular', 'italic', '500', '500italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'DM Serif Display' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'DM Serif Text' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Damion' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Dancing Script' => array( - 'variants' => array( 'regular', '500', '600', '700' ), - 'category' => 'handwriting', - ), - ), - array( - 'Dangrek' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Darker Grotesque' => array( - 'variants' => array( '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'David Libre' => array( - 'variants' => array( 'regular', '500', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Dawning of a New Day' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Days One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Dekko' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Dela Gothic One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Delius' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Delius Swash Caps' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Delius Unicase' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'handwriting', - ), - ), - array( - 'Della Respira' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Denk One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Devonshire' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Dhurjati' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Didact Gothic' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Diplomata' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Diplomata SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Do Hyeon' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Dokdo' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Domine' => array( - 'variants' => array( 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Donegal One' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Doppio One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Dorsa' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Dosis' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'DotGothic16' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Dr Sugiyama' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Duru Sans' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Dynalight' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'EB Garamond' => array( - 'variants' => array( 'regular', '500', '600', '700', '800', 'italic', '500italic', '600italic', '700italic', '800italic' ), - 'category' => 'serif', - ), - ), - array( - 'Eagle Lake' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'East Sea Dokdo' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Eater' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Economica' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Eczar' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'serif', - ), - ), - array( - 'El Messiri' => array( - 'variants' => array( 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Electrolize' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Elsie' => array( - 'variants' => array( 'regular', '900' ), - 'category' => 'display', - ), - ), - array( - 'Elsie Swash Caps' => array( - 'variants' => array( 'regular', '900' ), - 'category' => 'display', - ), - ), - array( - 'Emblema One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Emilys Candy' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Encode Sans' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Encode Sans Condensed' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Encode Sans Expanded' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Encode Sans SC' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Encode Sans Semi Condensed' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Encode Sans Semi Expanded' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Engagement' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Englebert' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Enriqueta' => array( - 'variants' => array( 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Epilogue' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Erica One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Esteban' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Euphoria Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Ewert' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Exo' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Exo 2' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Expletus Sans' => array( - 'variants' => array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'display', - ), - ), - array( - 'Fahkwang' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Fanwood Text' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Farro' => array( - 'variants' => array( '300', 'regular', '500', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Farsan' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Fascinate' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Fascinate Inline' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Faster One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Fasthand' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Fauna One' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Faustina' => array( - 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Federant' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Federo' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Felipa' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Fenix' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Festive' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Finger Paint' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Fira Code' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'monospace', - ), - ), - array( - 'Fira Mono' => array( - 'variants' => array( 'regular', '500', '700' ), - 'category' => 'monospace', - ), - ), - array( - 'Fira Sans' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Fira Sans Condensed' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Fira Sans Extra Condensed' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Fjalla One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Fjord One' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Flamenco' => array( - 'variants' => array( '300', 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Flavors' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Fondamento' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'handwriting', - ), - ), - array( - 'Fontdiner Swanky' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Forum' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Francois One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Frank Ruhl Libre' => array( - 'variants' => array( '300', 'regular', '500', '700', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Fraunces' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Freckle Face' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Fredericka the Great' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Fredoka One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Freehand' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Fresca' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Frijole' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Fruktur' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Fugaz One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Fuggles' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'GFS Didot' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'GFS Neohellenic' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Gabriela' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Gaegu' => array( - 'variants' => array( '300', 'regular', '700' ), - 'category' => 'handwriting', - ), - ), - array( - 'Gafata' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Galada' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Galdeano' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Galindo' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Gamja Flower' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Gayathri' => array( - 'variants' => array( '100', 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Gelasio' => array( - 'variants' => array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Gentium Basic' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Gentium Book Basic' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Geo' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Geostar' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Geostar Fill' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Germania One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Gidugu' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Gilda Display' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Girassol' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Give You Glory' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Glass Antiqua' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Glegoo' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Gloria Hallelujah' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Goblin One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Gochi Hand' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Goldman' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Gorditas' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Gothic A1' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Gotu' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Goudy Bookletter 1911' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Graduate' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Grand Hotel' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Grandstander' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'display', - ), - ), - array( - 'Gravitas One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Great Vibes' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Grenze' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Grenze Gotisch' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'display', - ), - ), - array( - 'Griffy' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Gruppo' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Gudea' => array( - 'variants' => array( 'regular', 'italic', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Gugi' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Gupter' => array( - 'variants' => array( 'regular', '500', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Gurajada' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Habibi' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Hachi Maru Pop' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Halant' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Hammersmith One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Hanalei' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Hanalei Fill' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Handlee' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Hanuman' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Happy Monkey' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Harmattan' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Headland One' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Heebo' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Henny Penny' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Hepta Slab' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Herr Von Muellerhoff' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Hi Melody' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Hind' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Hind Guntur' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Hind Madurai' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Hind Siliguri' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Hind Vadodara' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Holtwood One SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Homemade Apple' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Homenaje' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'IBM Plex Mono' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'monospace', - ), - ), - array( - 'IBM Plex Sans' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'IBM Plex Sans Condensed' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'IBM Plex Serif' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'IM Fell DW Pica' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'IM Fell DW Pica SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'IM Fell Double Pica' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'IM Fell Double Pica SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'IM Fell English' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'IM Fell English SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'IM Fell French Canon' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'IM Fell French Canon SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'IM Fell Great Primer' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'IM Fell Great Primer SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Ibarra Real Nova' => array( - 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Iceberg' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Iceland' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Imbue' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Imprima' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Inconsolata' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'monospace', - ), - ), - array( - 'Inder' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Indie Flower' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Inika' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Inknut Antiqua' => array( - 'variants' => array( '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Inria Sans' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Inria Serif' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Inter' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Irish Grover' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Istok Web' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Italiana' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Italianno' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Itim' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Jacques Francois' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Jacques Francois Shadow' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Jaldi' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'JetBrains Mono' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic' ), - 'category' => 'monospace', - ), - ), - array( - 'Jim Nightshade' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Jockey One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Jolly Lodger' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Jomhuria' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Jomolhari' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Josefin Sans' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Josefin Slab' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Jost' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Joti One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Jua' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Judson' => array( - 'variants' => array( 'regular', 'italic', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Julee' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Julius Sans One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Junge' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Jura' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Just Another Hand' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Just Me Again Down Here' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'K2D' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kadwa' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Kalam' => array( - 'variants' => array( '300', 'regular', '700' ), - 'category' => 'handwriting', - ), - ), - array( - 'Kameron' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Kanit' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kantumruy' => array( - 'variants' => array( '300', 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Karantina' => array( - 'variants' => array( '300', 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Karla' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Karma' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Katibeh' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Kaushan Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Kavivanar' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Kavoon' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Kdam Thmor' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Keania One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Kelly Slab' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Kenia' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Khand' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Khmer' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Khula' => array( - 'variants' => array( '300', 'regular', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kirang Haerang' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Kite One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kiwi Maru' => array( - 'variants' => array( '300', 'regular', '500' ), - 'category' => 'serif', - ), - ), - array( - 'Knewave' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'KoHo' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kodchasan' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kosugi' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kosugi Maru' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kotta One' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Koulen' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Kranky' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Kreon' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Kristi' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Krona One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Krub' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kufam' => array( - 'variants' => array( 'regular', '500', '600', '700', '800', '900', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kulim Park' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kumar One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Kumar One Outline' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Kumbh Sans' => array( - 'variants' => array( '300', 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Kurale' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'La Belle Aurore' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Lacquer' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Laila' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Lakki Reddy' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Lalezar' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Lancelot' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Langar' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Lateef' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Lato' => array( - 'variants' => array( '100', '100italic', '300', '300italic', 'regular', 'italic', '700', '700italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'League Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Leckerli One' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Ledger' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Lekton' => array( - 'variants' => array( 'regular', 'italic', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Lemon' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Lemonada' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'display', - ), - ), - array( - 'Lexend' => array( - 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Lexend Deca' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Lexend Exa' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Lexend Giga' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Lexend Mega' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Lexend Peta' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Lexend Tera' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Lexend Zetta' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Libre Barcode 128' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Libre Barcode 128 Text' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Libre Barcode 39' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Libre Barcode 39 Extended' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Libre Barcode 39 Extended Text' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Libre Barcode 39 Text' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Libre Barcode EAN13 Text' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Libre Baskerville' => array( - 'variants' => array( 'regular', 'italic', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Libre Caslon Display' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Libre Caslon Text' => array( - 'variants' => array( 'regular', 'italic', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Libre Franklin' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Life Savers' => array( - 'variants' => array( 'regular', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Lilita One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Lily Script One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Limelight' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Linden Hill' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Literata' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '900', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Liu Jian Mao Cao' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Livvic' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Lobster' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Lobster Two' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'display', - ), - ), - array( - 'Londrina Outline' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Londrina Shadow' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Londrina Sketch' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Londrina Solid' => array( - 'variants' => array( '100', '300', 'regular', '900' ), - 'category' => 'display', - ), - ), - array( - 'Long Cang' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Lora' => array( - 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Love Ya Like A Sister' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Loved by the King' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Lovers Quarrel' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Luckiest Guy' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Lusitana' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Lustria' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'M PLUS 1p' => array( - 'variants' => array( '100', '300', 'regular', '500', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'M PLUS Rounded 1c' => array( - 'variants' => array( '100', '300', 'regular', '500', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Ma Shan Zheng' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Macondo' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Macondo Swash Caps' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Mada' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Magra' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Maiden Orange' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Maitree' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Major Mono Display' => array( - 'variants' => array( 'regular' ), - 'category' => 'monospace', - ), - ), - array( - 'Mako' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Mali' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'handwriting', - ), - ), - array( - 'Mallanna' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Mandali' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Manjari' => array( - 'variants' => array( '100', 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Manrope' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Mansalva' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Manuale' => array( - 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Marcellus' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Marcellus SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Marck Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Margarine' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Markazi Text' => array( - 'variants' => array( 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Marko One' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Marmelad' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Martel' => array( - 'variants' => array( '200', '300', 'regular', '600', '700', '800', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Martel Sans' => array( - 'variants' => array( '200', '300', 'regular', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Marvel' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Mate' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Mate SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Maven Pro' => array( - 'variants' => array( 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'McLaren' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Meddon' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'MedievalSharp' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Medula One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Meera Inimai' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Megrim' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Meie Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Merienda' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'handwriting', - ), - ), - array( - 'Merienda One' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Merriweather' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic', '900', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Merriweather Sans' => array( - 'variants' => array( '300', 'regular', '500', '600', '700', '800', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Metal' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Metal Mania' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Metamorphous' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Metrophobic' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Michroma' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Milonga' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Miltonian' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Miltonian Tattoo' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Mina' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Miniver' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Miriam Libre' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Mirza' => array( - 'variants' => array( 'regular', '500', '600', '700' ), - 'category' => 'display', - ), - ), - array( - 'Miss Fajardose' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Mitr' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Modak' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Modern Antiqua' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Mogra' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Molengo' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Molle' => array( - 'variants' => array( 'italic' ), - 'category' => 'handwriting', - ), - ), - array( - 'Monda' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Monofett' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Monoton' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Monsieur La Doulaise' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Montaga' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Montez' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Montserrat' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Montserrat Alternates' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Montserrat Subrayada' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Moul' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Moulpali' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Mountains of Christmas' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Mouse Memoirs' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Mr Bedfort' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Mr Dafoe' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Mr De Haviland' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Mrs Saint Delafield' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Mrs Sheppards' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Mukta' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Mukta Mahee' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Mukta Malar' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Mukta Vaani' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Mulish' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '900', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'MuseoModerno' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'display', - ), - ), - array( - 'Mystery Quest' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'NTR' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Nanum Brush Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Nanum Gothic' => array( - 'variants' => array( 'regular', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Nanum Gothic Coding' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'monospace', - ), - ), - array( - 'Nanum Myeongjo' => array( - 'variants' => array( 'regular', '700', '800' ), - 'category' => 'serif', - ), - ), - array( - 'Nanum Pen Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Nerko One' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Neucha' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Neuton' => array( - 'variants' => array( '200', '300', 'regular', 'italic', '700', '800' ), - 'category' => 'serif', - ), - ), - array( - 'New Rocker' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'New Tegomin' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'News Cycle' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Newsreader' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic' ), - 'category' => 'serif', - ), - ), - array( - 'Niconne' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Niramit' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Nixie One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Nobile' => array( - 'variants' => array( 'regular', 'italic', '500', '500italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Nokora' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Norican' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Nosifer' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Notable' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Nothing You Could Do' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Noticia Text' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Noto Sans' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Noto Sans HK' => array( - 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Noto Sans JP' => array( - 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Noto Sans KR' => array( - 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Noto Sans SC' => array( - 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Noto Sans TC' => array( - 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Noto Serif' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Noto Serif JP' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Noto Serif KR' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Noto Serif SC' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Noto Serif TC' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Nova Cut' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Nova Flat' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Nova Mono' => array( - 'variants' => array( 'regular' ), - 'category' => 'monospace', - ), - ), - array( - 'Nova Oval' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Nova Round' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Nova Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Nova Slim' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Nova Square' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Numans' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Nunito' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Nunito Sans' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Odibee Sans' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Odor Mean Chey' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Offside' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Oi' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Old Standard TT' => array( - 'variants' => array( 'regular', 'italic', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Oldenburg' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Oleo Script' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Oleo Script Swash Caps' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Open Sans' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '800', '800italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Open Sans Condensed' => array( - 'variants' => array( '300', '300italic', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Oranienbaum' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Orbitron' => array( - 'variants' => array( 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Oregano' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'display', - ), - ), - array( - 'Orelega One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Orienta' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Original Surfer' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Oswald' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Otomanopee One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Over the Rainbow' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Overlock' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic', '900', '900italic' ), - 'category' => 'display', - ), - ), - array( - 'Overlock SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Overpass' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Overpass Mono' => array( - 'variants' => array( '300', 'regular', '600', '700' ), - 'category' => 'monospace', - ), - ), - array( - 'Ovo' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Oxanium' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Oxygen' => array( - 'variants' => array( '300', 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Oxygen Mono' => array( - 'variants' => array( 'regular' ), - 'category' => 'monospace', - ), - ), - array( - 'PT Mono' => array( - 'variants' => array( 'regular' ), - 'category' => 'monospace', - ), - ), - array( - 'PT Sans' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'PT Sans Caption' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'PT Sans Narrow' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'PT Serif' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'PT Serif Caption' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Pacifico' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Padauk' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Palanquin' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Palanquin Dark' => array( - 'variants' => array( 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Pangolin' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Paprika' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Parisienne' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Passero One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Passion One' => array( - 'variants' => array( 'regular', '700', '900' ), - 'category' => 'display', - ), - ), - array( - 'Pathway Gothic One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Patrick Hand' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Patrick Hand SC' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Pattaya' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Patua One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Pavanam' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Paytone One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Peddana' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Peralta' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Permanent Marker' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Petit Formal Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Petrona' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Philosopher' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Piazzolla' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Piedra' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Pinyon Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Pirata One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Plaster' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Play' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Playball' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Playfair Display' => array( - 'variants' => array( 'regular', '500', '600', '700', '800', '900', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Playfair Display SC' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic', '900', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Podkova' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'serif', - ), - ), - array( - 'Poiret One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Poller One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Poly' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Pompiere' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Pontano Sans' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Poor Story' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Poppins' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Port Lligat Sans' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Port Lligat Slab' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Potta One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Pragati Narrow' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Prata' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Preahvihear' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Press Start 2P' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Pridi' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Princess Sofia' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Prociono' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Prompt' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Prosto One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Proza Libre' => array( - 'variants' => array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Public Sans' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Puritan' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Purple Purse' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Qahiri' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Quando' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Quantico' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Quattrocento' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Quattrocento Sans' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Questrial' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Quicksand' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Quintessential' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Qwigley' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Racing Sans One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Radley' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Rajdhani' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Rakkas' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Raleway' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Raleway Dots' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Ramabhadra' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Ramaraja' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Rambla' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Rammetto One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Ranchers' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Rancho' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Ranga' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Rasa' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Rationale' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Ravi Prakash' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Recursive' => array( - 'variants' => array( '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Red Hat Display' => array( - 'variants' => array( 'regular', 'italic', '500', '500italic', '700', '700italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Red Hat Text' => array( - 'variants' => array( 'regular', 'italic', '500', '500italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Red Rose' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'display', - ), - ), - array( - 'Redressed' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Reem Kufi' => array( - 'variants' => array( 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Reenie Beanie' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Reggae One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Revalia' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Rhodium Libre' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Ribeye' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Ribeye Marrow' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Righteous' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Risque' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Roboto' => array( - 'variants' => array( '100', '100italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '700', '700italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Roboto Condensed' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Roboto Mono' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'monospace', - ), - ), - array( - 'Roboto Slab' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Rochester' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Rock Salt' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'RocknRoll One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Rokkitt' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Romanesco' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Ropa Sans' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Rosario' => array( - 'variants' => array( '300', 'regular', '500', '600', '700', '300italic', 'italic', '500italic', '600italic', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Rosarivo' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Rouge Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Rowdies' => array( - 'variants' => array( '300', 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Rozha One' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Rubik' => array( - 'variants' => array( '300', 'regular', '500', '600', '700', '800', '900', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Rubik Mono One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Ruda' => array( - 'variants' => array( 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Rufina' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Ruge Boogie' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Ruluko' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Rum Raisin' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Ruslan Display' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Russo One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Ruthie' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Rye' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'STIX Two Math' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Sacramento' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Sahitya' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Sail' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Saira' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Saira Condensed' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Saira Extra Condensed' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Saira Semi Condensed' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Saira Stencil One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Salsa' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Sanchez' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Sancreek' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Sansita' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Sansita Swashed' => array( - 'variants' => array( '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'display', - ), - ), - array( - 'Sarabun' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Sarala' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Sarina' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Sarpanch' => array( - 'variants' => array( 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Satisfy' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Sawarabi Gothic' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Sawarabi Mincho' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Scada' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Scheherazade' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Schoolbell' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Scope One' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Seaweed Script' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Secular One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Sedgwick Ave' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Sedgwick Ave Display' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Sen' => array( - 'variants' => array( 'regular', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Sevillana' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Seymour One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Shadows Into Light' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Shadows Into Light Two' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Shanti' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Share' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'display', - ), - ), - array( - 'Share Tech' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Share Tech Mono' => array( - 'variants' => array( 'regular' ), - 'category' => 'monospace', - ), - ), - array( - 'Shippori Mincho' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'serif', - ), - ), - array( - 'Shippori Mincho B1' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'serif', - ), - ), - array( - 'Shojumaru' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Short Stack' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Shrikhand' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Siemreap' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Sigmar One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Signika' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Signika Negative' => array( - 'variants' => array( '300', 'regular', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Simonetta' => array( - 'variants' => array( 'regular', 'italic', '900', '900italic' ), - 'category' => 'display', - ), - ), - array( - 'Single Day' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Sintony' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Sirin Stencil' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Six Caps' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Skranji' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Slabo 13px' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Slabo 27px' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Slackey' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Smokum' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Smythe' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Sniglet' => array( - 'variants' => array( 'regular', '800' ), - 'category' => 'display', - ), - ), - array( - 'Snippet' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Snowburst One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Sofadi One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Sofia' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Solway' => array( - 'variants' => array( '300', 'regular', '500', '700', '800' ), - 'category' => 'serif', - ), - ), - array( - 'Song Myung' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Sonsie One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Sora' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Sorts Mill Goudy' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'serif', - ), - ), - array( - 'Source Code Pro' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '900', '900italic' ), - 'category' => 'monospace', - ), - ), - array( - 'Source Sans Pro' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Source Serif Pro' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '900', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Space Grotesk' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Space Mono' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'monospace', - ), - ), - array( - 'Spartan' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Special Elite' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Spectral' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), - 'category' => 'serif', - ), - ), - array( - 'Spectral SC' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), - 'category' => 'serif', - ), - ), - array( - 'Spicy Rice' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Spinnaker' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Spirax' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Squada One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Sree Krushnadevaraya' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Sriracha' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Srisakdi' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Staatliches' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Stalemate' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Stalinist One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Stardos Stencil' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Stick' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Stint Ultra Condensed' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Stint Ultra Expanded' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Stoke' => array( - 'variants' => array( '300', 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Strait' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Stylish' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Sue Ellen Francisco' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Suez One' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Sulphur Point' => array( - 'variants' => array( '300', 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Sumana' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Sunflower' => array( - 'variants' => array( '300', '500', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Sunshiney' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Supermercado One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Sura' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Suranna' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Suravaram' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Suwannaphum' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Swanky and Moo Moo' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Syncopate' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Syne' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Syne Mono' => array( - 'variants' => array( 'regular' ), - 'category' => 'monospace', - ), - ), - array( - 'Syne Tactile' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Tajawal' => array( - 'variants' => array( '200', '300', 'regular', '500', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Tangerine' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'handwriting', - ), - ), - array( - 'Taprom' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Tauri' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Taviraj' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Teko' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Telex' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Tenali Ramakrishna' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Tenor Sans' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Text Me One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Texturina' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Thasadith' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'The Girl Next Door' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Tienne' => array( - 'variants' => array( 'regular', '700', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Tillana' => array( - 'variants' => array( 'regular', '500', '600', '700', '800' ), - 'category' => 'handwriting', - ), - ), - array( - 'Timmana' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Tinos' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Titan One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Titillium Web' => array( - 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Tomorrow' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Tourney' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'display', - ), - ), - array( - 'Trade Winds' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Train One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Trirong' => array( - 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Trispace' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Trocchi' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Trochut' => array( - 'variants' => array( 'regular', 'italic', '700' ), - 'category' => 'display', - ), - ), - array( - 'Truculenta' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Trykker' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Tulpen One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Turret Road' => array( - 'variants' => array( '200', '300', 'regular', '500', '700', '800' ), - 'category' => 'display', - ), - ), - array( - 'Ubuntu' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '700', '700italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Ubuntu Condensed' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Ubuntu Mono' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'monospace', - ), - ), - array( - 'Uchen' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Ultra' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Uncial Antiqua' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Underdog' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Unica One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'UnifrakturCook' => array( - 'variants' => array( '700' ), - 'category' => 'display', - ), - ), - array( - 'UnifrakturMaguntia' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Unkempt' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), - array( - 'Unlock' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Unna' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'VT323' => array( - 'variants' => array( 'regular' ), - 'category' => 'monospace', - ), - ), - array( - 'Vampiro One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Varela' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Varela Round' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Varta' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Vast Shadow' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Vesper Libre' => array( - 'variants' => array( 'regular', '500', '700', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Viaoda Libre' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Vibes' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Vibur' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Vidaloka' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Viga' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Voces' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Volkhov' => array( - 'variants' => array( 'regular', 'italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Vollkorn' => array( - 'variants' => array( 'regular', '500', '600', '700', '800', '900', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'serif', - ), - ), - array( - 'Vollkorn SC' => array( - 'variants' => array( 'regular', '600', '700', '900' ), - 'category' => 'serif', - ), - ), - array( - 'Voltaire' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Waiting for the Sunrise' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Wallpoet' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Walter Turncoat' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Warnes' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Wellfleet' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Wendy One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Wire One' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Work Sans' => array( - 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Xanh Mono' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'monospace', - ), - ), - array( - 'Yanone Kaffeesatz' => array( - 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Yantramanav' => array( - 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), - 'category' => 'sans-serif', - ), - ), - array( - 'Yatra One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Yellowtail' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Yeon Sung' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Yeseva One' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Yesteryear' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Yomogi' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Yrsa' => array( - 'variants' => array( '300', 'regular', '500', '600', '700' ), - 'category' => 'serif', - ), - ), - array( - 'Yusei Magic' => array( - 'variants' => array( 'regular' ), - 'category' => 'sans-serif', - ), - ), - array( - 'ZCOOL KuaiLe' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'ZCOOL QingKe HuangYou' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'ZCOOL XiaoWei' => array( - 'variants' => array( 'regular' ), - 'category' => 'serif', - ), - ), - array( - 'Zen Dots' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Zen Loop' => array( - 'variants' => array( 'regular', 'italic' ), - 'category' => 'display', - ), - ), - array( - 'Zen Tokyo Zoo' => array( - 'variants' => array( 'regular' ), - 'category' => 'display', - ), - ), - array( - 'Zeyada' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Zhi Mang Xing' => array( - 'variants' => array( 'regular' ), - 'category' => 'handwriting', - ), - ), - array( - 'Zilla Slab' => array( - 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), - 'category' => 'serif', - ), - ), - array( - 'Zilla Slab Highlight' => array( - 'variants' => array( 'regular', '700' ), - 'category' => 'display', - ), - ), -); + array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Abel' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Abhaya Libre' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'serif', + ), + ), + array( + 'Abril Fatface' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Aclonica' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Acme' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Actor' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Adamina' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Advent Pro' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Aguafina Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Akaya Kanadaka' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Akaya Telivigala' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Akronim' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Aladin' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Alata' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Alatsi' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Aldrich' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Alef' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Alegreya' => array( + 'variants' => array( 'regular', '500', '600', '700', '800', '900', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Alegreya SC' => array( + 'variants' => array( 'regular', 'italic', '500', '500italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Alegreya Sans' => array( + 'variants' => array( '100', '100italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Alegreya Sans SC' => array( + 'variants' => array( '100', '100italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Aleo' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Alex Brush' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Alfa Slab One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Alice' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Alike' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Alike Angular' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Allan' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Allerta' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Allerta Stencil' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Allura' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Almarai' => array( + 'variants' => array( '300', 'regular', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Almendra' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Almendra Display' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Almendra SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Amarante' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Amaranth' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Amatic SC' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'handwriting', + ), + ), + array( + 'Amethysta' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Amiko' => array( + 'variants' => array( 'regular', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Amiri' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Amita' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'handwriting', + ), + ), + array( + 'Anaheim' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Andada' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Andika' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Andika New Basic' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Angkor' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Annie Use Your Telescope' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Anonymous Pro' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'monospace', + ), + ), + array( + 'Antic' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Antic Didone' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Antic Slab' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Anton' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Antonio' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Arapey' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Arbutus' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Arbutus Slab' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Architects Daughter' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Archivo' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Archivo Black' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Archivo Narrow' => array( + 'variants' => array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Aref Ruqaa' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Arima Madurai' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '700', '800', '900' ), + 'category' => 'display', + ), + ), + array( + 'Arimo' => array( + 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Arizonia' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Armata' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Arsenal' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Artifika' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Arvo' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Arya' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Asap' => array( + 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Asap Condensed' => array( + 'variants' => array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Asar' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Asset' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Assistant' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Astloch' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Asul' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Athiti' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Atma' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'display', + ), + ), + array( + 'Atomic Age' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Aubrey' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Audiowide' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Autour One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Average' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Average Sans' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Averia Gruesa Libre' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Averia Libre' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), + 'category' => 'display', + ), + ), + array( + 'Averia Sans Libre' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), + 'category' => 'display', + ), + ), + array( + 'Averia Serif Libre' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), + 'category' => 'display', + ), + ), + array( + 'B612' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'B612 Mono' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'monospace', + ), + ), + array( + 'Bad Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Bahiana' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bahianita' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bai Jamjuree' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Ballet' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Baloo 2' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Baloo Bhai 2' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Baloo Bhaina 2' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Baloo Chettan 2' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Baloo Da 2' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Baloo Paaji 2' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Baloo Tamma 2' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Baloo Tammudu 2' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Baloo Thambi 2' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Balsamiq Sans' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'display', + ), + ), + array( + 'Balthazar' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Bangers' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Barlow' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Barlow Condensed' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Barlow Semi Condensed' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Barriecito' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Barrio' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Basic' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Baskervville' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Battambang' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Baumans' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bayon' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Be Vietnam' => array( + 'variants' => array( '100', '100italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Bebas Neue' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Belgrano' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Bellefair' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Belleza' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Bellota' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), + 'category' => 'display', + ), + ), + array( + 'Bellota Text' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), + 'category' => 'display', + ), + ), + array( + 'BenchNine' => array( + 'variants' => array( '300', 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Benne' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Bentham' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Berkshire Swash' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Beth Ellen' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Bevan' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Big Shoulders Display' => array( + 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'display', + ), + ), + array( + 'Big Shoulders Inline Display' => array( + 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'display', + ), + ), + array( + 'Big Shoulders Inline Text' => array( + 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'display', + ), + ), + array( + 'Big Shoulders Stencil Display' => array( + 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'display', + ), + ), + array( + 'Big Shoulders Stencil Text' => array( + 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'display', + ), + ), + array( + 'Big Shoulders Text' => array( + 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'display', + ), + ), + array( + 'Bigelow Rules' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bigshot One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bilbo' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Bilbo Swash Caps' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'BioRhyme' => array( + 'variants' => array( '200', '300', 'regular', '700', '800' ), + 'category' => 'serif', + ), + ), + array( + 'BioRhyme Expanded' => array( + 'variants' => array( '200', '300', 'regular', '700', '800' ), + 'category' => 'serif', + ), + ), + array( + 'Biryani' => array( + 'variants' => array( '200', '300', 'regular', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Bitter' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Black And White Picture' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Black Han Sans' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Black Ops One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Blinker' => array( + 'variants' => array( '100', '200', '300', 'regular', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Bodoni Moda' => array( + 'variants' => array( 'regular', '500', '600', '700', '800', '900', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Bokor' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bona Nova' => array( + 'variants' => array( 'regular', 'italic', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Bonbon' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Boogaloo' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bowlby One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bowlby One SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Brawler' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Bree Serif' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Brygada 1918' => array( + 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Bubblegum Sans' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bubbler One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Buda' => array( + 'variants' => array( '300' ), + 'category' => 'display', + ), + ), + array( + 'Buenard' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Bungee' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bungee Hairline' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bungee Inline' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bungee Outline' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Bungee Shade' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Butcherman' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Butterfly Kids' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Cabin' => array( + 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Cabin Condensed' => array( + 'variants' => array( 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Cabin Sketch' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Caesar Dressing' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Cagliostro' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Cairo' => array( + 'variants' => array( '200', '300', 'regular', '600', '700', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Caladea' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Calistoga' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Calligraffitti' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Cambay' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Cambo' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Candal' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Cantarell' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Cantata One' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Cantora One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Capriola' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Cardo' => array( + 'variants' => array( 'regular', 'italic', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Carme' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Carrois Gothic' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Carrois Gothic SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Carter One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Castoro' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Catamaran' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Caudex' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Caveat' => array( + 'variants' => array( 'regular', '500', '600', '700' ), + 'category' => 'handwriting', + ), + ), + array( + 'Caveat Brush' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Cedarville Cursive' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Ceviche One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Chakra Petch' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Changa' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Changa One' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'display', + ), + ), + array( + 'Chango' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Charm' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'handwriting', + ), + ), + array( + 'Charmonman' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'handwriting', + ), + ), + array( + 'Chathura' => array( + 'variants' => array( '100', '300', 'regular', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Chau Philomene One' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Chela One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Chelsea Market' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Chenla' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Cherry Cream Soda' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Cherry Swash' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Chewy' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Chicle' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Chilanka' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Chivo' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Chonburi' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Cinzel' => array( + 'variants' => array( 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Cinzel Decorative' => array( + 'variants' => array( 'regular', '700', '900' ), + 'category' => 'display', + ), + ), + array( + 'Clicker Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Coda' => array( + 'variants' => array( 'regular', '800' ), + 'category' => 'display', + ), + ), + array( + 'Coda Caption' => array( + 'variants' => array( '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Codystar' => array( + 'variants' => array( '300', 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Coiny' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Combo' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Comfortaa' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'display', + ), + ), + array( + 'Comic Neue' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), + 'category' => 'handwriting', + ), + ), + array( + 'Coming Soon' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Commissioner' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Concert One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Condiment' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Content' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Contrail One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Convergence' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Cookie' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Copse' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Corben' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Cormorant' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Cormorant Garamond' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Cormorant Infant' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Cormorant SC' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Cormorant Unicase' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Cormorant Upright' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Courgette' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Courier Prime' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'monospace', + ), + ), + array( + 'Cousine' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'monospace', + ), + ), + array( + 'Coustard' => array( + 'variants' => array( 'regular', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Covered By Your Grace' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Crafty Girls' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Creepster' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Crete Round' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Crimson Pro' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '900', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Crimson Text' => array( + 'variants' => array( 'regular', 'italic', '600', '600italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Croissant One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Crushed' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Cuprum' => array( + 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Cute Font' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Cutive' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Cutive Mono' => array( + 'variants' => array( 'regular' ), + 'category' => 'monospace', + ), + ), + array( + 'DM Mono' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic' ), + 'category' => 'monospace', + ), + ), + array( + 'DM Sans' => array( + 'variants' => array( 'regular', 'italic', '500', '500italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'DM Serif Display' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'DM Serif Text' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Damion' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Dancing Script' => array( + 'variants' => array( 'regular', '500', '600', '700' ), + 'category' => 'handwriting', + ), + ), + array( + 'Dangrek' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Darker Grotesque' => array( + 'variants' => array( '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'David Libre' => array( + 'variants' => array( 'regular', '500', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Dawning of a New Day' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Days One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Dekko' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Dela Gothic One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Delius' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Delius Swash Caps' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Delius Unicase' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'handwriting', + ), + ), + array( + 'Della Respira' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Denk One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Devonshire' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Dhurjati' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Didact Gothic' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Diplomata' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Diplomata SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Do Hyeon' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Dokdo' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Domine' => array( + 'variants' => array( 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Donegal One' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Doppio One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Dorsa' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Dosis' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'DotGothic16' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Dr Sugiyama' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Duru Sans' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Dynalight' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'EB Garamond' => array( + 'variants' => array( 'regular', '500', '600', '700', '800', 'italic', '500italic', '600italic', '700italic', '800italic' ), + 'category' => 'serif', + ), + ), + array( + 'Eagle Lake' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'East Sea Dokdo' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Eater' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Economica' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Eczar' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'serif', + ), + ), + array( + 'El Messiri' => array( + 'variants' => array( 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Electrolize' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Elsie' => array( + 'variants' => array( 'regular', '900' ), + 'category' => 'display', + ), + ), + array( + 'Elsie Swash Caps' => array( + 'variants' => array( 'regular', '900' ), + 'category' => 'display', + ), + ), + array( + 'Emblema One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Emilys Candy' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Encode Sans' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Encode Sans Condensed' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Encode Sans Expanded' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Encode Sans SC' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Encode Sans Semi Condensed' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Encode Sans Semi Expanded' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Engagement' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Englebert' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Enriqueta' => array( + 'variants' => array( 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Epilogue' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Erica One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Esteban' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Euphoria Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Ewert' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Exo' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Exo 2' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Expletus Sans' => array( + 'variants' => array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'display', + ), + ), + array( + 'Fahkwang' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Fanwood Text' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Farro' => array( + 'variants' => array( '300', 'regular', '500', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Farsan' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Fascinate' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Fascinate Inline' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Faster One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Fasthand' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Fauna One' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Faustina' => array( + 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Federant' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Federo' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Felipa' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Fenix' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Festive' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Finger Paint' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Fira Code' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'monospace', + ), + ), + array( + 'Fira Mono' => array( + 'variants' => array( 'regular', '500', '700' ), + 'category' => 'monospace', + ), + ), + array( + 'Fira Sans' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Fira Sans Condensed' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Fira Sans Extra Condensed' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Fjalla One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Fjord One' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Flamenco' => array( + 'variants' => array( '300', 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Flavors' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Fondamento' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'handwriting', + ), + ), + array( + 'Fontdiner Swanky' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Forum' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Francois One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Frank Ruhl Libre' => array( + 'variants' => array( '300', 'regular', '500', '700', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Fraunces' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Freckle Face' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Fredericka the Great' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Fredoka One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Freehand' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Fresca' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Frijole' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Fruktur' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Fugaz One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Fuggles' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'GFS Didot' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'GFS Neohellenic' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Gabriela' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Gaegu' => array( + 'variants' => array( '300', 'regular', '700' ), + 'category' => 'handwriting', + ), + ), + array( + 'Gafata' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Galada' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Galdeano' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Galindo' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Gamja Flower' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Gayathri' => array( + 'variants' => array( '100', 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Gelasio' => array( + 'variants' => array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Gentium Basic' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Gentium Book Basic' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Geo' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Geostar' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Geostar Fill' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Germania One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Gidugu' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Gilda Display' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Girassol' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Give You Glory' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Glass Antiqua' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Glegoo' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Gloria Hallelujah' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Goblin One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Gochi Hand' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Goldman' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Gorditas' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Gothic A1' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Gotu' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Goudy Bookletter 1911' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Graduate' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Grand Hotel' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Grandstander' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'display', + ), + ), + array( + 'Gravitas One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Great Vibes' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Grenze' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Grenze Gotisch' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'display', + ), + ), + array( + 'Griffy' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Gruppo' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Gudea' => array( + 'variants' => array( 'regular', 'italic', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Gugi' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Gupter' => array( + 'variants' => array( 'regular', '500', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Gurajada' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Habibi' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Hachi Maru Pop' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Halant' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Hammersmith One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Hanalei' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Hanalei Fill' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Handlee' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Hanuman' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Happy Monkey' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Harmattan' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Headland One' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Heebo' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Henny Penny' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Hepta Slab' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Herr Von Muellerhoff' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Hi Melody' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Hind' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Hind Guntur' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Hind Madurai' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Hind Siliguri' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Hind Vadodara' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Holtwood One SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Homemade Apple' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Homenaje' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'IBM Plex Mono' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'monospace', + ), + ), + array( + 'IBM Plex Sans' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'IBM Plex Sans Condensed' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'IBM Plex Serif' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'IM Fell DW Pica' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'IM Fell DW Pica SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'IM Fell Double Pica' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'IM Fell Double Pica SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'IM Fell English' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'IM Fell English SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'IM Fell French Canon' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'IM Fell French Canon SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'IM Fell Great Primer' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'IM Fell Great Primer SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Ibarra Real Nova' => array( + 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Iceberg' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Iceland' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Imbue' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Imprima' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Inconsolata' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'monospace', + ), + ), + array( + 'Inder' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Indie Flower' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Inika' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Inknut Antiqua' => array( + 'variants' => array( '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Inria Sans' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Inria Serif' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Inter' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Irish Grover' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Istok Web' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Italiana' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Italianno' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Itim' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Jacques Francois' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Jacques Francois Shadow' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Jaldi' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'JetBrains Mono' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic' ), + 'category' => 'monospace', + ), + ), + array( + 'Jim Nightshade' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Jockey One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Jolly Lodger' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Jomhuria' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Jomolhari' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Josefin Sans' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Josefin Slab' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Jost' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Joti One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Jua' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Judson' => array( + 'variants' => array( 'regular', 'italic', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Julee' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Julius Sans One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Junge' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Jura' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Just Another Hand' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Just Me Again Down Here' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'K2D' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kadwa' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Kalam' => array( + 'variants' => array( '300', 'regular', '700' ), + 'category' => 'handwriting', + ), + ), + array( + 'Kameron' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Kanit' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kantumruy' => array( + 'variants' => array( '300', 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Karantina' => array( + 'variants' => array( '300', 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Karla' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Karma' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Katibeh' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Kaushan Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Kavivanar' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Kavoon' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Kdam Thmor' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Keania One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Kelly Slab' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Kenia' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Khand' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Khmer' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Khula' => array( + 'variants' => array( '300', 'regular', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kirang Haerang' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Kite One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kiwi Maru' => array( + 'variants' => array( '300', 'regular', '500' ), + 'category' => 'serif', + ), + ), + array( + 'Knewave' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'KoHo' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kodchasan' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kosugi' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kosugi Maru' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kotta One' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Koulen' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Kranky' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Kreon' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Kristi' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Krona One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Krub' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kufam' => array( + 'variants' => array( 'regular', '500', '600', '700', '800', '900', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kulim Park' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kumar One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Kumar One Outline' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Kumbh Sans' => array( + 'variants' => array( '300', 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Kurale' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'La Belle Aurore' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Lacquer' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Laila' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Lakki Reddy' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Lalezar' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Lancelot' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Langar' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Lateef' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Lato' => array( + 'variants' => array( '100', '100italic', '300', '300italic', 'regular', 'italic', '700', '700italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'League Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Leckerli One' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Ledger' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Lekton' => array( + 'variants' => array( 'regular', 'italic', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Lemon' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Lemonada' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'display', + ), + ), + array( + 'Lexend' => array( + 'variants' => array( '100', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Lexend Deca' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Lexend Exa' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Lexend Giga' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Lexend Mega' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Lexend Peta' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Lexend Tera' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Lexend Zetta' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Libre Barcode 128' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Libre Barcode 128 Text' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Libre Barcode 39' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Libre Barcode 39 Extended' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Libre Barcode 39 Extended Text' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Libre Barcode 39 Text' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Libre Barcode EAN13 Text' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Libre Baskerville' => array( + 'variants' => array( 'regular', 'italic', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Libre Caslon Display' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Libre Caslon Text' => array( + 'variants' => array( 'regular', 'italic', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Libre Franklin' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Life Savers' => array( + 'variants' => array( 'regular', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Lilita One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Lily Script One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Limelight' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Linden Hill' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Literata' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '900', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Liu Jian Mao Cao' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Livvic' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Lobster' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Lobster Two' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'display', + ), + ), + array( + 'Londrina Outline' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Londrina Shadow' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Londrina Sketch' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Londrina Solid' => array( + 'variants' => array( '100', '300', 'regular', '900' ), + 'category' => 'display', + ), + ), + array( + 'Long Cang' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Lora' => array( + 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Love Ya Like A Sister' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Loved by the King' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Lovers Quarrel' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Luckiest Guy' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Lusitana' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Lustria' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'M PLUS 1p' => array( + 'variants' => array( '100', '300', 'regular', '500', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'M PLUS Rounded 1c' => array( + 'variants' => array( '100', '300', 'regular', '500', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Ma Shan Zheng' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Macondo' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Macondo Swash Caps' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Mada' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Magra' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Maiden Orange' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Maitree' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Major Mono Display' => array( + 'variants' => array( 'regular' ), + 'category' => 'monospace', + ), + ), + array( + 'Mako' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Mali' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'handwriting', + ), + ), + array( + 'Mallanna' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Mandali' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Manjari' => array( + 'variants' => array( '100', 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Manrope' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Mansalva' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Manuale' => array( + 'variants' => array( 'regular', '500', '600', '700', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Marcellus' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Marcellus SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Marck Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Margarine' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Markazi Text' => array( + 'variants' => array( 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Marko One' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Marmelad' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Martel' => array( + 'variants' => array( '200', '300', 'regular', '600', '700', '800', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Martel Sans' => array( + 'variants' => array( '200', '300', 'regular', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Marvel' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Mate' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Mate SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Maven Pro' => array( + 'variants' => array( 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'McLaren' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Meddon' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'MedievalSharp' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Medula One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Meera Inimai' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Megrim' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Meie Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Merienda' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'handwriting', + ), + ), + array( + 'Merienda One' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Merriweather' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic', '900', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Merriweather Sans' => array( + 'variants' => array( '300', 'regular', '500', '600', '700', '800', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Metal' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Metal Mania' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Metamorphous' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Metrophobic' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Michroma' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Milonga' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Miltonian' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Miltonian Tattoo' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Mina' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Miniver' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Miriam Libre' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Mirza' => array( + 'variants' => array( 'regular', '500', '600', '700' ), + 'category' => 'display', + ), + ), + array( + 'Miss Fajardose' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Mitr' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Modak' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Modern Antiqua' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Mogra' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Molengo' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Molle' => array( + 'variants' => array( 'italic' ), + 'category' => 'handwriting', + ), + ), + array( + 'Monda' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Monofett' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Monoton' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Monsieur La Doulaise' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Montaga' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Montez' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Montserrat' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Montserrat Alternates' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Montserrat Subrayada' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Moul' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Moulpali' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Mountains of Christmas' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Mouse Memoirs' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Mr Bedfort' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Mr Dafoe' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Mr De Haviland' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Mrs Saint Delafield' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Mrs Sheppards' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Mukta' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Mukta Mahee' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Mukta Malar' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Mukta Vaani' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Mulish' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '900', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'MuseoModerno' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'display', + ), + ), + array( + 'Mystery Quest' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'NTR' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Nanum Brush Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Nanum Gothic' => array( + 'variants' => array( 'regular', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Nanum Gothic Coding' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'monospace', + ), + ), + array( + 'Nanum Myeongjo' => array( + 'variants' => array( 'regular', '700', '800' ), + 'category' => 'serif', + ), + ), + array( + 'Nanum Pen Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Nerko One' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Neucha' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Neuton' => array( + 'variants' => array( '200', '300', 'regular', 'italic', '700', '800' ), + 'category' => 'serif', + ), + ), + array( + 'New Rocker' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'New Tegomin' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'News Cycle' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Newsreader' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic' ), + 'category' => 'serif', + ), + ), + array( + 'Niconne' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Niramit' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Nixie One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Nobile' => array( + 'variants' => array( 'regular', 'italic', '500', '500italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Nokora' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Norican' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Nosifer' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Notable' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Nothing You Could Do' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Noticia Text' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Noto Sans' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Noto Sans HK' => array( + 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Noto Sans JP' => array( + 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Noto Sans KR' => array( + 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Noto Sans SC' => array( + 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Noto Sans TC' => array( + 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Noto Serif' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Noto Serif JP' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Noto Serif KR' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Noto Serif SC' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Noto Serif TC' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Nova Cut' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Nova Flat' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Nova Mono' => array( + 'variants' => array( 'regular' ), + 'category' => 'monospace', + ), + ), + array( + 'Nova Oval' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Nova Round' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Nova Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Nova Slim' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Nova Square' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Numans' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Nunito' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Nunito Sans' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Odibee Sans' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Odor Mean Chey' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Offside' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Oi' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Old Standard TT' => array( + 'variants' => array( 'regular', 'italic', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Oldenburg' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Oleo Script' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Oleo Script Swash Caps' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Open Sans' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '800', '800italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Open Sans Condensed' => array( + 'variants' => array( '300', '300italic', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Oranienbaum' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Orbitron' => array( + 'variants' => array( 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Oregano' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'display', + ), + ), + array( + 'Orelega One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Orienta' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Original Surfer' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Oswald' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Otomanopee One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Over the Rainbow' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Overlock' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic', '900', '900italic' ), + 'category' => 'display', + ), + ), + array( + 'Overlock SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Overpass' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Overpass Mono' => array( + 'variants' => array( '300', 'regular', '600', '700' ), + 'category' => 'monospace', + ), + ), + array( + 'Ovo' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Oxanium' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Oxygen' => array( + 'variants' => array( '300', 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Oxygen Mono' => array( + 'variants' => array( 'regular' ), + 'category' => 'monospace', + ), + ), + array( + 'PT Mono' => array( + 'variants' => array( 'regular' ), + 'category' => 'monospace', + ), + ), + array( + 'PT Sans' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'PT Sans Caption' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'PT Sans Narrow' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'PT Serif' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'PT Serif Caption' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Pacifico' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Padauk' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Palanquin' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Palanquin Dark' => array( + 'variants' => array( 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Pangolin' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Paprika' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Parisienne' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Passero One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Passion One' => array( + 'variants' => array( 'regular', '700', '900' ), + 'category' => 'display', + ), + ), + array( + 'Pathway Gothic One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Patrick Hand' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Patrick Hand SC' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Pattaya' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Patua One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Pavanam' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Paytone One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Peddana' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Peralta' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Permanent Marker' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Petit Formal Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Petrona' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Philosopher' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Piazzolla' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Piedra' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Pinyon Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Pirata One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Plaster' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Play' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Playball' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Playfair Display' => array( + 'variants' => array( 'regular', '500', '600', '700', '800', '900', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Playfair Display SC' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic', '900', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Podkova' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'serif', + ), + ), + array( + 'Poiret One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Poller One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Poly' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Pompiere' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Pontano Sans' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Poor Story' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Poppins' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Port Lligat Sans' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Port Lligat Slab' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Potta One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Pragati Narrow' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Prata' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Preahvihear' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Press Start 2P' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Pridi' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Princess Sofia' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Prociono' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Prompt' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Prosto One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Proza Libre' => array( + 'variants' => array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Public Sans' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Puritan' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Purple Purse' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Qahiri' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Quando' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Quantico' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Quattrocento' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Quattrocento Sans' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Questrial' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Quicksand' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Quintessential' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Qwigley' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Racing Sans One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Radley' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Rajdhani' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Rakkas' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Raleway' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Raleway Dots' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Ramabhadra' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Ramaraja' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Rambla' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Rammetto One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Ranchers' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Rancho' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Ranga' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Rasa' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Rationale' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Ravi Prakash' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Recursive' => array( + 'variants' => array( '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Red Hat Display' => array( + 'variants' => array( 'regular', 'italic', '500', '500italic', '700', '700italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Red Hat Text' => array( + 'variants' => array( 'regular', 'italic', '500', '500italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Red Rose' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'display', + ), + ), + array( + 'Redressed' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Reem Kufi' => array( + 'variants' => array( 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Reenie Beanie' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Reggae One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Revalia' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Rhodium Libre' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Ribeye' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Ribeye Marrow' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Righteous' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Risque' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Roboto' => array( + 'variants' => array( '100', '100italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '700', '700italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Roboto Condensed' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Roboto Mono' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'monospace', + ), + ), + array( + 'Roboto Slab' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Rochester' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Rock Salt' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'RocknRoll One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Rokkitt' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Romanesco' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Ropa Sans' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Rosario' => array( + 'variants' => array( '300', 'regular', '500', '600', '700', '300italic', 'italic', '500italic', '600italic', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Rosarivo' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Rouge Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Rowdies' => array( + 'variants' => array( '300', 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Rozha One' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Rubik' => array( + 'variants' => array( '300', 'regular', '500', '600', '700', '800', '900', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Rubik Mono One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Ruda' => array( + 'variants' => array( 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Rufina' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Ruge Boogie' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Ruluko' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Rum Raisin' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Ruslan Display' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Russo One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Ruthie' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Rye' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'STIX Two Math' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Sacramento' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Sahitya' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Sail' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Saira' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Saira Condensed' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Saira Extra Condensed' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Saira Semi Condensed' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Saira Stencil One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Salsa' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Sanchez' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Sancreek' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Sansita' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Sansita Swashed' => array( + 'variants' => array( '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'display', + ), + ), + array( + 'Sarabun' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Sarala' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Sarina' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Sarpanch' => array( + 'variants' => array( 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Satisfy' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Sawarabi Gothic' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Sawarabi Mincho' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Scada' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Scheherazade' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Schoolbell' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Scope One' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Seaweed Script' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Secular One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Sedgwick Ave' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Sedgwick Ave Display' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Sen' => array( + 'variants' => array( 'regular', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Sevillana' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Seymour One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Shadows Into Light' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Shadows Into Light Two' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Shanti' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Share' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'display', + ), + ), + array( + 'Share Tech' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Share Tech Mono' => array( + 'variants' => array( 'regular' ), + 'category' => 'monospace', + ), + ), + array( + 'Shippori Mincho' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'serif', + ), + ), + array( + 'Shippori Mincho B1' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'serif', + ), + ), + array( + 'Shojumaru' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Short Stack' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Shrikhand' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Siemreap' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Sigmar One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Signika' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Signika Negative' => array( + 'variants' => array( '300', 'regular', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Simonetta' => array( + 'variants' => array( 'regular', 'italic', '900', '900italic' ), + 'category' => 'display', + ), + ), + array( + 'Single Day' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Sintony' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Sirin Stencil' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Six Caps' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Skranji' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Slabo 13px' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Slabo 27px' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Slackey' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Smokum' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Smythe' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Sniglet' => array( + 'variants' => array( 'regular', '800' ), + 'category' => 'display', + ), + ), + array( + 'Snippet' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Snowburst One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Sofadi One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Sofia' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Solway' => array( + 'variants' => array( '300', 'regular', '500', '700', '800' ), + 'category' => 'serif', + ), + ), + array( + 'Song Myung' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Sonsie One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Sora' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Sorts Mill Goudy' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'serif', + ), + ), + array( + 'Source Code Pro' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '900', '900italic' ), + 'category' => 'monospace', + ), + ), + array( + 'Source Sans Pro' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Source Serif Pro' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '900', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Space Grotesk' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Space Mono' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'monospace', + ), + ), + array( + 'Spartan' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Special Elite' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Spectral' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), + 'category' => 'serif', + ), + ), + array( + 'Spectral SC' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' ), + 'category' => 'serif', + ), + ), + array( + 'Spicy Rice' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Spinnaker' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Spirax' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Squada One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Sree Krushnadevaraya' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Sriracha' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Srisakdi' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Staatliches' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Stalemate' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Stalinist One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Stardos Stencil' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Stick' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Stint Ultra Condensed' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Stint Ultra Expanded' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Stoke' => array( + 'variants' => array( '300', 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Strait' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Stylish' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Sue Ellen Francisco' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Suez One' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Sulphur Point' => array( + 'variants' => array( '300', 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Sumana' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Sunflower' => array( + 'variants' => array( '300', '500', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Sunshiney' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Supermercado One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Sura' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Suranna' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Suravaram' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Suwannaphum' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Swanky and Moo Moo' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Syncopate' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Syne' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Syne Mono' => array( + 'variants' => array( 'regular' ), + 'category' => 'monospace', + ), + ), + array( + 'Syne Tactile' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Tajawal' => array( + 'variants' => array( '200', '300', 'regular', '500', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Tangerine' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'handwriting', + ), + ), + array( + 'Taprom' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Tauri' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Taviraj' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Teko' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Telex' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Tenali Ramakrishna' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Tenor Sans' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Text Me One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Texturina' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Thasadith' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'The Girl Next Door' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Tienne' => array( + 'variants' => array( 'regular', '700', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Tillana' => array( + 'variants' => array( 'regular', '500', '600', '700', '800' ), + 'category' => 'handwriting', + ), + ), + array( + 'Timmana' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Tinos' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Titan One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Titillium Web' => array( + 'variants' => array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Tomorrow' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Tourney' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'display', + ), + ), + array( + 'Trade Winds' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Train One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Trirong' => array( + 'variants' => array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Trispace' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Trocchi' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Trochut' => array( + 'variants' => array( 'regular', 'italic', '700' ), + 'category' => 'display', + ), + ), + array( + 'Truculenta' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Trykker' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Tulpen One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Turret Road' => array( + 'variants' => array( '200', '300', 'regular', '500', '700', '800' ), + 'category' => 'display', + ), + ), + array( + 'Ubuntu' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '700', '700italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Ubuntu Condensed' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Ubuntu Mono' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'monospace', + ), + ), + array( + 'Uchen' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Ultra' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Uncial Antiqua' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Underdog' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Unica One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'UnifrakturCook' => array( + 'variants' => array( '700' ), + 'category' => 'display', + ), + ), + array( + 'UnifrakturMaguntia' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Unkempt' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), + array( + 'Unlock' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Unna' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'VT323' => array( + 'variants' => array( 'regular' ), + 'category' => 'monospace', + ), + ), + array( + 'Vampiro One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Varela' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Varela Round' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Varta' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Vast Shadow' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Vesper Libre' => array( + 'variants' => array( 'regular', '500', '700', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Viaoda Libre' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Vibes' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Vibur' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Vidaloka' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Viga' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Voces' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Volkhov' => array( + 'variants' => array( 'regular', 'italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Vollkorn' => array( + 'variants' => array( 'regular', '500', '600', '700', '800', '900', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'serif', + ), + ), + array( + 'Vollkorn SC' => array( + 'variants' => array( 'regular', '600', '700', '900' ), + 'category' => 'serif', + ), + ), + array( + 'Voltaire' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Waiting for the Sunrise' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Wallpoet' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Walter Turncoat' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Warnes' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Wellfleet' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Wendy One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Wire One' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Work Sans' => array( + 'variants' => array( '100', '200', '300', 'regular', '500', '600', '700', '800', '900', '100italic', '200italic', '300italic', 'italic', '500italic', '600italic', '700italic', '800italic', '900italic' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Xanh Mono' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'monospace', + ), + ), + array( + 'Yanone Kaffeesatz' => array( + 'variants' => array( '200', '300', 'regular', '500', '600', '700' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Yantramanav' => array( + 'variants' => array( '100', '300', 'regular', '500', '700', '900' ), + 'category' => 'sans-serif', + ), + ), + array( + 'Yatra One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Yellowtail' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Yeon Sung' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Yeseva One' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Yesteryear' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Yomogi' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Yrsa' => array( + 'variants' => array( '300', 'regular', '500', '600', '700' ), + 'category' => 'serif', + ), + ), + array( + 'Yusei Magic' => array( + 'variants' => array( 'regular' ), + 'category' => 'sans-serif', + ), + ), + array( + 'ZCOOL KuaiLe' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'ZCOOL QingKe HuangYou' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'ZCOOL XiaoWei' => array( + 'variants' => array( 'regular' ), + 'category' => 'serif', + ), + ), + array( + 'Zen Dots' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Zen Loop' => array( + 'variants' => array( 'regular', 'italic' ), + 'category' => 'display', + ), + ), + array( + 'Zen Tokyo Zoo' => array( + 'variants' => array( 'regular' ), + 'category' => 'display', + ), + ), + array( + 'Zeyada' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Zhi Mang Xing' => array( + 'variants' => array( 'regular' ), + 'category' => 'handwriting', + ), + ), + array( + 'Zilla Slab' => array( + 'variants' => array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' ), + 'category' => 'serif', + ), + ), + array( + 'Zilla Slab Highlight' => array( + 'variants' => array( 'regular', '700' ), + 'category' => 'display', + ), + ), +); diff --git a/inc/index.php b/inc/index.php index 8b96815..820bcb9 100644 --- a/inc/index.php +++ b/inc/index.php @@ -1,9 +1,9 @@ -identifier = $this->prefix . '_' . $this->action; - - add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) ); - add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) ); - } - - /** - * Set data used during the request - * - * @param array $data Data. - * - * @return $this - */ - public function data( $data ) { - $this->data = $data; - - return $this; - } - - /** - * Dispatch the async request - * - * @return array|WP_Error - */ - public function dispatch() { - $url = add_query_arg( $this->get_query_args(), $this->get_query_url() ); - $args = $this->get_post_args(); - - return wp_remote_post( esc_url_raw( $url ), $args ); - } - - /** - * Get query args - * - * @return array - */ - protected function get_query_args() { - if ( property_exists( $this, 'query_args' ) ) { - return $this->query_args; - } - - return array( - 'action' => $this->identifier, - 'nonce' => wp_create_nonce( $this->identifier ), - ); - } - - /** - * Get query URL - * - * @return string - */ - protected function get_query_url() { - if ( property_exists( $this, 'query_url' ) ) { - return $this->query_url; - } - - return admin_url( 'admin-ajax.php' ); - } - - /** - * Get post args - * - * @return array - */ - protected function get_post_args() { - if ( property_exists( $this, 'post_args' ) ) { - return $this->post_args; - } - - return array( - 'timeout' => 0.01, - 'blocking' => false, - 'body' => $this->data, - 'cookies' => $_COOKIE, - 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), - ); - } - - /** - * Maybe handle - * - * Check for correct nonce and pass to handler. - */ - public function maybe_handle() { - // Don't lock up other requests while processing - session_write_close(); - - check_ajax_referer( $this->identifier, 'nonce' ); - - $this->handle(); - - wp_die(); - } - - /** - * Handle - * - * Override this method to perform any actions required - * during the async request. - */ - abstract protected function handle(); - - } -} +identifier = $this->prefix . '_' . $this->action; + + add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) ); + add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) ); + } + + /** + * Set data used during the request + * + * @param array $data Data. + * + * @return $this + */ + public function data( $data ) { + $this->data = $data; + + return $this; + } + + /** + * Dispatch the async request + * + * @return array|WP_Error + */ + public function dispatch() { + $url = add_query_arg( $this->get_query_args(), $this->get_query_url() ); + $args = $this->get_post_args(); + + return wp_remote_post( esc_url_raw( $url ), $args ); + } + + /** + * Get query args + * + * @return array + */ + protected function get_query_args() { + if ( property_exists( $this, 'query_args' ) ) { + return $this->query_args; + } + + return array( + 'action' => $this->identifier, + 'nonce' => wp_create_nonce( $this->identifier ), + ); + } + + /** + * Get query URL + * + * @return string + */ + protected function get_query_url() { + if ( property_exists( $this, 'query_url' ) ) { + return $this->query_url; + } + + return admin_url( 'admin-ajax.php' ); + } + + /** + * Get post args + * + * @return array + */ + protected function get_post_args() { + if ( property_exists( $this, 'post_args' ) ) { + return $this->post_args; + } + + return array( + 'timeout' => 0.01, + 'blocking' => false, + 'body' => $this->data, + 'cookies' => $_COOKIE, + 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), + ); + } + + /** + * Maybe handle + * + * Check for correct nonce and pass to handler. + */ + public function maybe_handle() { + // Don't lock up other requests while processing + session_write_close(); + + check_ajax_referer( $this->identifier, 'nonce' ); + + $this->handle(); + + wp_die(); + } + + /** + * Handle + * + * Override this method to perform any actions required + * during the async request. + */ + abstract protected function handle(); + + } +} diff --git a/inc/lib/batch-processing/class-astra-wp-background-process.php b/inc/lib/batch-processing/class-astra-wp-background-process.php index 98c7486..9e4abbe 100644 --- a/inc/lib/batch-processing/class-astra-wp-background-process.php +++ b/inc/lib/batch-processing/class-astra-wp-background-process.php @@ -1,506 +1,506 @@ -cron_hook_identifier = $this->identifier . '_cron'; - $this->cron_interval_identifier = $this->identifier . '_cron_interval'; - - add_action( $this->cron_hook_identifier, array( $this, 'handle_cron_healthcheck' ) ); - add_filter( 'cron_schedules', array( $this, 'schedule_cron_healthcheck' ) ); - } - - /** - * Dispatch - * - * @access public - * @return void - */ - public function dispatch() { - // Schedule the cron healthcheck. - $this->schedule_event(); - - // Perform remote post. - return parent::dispatch(); - } - - /** - * Push to queue - * - * @param mixed $data Data. - * - * @return $this - */ - public function push_to_queue( $data ) { - $this->data[] = $data; - - return $this; - } - - /** - * Save queue - * - * @return $this - */ - public function save() { - $key = $this->generate_key(); - - if ( ! empty( $this->data ) ) { - update_site_option( $key, $this->data ); - } - - return $this; - } - - /** - * Update queue - * - * @param string $key Key. - * @param array $data Data. - * - * @return $this - */ - public function update( $key, $data ) { - if ( ! empty( $data ) ) { - update_site_option( $key, $data ); - } - - return $this; - } - - /** - * Delete queue - * - * @param string $key Key. - * - * @return $this - */ - public function delete( $key ) { - delete_site_option( $key ); - - return $this; - } - - /** - * Generate key - * - * Generates a unique key based on microtime. Queue items are - * given a unique key so that they can be merged upon save. - * - * @param int $length Length. - * - * @return string - */ - protected function generate_key( $length = 64 ) { - $unique = md5( microtime() . rand() ); - $prepend = $this->identifier . '_batch_'; - - return substr( $prepend . $unique, 0, $length ); - } - - /** - * Maybe process queue - * - * Checks whether data exists within the queue and that - * the process is not already running. - */ - public function maybe_handle() { - // Don't lock up other requests while processing - session_write_close(); - - if ( $this->is_process_running() ) { - // Background process already running. - wp_die(); - } - - if ( $this->is_queue_empty() ) { - // No data to process. - wp_die(); - } - - check_ajax_referer( $this->identifier, 'nonce' ); - - $this->handle(); - - wp_die(); - } - - /** - * Is queue empty - * - * @return bool - */ - protected function is_queue_empty() { - global $wpdb; - - $table = $wpdb->options; - $column = 'option_name'; - - if ( is_multisite() ) { - $table = $wpdb->sitemeta; - $column = 'meta_key'; - } - - $key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%'; - - $count = $wpdb->get_var( $wpdb->prepare( " - SELECT COUNT(*) - FROM {$table} - WHERE {$column} LIKE %s - ", $key ) ); - - return ( $count > 0 ) ? false : true; - } - - /** - * Is process running - * - * Check whether the current process is already running - * in a background process. - */ - protected function is_process_running() { - if ( get_site_transient( $this->identifier . '_process_lock' ) ) { - // Process already running. - return true; - } - - return false; - } - - /** - * Lock process - * - * Lock the process so that multiple instances can't run simultaneously. - * Override if applicable, but the duration should be greater than that - * defined in the time_exceeded() method. - */ - protected function lock_process() { - $this->start_time = time(); // Set start time of current process. - - $lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : 60; // 1 minute - $lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration ); - - set_site_transient( $this->identifier . '_process_lock', microtime(), $lock_duration ); - } - - /** - * Unlock process - * - * Unlock the process so that other instances can spawn. - * - * @return $this - */ - protected function unlock_process() { - delete_site_transient( $this->identifier . '_process_lock' ); - - return $this; - } - - /** - * Get batch - * - * @return stdClass Return the first batch from the queue - */ - protected function get_batch() { - global $wpdb; - - $table = $wpdb->options; - $column = 'option_name'; - $key_column = 'option_id'; - $value_column = 'option_value'; - - if ( is_multisite() ) { - $table = $wpdb->sitemeta; - $column = 'meta_key'; - $key_column = 'meta_id'; - $value_column = 'meta_value'; - } - - $key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%'; - - $query = $wpdb->get_row( $wpdb->prepare( " - SELECT * - FROM {$table} - WHERE {$column} LIKE %s - ORDER BY {$key_column} ASC - LIMIT 1 - ", $key ) ); - - $batch = new stdClass(); - $batch->key = $query->$column; - $batch->data = maybe_unserialize( $query->$value_column ); - - return $batch; - } - - /** - * Handle - * - * Pass each queue item to the task handler, while remaining - * within server memory and time limit constraints. - */ - protected function handle() { - $this->lock_process(); - - do { - $batch = $this->get_batch(); - - foreach ( $batch->data as $key => $value ) { - $task = $this->task( $value ); - - if ( false !== $task ) { - $batch->data[ $key ] = $task; - } else { - unset( $batch->data[ $key ] ); - } - - if ( $this->time_exceeded() || $this->memory_exceeded() ) { - // Batch limits reached. - break; - } - } - - // Update or delete current batch. - if ( ! empty( $batch->data ) ) { - $this->update( $batch->key, $batch->data ); - } else { - $this->delete( $batch->key ); - } - } while ( ! $this->time_exceeded() && ! $this->memory_exceeded() && ! $this->is_queue_empty() ); - - $this->unlock_process(); - - // Start next batch or complete process. - if ( ! $this->is_queue_empty() ) { - $this->dispatch(); - } else { - $this->complete(); - } - - wp_die(); - } - - /** - * Memory exceeded - * - * Ensures the batch process never exceeds 90% - * of the maximum WordPress memory. - * - * @return bool - */ - protected function memory_exceeded() { - $memory_limit = $this->get_memory_limit() * 0.9; // 90% of max memory - $current_memory = memory_get_usage( true ); - $return = false; - - if ( $current_memory >= $memory_limit ) { - $return = true; - } - - return apply_filters( $this->identifier . '_memory_exceeded', $return ); - } - - /** - * Get memory limit - * - * @return int - */ - protected function get_memory_limit() { - if ( function_exists( 'ini_get' ) ) { - $memory_limit = ini_get( 'memory_limit' ); - } else { - // Sensible default. - $memory_limit = '128M'; - } - - if ( ! $memory_limit || -1 === intval( $memory_limit ) ) { - // Unlimited, set to 32GB. - $memory_limit = '32000M'; - } - - return intval( $memory_limit ) * 1024 * 1024; - } - - /** - * Time exceeded. - * - * Ensures the batch never exceeds a sensible time limit. - * A timeout limit of 30s is common on shared hosting. - * - * @return bool - */ - protected function time_exceeded() { - $finish = $this->start_time + apply_filters( $this->identifier . '_default_time_limit', 20 ); // 20 seconds - $return = false; - - if ( time() >= $finish ) { - $return = true; - } - - return apply_filters( $this->identifier . '_time_exceeded', $return ); - } - - /** - * Complete. - * - * Override if applicable, but ensure that the below actions are - * performed, or, call parent::complete(). - */ - protected function complete() { - // Unschedule the cron healthcheck. - $this->clear_scheduled_event(); - } - - /** - * Schedule cron healthcheck - * - * @access public - * @param mixed $schedules Schedules. - * @return mixed - */ - public function schedule_cron_healthcheck( $schedules ) { - $interval = apply_filters( $this->identifier . '_cron_interval', 5 ); - - if ( property_exists( $this, 'cron_interval' ) ) { - $interval = apply_filters( $this->identifier . '_cron_interval', $this->cron_interval ); - } - - // Adds every 5 minutes to the existing schedules. - $schedules[ $this->identifier . '_cron_interval' ] = array( - 'interval' => MINUTE_IN_SECONDS * $interval, - 'display' => sprintf( __( 'Every %d Minutes', 'astra' ), $interval ), - ); - - return $schedules; - } - - /** - * Handle cron healthcheck - * - * Restart the background process if not already running - * and data exists in the queue. - */ - public function handle_cron_healthcheck() { - if ( $this->is_process_running() ) { - // Background process already running. - exit; - } - - if ( $this->is_queue_empty() ) { - // No data to process. - $this->clear_scheduled_event(); - exit; - } - - $this->handle(); - - exit; - } - - /** - * Schedule event - */ - protected function schedule_event() { - if ( ! wp_next_scheduled( $this->cron_hook_identifier ) ) { - wp_schedule_event( time(), $this->cron_interval_identifier, $this->cron_hook_identifier ); - } - } - - /** - * Clear scheduled event - */ - protected function clear_scheduled_event() { - $timestamp = wp_next_scheduled( $this->cron_hook_identifier ); - - if ( $timestamp ) { - wp_unschedule_event( $timestamp, $this->cron_hook_identifier ); - } - } - - /** - * Cancel Process - * - * Stop processing queue items, clear cronjob and delete batch. - * - */ - public function cancel_process() { - if ( ! $this->is_queue_empty() ) { - $batch = $this->get_batch(); - - $this->delete( $batch->key ); - - wp_clear_scheduled_hook( $this->cron_hook_identifier ); - } - - } - - /** - * Task - * - * Override this method to perform any actions required on each - * queue item. Return the modified item for further processing - * in the next pass through. Or, return false to remove the - * item from the queue. - * - * @param mixed $item Queue item to iterate over. - * - * @return mixed - */ - abstract protected function task( $item ); - - } -} +cron_hook_identifier = $this->identifier . '_cron'; + $this->cron_interval_identifier = $this->identifier . '_cron_interval'; + + add_action( $this->cron_hook_identifier, array( $this, 'handle_cron_healthcheck' ) ); + add_filter( 'cron_schedules', array( $this, 'schedule_cron_healthcheck' ) ); + } + + /** + * Dispatch + * + * @access public + * @return void + */ + public function dispatch() { + // Schedule the cron healthcheck. + $this->schedule_event(); + + // Perform remote post. + return parent::dispatch(); + } + + /** + * Push to queue + * + * @param mixed $data Data. + * + * @return $this + */ + public function push_to_queue( $data ) { + $this->data[] = $data; + + return $this; + } + + /** + * Save queue + * + * @return $this + */ + public function save() { + $key = $this->generate_key(); + + if ( ! empty( $this->data ) ) { + update_site_option( $key, $this->data ); + } + + return $this; + } + + /** + * Update queue + * + * @param string $key Key. + * @param array $data Data. + * + * @return $this + */ + public function update( $key, $data ) { + if ( ! empty( $data ) ) { + update_site_option( $key, $data ); + } + + return $this; + } + + /** + * Delete queue + * + * @param string $key Key. + * + * @return $this + */ + public function delete( $key ) { + delete_site_option( $key ); + + return $this; + } + + /** + * Generate key + * + * Generates a unique key based on microtime. Queue items are + * given a unique key so that they can be merged upon save. + * + * @param int $length Length. + * + * @return string + */ + protected function generate_key( $length = 64 ) { + $unique = md5( microtime() . rand() ); + $prepend = $this->identifier . '_batch_'; + + return substr( $prepend . $unique, 0, $length ); + } + + /** + * Maybe process queue + * + * Checks whether data exists within the queue and that + * the process is not already running. + */ + public function maybe_handle() { + // Don't lock up other requests while processing + session_write_close(); + + if ( $this->is_process_running() ) { + // Background process already running. + wp_die(); + } + + if ( $this->is_queue_empty() ) { + // No data to process. + wp_die(); + } + + check_ajax_referer( $this->identifier, 'nonce' ); + + $this->handle(); + + wp_die(); + } + + /** + * Is queue empty + * + * @return bool + */ + protected function is_queue_empty() { + global $wpdb; + + $table = $wpdb->options; + $column = 'option_name'; + + if ( is_multisite() ) { + $table = $wpdb->sitemeta; + $column = 'meta_key'; + } + + $key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%'; + + $count = $wpdb->get_var( $wpdb->prepare( " + SELECT COUNT(*) + FROM {$table} + WHERE {$column} LIKE %s + ", $key ) ); + + return ( $count > 0 ) ? false : true; + } + + /** + * Is process running + * + * Check whether the current process is already running + * in a background process. + */ + protected function is_process_running() { + if ( get_site_transient( $this->identifier . '_process_lock' ) ) { + // Process already running. + return true; + } + + return false; + } + + /** + * Lock process + * + * Lock the process so that multiple instances can't run simultaneously. + * Override if applicable, but the duration should be greater than that + * defined in the time_exceeded() method. + */ + protected function lock_process() { + $this->start_time = time(); // Set start time of current process. + + $lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : 60; // 1 minute + $lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration ); + + set_site_transient( $this->identifier . '_process_lock', microtime(), $lock_duration ); + } + + /** + * Unlock process + * + * Unlock the process so that other instances can spawn. + * + * @return $this + */ + protected function unlock_process() { + delete_site_transient( $this->identifier . '_process_lock' ); + + return $this; + } + + /** + * Get batch + * + * @return stdClass Return the first batch from the queue + */ + protected function get_batch() { + global $wpdb; + + $table = $wpdb->options; + $column = 'option_name'; + $key_column = 'option_id'; + $value_column = 'option_value'; + + if ( is_multisite() ) { + $table = $wpdb->sitemeta; + $column = 'meta_key'; + $key_column = 'meta_id'; + $value_column = 'meta_value'; + } + + $key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%'; + + $query = $wpdb->get_row( $wpdb->prepare( " + SELECT * + FROM {$table} + WHERE {$column} LIKE %s + ORDER BY {$key_column} ASC + LIMIT 1 + ", $key ) ); + + $batch = new stdClass(); + $batch->key = $query->$column; + $batch->data = maybe_unserialize( $query->$value_column ); + + return $batch; + } + + /** + * Handle + * + * Pass each queue item to the task handler, while remaining + * within server memory and time limit constraints. + */ + protected function handle() { + $this->lock_process(); + + do { + $batch = $this->get_batch(); + + foreach ( $batch->data as $key => $value ) { + $task = $this->task( $value ); + + if ( false !== $task ) { + $batch->data[ $key ] = $task; + } else { + unset( $batch->data[ $key ] ); + } + + if ( $this->time_exceeded() || $this->memory_exceeded() ) { + // Batch limits reached. + break; + } + } + + // Update or delete current batch. + if ( ! empty( $batch->data ) ) { + $this->update( $batch->key, $batch->data ); + } else { + $this->delete( $batch->key ); + } + } while ( ! $this->time_exceeded() && ! $this->memory_exceeded() && ! $this->is_queue_empty() ); + + $this->unlock_process(); + + // Start next batch or complete process. + if ( ! $this->is_queue_empty() ) { + $this->dispatch(); + } else { + $this->complete(); + } + + wp_die(); + } + + /** + * Memory exceeded + * + * Ensures the batch process never exceeds 90% + * of the maximum WordPress memory. + * + * @return bool + */ + protected function memory_exceeded() { + $memory_limit = $this->get_memory_limit() * 0.9; // 90% of max memory + $current_memory = memory_get_usage( true ); + $return = false; + + if ( $current_memory >= $memory_limit ) { + $return = true; + } + + return apply_filters( $this->identifier . '_memory_exceeded', $return ); + } + + /** + * Get memory limit + * + * @return int + */ + protected function get_memory_limit() { + if ( function_exists( 'ini_get' ) ) { + $memory_limit = ini_get( 'memory_limit' ); + } else { + // Sensible default. + $memory_limit = '128M'; + } + + if ( ! $memory_limit || -1 === intval( $memory_limit ) ) { + // Unlimited, set to 32GB. + $memory_limit = '32000M'; + } + + return intval( $memory_limit ) * 1024 * 1024; + } + + /** + * Time exceeded. + * + * Ensures the batch never exceeds a sensible time limit. + * A timeout limit of 30s is common on shared hosting. + * + * @return bool + */ + protected function time_exceeded() { + $finish = $this->start_time + apply_filters( $this->identifier . '_default_time_limit', 20 ); // 20 seconds + $return = false; + + if ( time() >= $finish ) { + $return = true; + } + + return apply_filters( $this->identifier . '_time_exceeded', $return ); + } + + /** + * Complete. + * + * Override if applicable, but ensure that the below actions are + * performed, or, call parent::complete(). + */ + protected function complete() { + // Unschedule the cron healthcheck. + $this->clear_scheduled_event(); + } + + /** + * Schedule cron healthcheck + * + * @access public + * @param mixed $schedules Schedules. + * @return mixed + */ + public function schedule_cron_healthcheck( $schedules ) { + $interval = apply_filters( $this->identifier . '_cron_interval', 5 ); + + if ( property_exists( $this, 'cron_interval' ) ) { + $interval = apply_filters( $this->identifier . '_cron_interval', $this->cron_interval ); + } + + // Adds every 5 minutes to the existing schedules. + $schedules[ $this->identifier . '_cron_interval' ] = array( + 'interval' => MINUTE_IN_SECONDS * $interval, + 'display' => sprintf( __( 'Every %d Minutes', 'astra' ), $interval ), + ); + + return $schedules; + } + + /** + * Handle cron healthcheck + * + * Restart the background process if not already running + * and data exists in the queue. + */ + public function handle_cron_healthcheck() { + if ( $this->is_process_running() ) { + // Background process already running. + exit; + } + + if ( $this->is_queue_empty() ) { + // No data to process. + $this->clear_scheduled_event(); + exit; + } + + $this->handle(); + + exit; + } + + /** + * Schedule event + */ + protected function schedule_event() { + if ( ! wp_next_scheduled( $this->cron_hook_identifier ) ) { + wp_schedule_event( time(), $this->cron_interval_identifier, $this->cron_hook_identifier ); + } + } + + /** + * Clear scheduled event + */ + protected function clear_scheduled_event() { + $timestamp = wp_next_scheduled( $this->cron_hook_identifier ); + + if ( $timestamp ) { + wp_unschedule_event( $timestamp, $this->cron_hook_identifier ); + } + } + + /** + * Cancel Process + * + * Stop processing queue items, clear cronjob and delete batch. + * + */ + public function cancel_process() { + if ( ! $this->is_queue_empty() ) { + $batch = $this->get_batch(); + + $this->delete( $batch->key ); + + wp_clear_scheduled_hook( $this->cron_hook_identifier ); + } + + } + + /** + * Task + * + * Override this method to perform any actions required on each + * queue item. Return the modified item for further processing + * in the next pass through. Or, return false to remove the + * item from the queue. + * + * @param mixed $item Queue item to iterate over. + * + * @return mixed + */ + abstract protected function task( $item ); + + } +} diff --git a/inc/lib/notices/class-astra-notices.php b/inc/lib/notices/class-astra-notices.php index 3b5743d..b5203f8 100644 --- a/inc/lib/notices/class-astra-notices.php +++ b/inc/lib/notices/class-astra-notices.php @@ -1,365 +1,365 @@ - Create custom close notice link in the notice markup. E.g. - * `` - * It close the notice for 30 days. - * - * @package Astra Sites - * @since 1.4.0 - */ - -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} - -if ( ! class_exists( 'Astra_Notices' ) ) : - - /** - * Astra_Notices - * - * @since 1.4.0 - */ - class Astra_Notices { - - /** - * Notices - * - * @access private - * @var array Notices. - * @since 1.4.0 - */ - private static $version = '1.1.5'; - - /** - * Notices - * - * @access private - * @var array Notices. - * @since 1.4.0 - */ - private static $notices = array(); - - /** - * Instance - * - * @access private - * @var object Class object. - * @since 1.4.0 - */ - private static $instance; - - /** - * Initiator - * - * @since 1.4.0 - * @return object initialized object of class. - */ - public static function get_instance() { - if ( ! isset( self::$instance ) ) { - self::$instance = new self(); - } - return self::$instance; - } - - /** - * Constructor - * - * @since 1.4.0 - */ - public function __construct() { - add_action( 'admin_notices', array( $this, 'show_notices' ), 30 ); - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); - add_action( 'wp_ajax_astra-notice-dismiss', array( $this, 'dismiss_notice' ) ); - add_filter( 'wp_kses_allowed_html', array( $this, 'add_data_attributes' ), 10, 2 ); - } - - /** - * Filters and Returns a list of allowed tags and attributes for a given context. - * - * @param Array $allowedposttags Array of allowed tags. - * @param String $context Context type (explicit). - * @since 1.4.0 - * @return Array - */ - public function add_data_attributes( $allowedposttags, $context ) { - $allowedposttags['a']['data-repeat-notice-after'] = true; - - return $allowedposttags; - } - - /** - * Add Notice. - * - * @since 1.4.0 - * @param array $args Notice arguments. - * @return void - */ - public static function add_notice( $args = array() ) { - self::$notices[] = $args; - } - - /** - * Dismiss Notice. - * - * @since 1.4.0 - * @return void - */ - public function dismiss_notice() { - - if ( ! apply_filters( 'astra_notices_user_cap_check', current_user_can( 'manage_options' ) ) ) { - return; - } - - $notice_id = ( isset( $_POST['notice_id'] ) ) ? sanitize_key( $_POST['notice_id'] ) : ''; - $repeat_notice_after = ( isset( $_POST['repeat_notice_after'] ) ) ? absint( $_POST['repeat_notice_after'] ) : ''; - $nonce = ( isset( $_POST['nonce'] ) ) ? sanitize_key( $_POST['nonce'] ) : ''; - - if ( false === wp_verify_nonce( $nonce, 'astra-notices' ) ) { - wp_send_json_error( esc_html_e( 'WordPress Nonce not validated.', 'astra' ) ); - } - - // Valid inputs? - if ( ! empty( $notice_id ) ) { - - if ( ! empty( $repeat_notice_after ) ) { - set_transient( $notice_id, true, $repeat_notice_after ); - } else { - update_user_meta( get_current_user_id(), $notice_id, 'notice-dismissed' ); - } - - wp_send_json_success(); - } - - wp_send_json_error(); - } - - /** - * Enqueue Scripts. - * - * @since 1.4.0 - * @return void - */ - public function enqueue_scripts() { - wp_register_script( 'astra-notices', self::_get_uri() . 'notices.js', array( 'jquery' ), self::$version, true ); - wp_localize_script( - 'astra-notices', - 'astraNotices', - array( - '_notice_nonce' => wp_create_nonce( 'astra-notices' ), - ) - ); - } - - /** - * Rating priority sort - * - * @since 1.5.2 - * @param array $array1 array one. - * @param array $array2 array two. - * @return array - */ - public function sort_notices( $array1, $array2 ) { - if ( ! isset( $array1['priority'] ) ) { - $array1['priority'] = 10; - } - if ( ! isset( $array2['priority'] ) ) { - $array2['priority'] = 10; - } - - return $array1['priority'] - $array2['priority']; - } - - /** - * Notice Types - * - * @since 1.4.0 - * @return void - */ - public function show_notices() { - - $defaults = array( - 'id' => '', // Optional, Notice ID. If empty it set `astra-notices-id-<$array-index>`. - 'type' => 'info', // Optional, Notice type. Default `info`. Expected [info, warning, notice, error]. - 'message' => '', // Optional, Message. - 'show_if' => true, // Optional, Show notice on custom condition. E.g. 'show_if' => if( is_admin() ) ? true, false, . - 'repeat-notice-after' => '', // Optional, Dismiss-able notice time. It'll auto show after given time. - 'display-notice-after' => false, // Optional, Dismiss-able notice time. It'll auto show after given time. - 'class' => '', // Optional, Additional notice wrapper class. - 'priority' => 10, // Priority of the notice. - 'display-with-other-notices' => true, // Should the notice be displayed if other notices are being displayed from Astra_Notices. - 'is_dismissible' => true, - ); - - // Count for the notices that are rendered. - $notices_displayed = 0; - - // sort the array with priority. - usort( self::$notices, array( $this, 'sort_notices' ) ); - - foreach ( self::$notices as $key => $notice ) { - - $notice = wp_parse_args( $notice, $defaults ); - - $notice['id'] = self::get_notice_id( $notice, $key ); - - $notice['classes'] = self::get_wrap_classes( $notice ); - - // Notices visible after transient expire. - if ( isset( $notice['show_if'] ) && true === $notice['show_if'] ) { - - // don't display the notice if it is not supposed to be displayed with other notices. - if ( 0 !== $notices_displayed && false === $notice['display-with-other-notices'] ) { - continue; - } - - if ( self::is_expired( $notice ) ) { - - self::markup( $notice ); - ++$notices_displayed; - } - } - } - - } - - /** - * Markup Notice. - * - * @since 1.4.0 - * @param array $notice Notice markup. - * @return void - */ - public static function markup( $notice = array() ) { - - wp_enqueue_script( 'astra-notices' ); - - do_action( 'astra_notice_before_markup' ); - - do_action( "astra_notice_before_markup_{$notice['id']}" ); - - ?> -
    -
    - - -
    -
    - Create custom close notice link in the notice markup. E.g. + * `
    ` + * It close the notice for 30 days. + * + * @package Astra Sites + * @since 1.4.0 + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} + +if ( ! class_exists( 'Astra_Notices' ) ) : + + /** + * Astra_Notices + * + * @since 1.4.0 + */ + class Astra_Notices { + + /** + * Notices + * + * @access private + * @var array Notices. + * @since 1.4.0 + */ + private static $version = '1.1.5'; + + /** + * Notices + * + * @access private + * @var array Notices. + * @since 1.4.0 + */ + private static $notices = array(); + + /** + * Instance + * + * @access private + * @var object Class object. + * @since 1.4.0 + */ + private static $instance; + + /** + * Initiator + * + * @since 1.4.0 + * @return object initialized object of class. + */ + public static function get_instance() { + if ( ! isset( self::$instance ) ) { + self::$instance = new self(); + } + return self::$instance; + } + + /** + * Constructor + * + * @since 1.4.0 + */ + public function __construct() { + add_action( 'admin_notices', array( $this, 'show_notices' ), 30 ); + add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); + add_action( 'wp_ajax_astra-notice-dismiss', array( $this, 'dismiss_notice' ) ); + add_filter( 'wp_kses_allowed_html', array( $this, 'add_data_attributes' ), 10, 2 ); + } + + /** + * Filters and Returns a list of allowed tags and attributes for a given context. + * + * @param Array $allowedposttags Array of allowed tags. + * @param String $context Context type (explicit). + * @since 1.4.0 + * @return Array + */ + public function add_data_attributes( $allowedposttags, $context ) { + $allowedposttags['a']['data-repeat-notice-after'] = true; + + return $allowedposttags; + } + + /** + * Add Notice. + * + * @since 1.4.0 + * @param array $args Notice arguments. + * @return void + */ + public static function add_notice( $args = array() ) { + self::$notices[] = $args; + } + + /** + * Dismiss Notice. + * + * @since 1.4.0 + * @return void + */ + public function dismiss_notice() { + + if ( ! apply_filters( 'astra_notices_user_cap_check', current_user_can( 'manage_options' ) ) ) { + return; + } + + $notice_id = ( isset( $_POST['notice_id'] ) ) ? sanitize_key( $_POST['notice_id'] ) : ''; + $repeat_notice_after = ( isset( $_POST['repeat_notice_after'] ) ) ? absint( $_POST['repeat_notice_after'] ) : ''; + $nonce = ( isset( $_POST['nonce'] ) ) ? sanitize_key( $_POST['nonce'] ) : ''; + + if ( false === wp_verify_nonce( $nonce, 'astra-notices' ) ) { + wp_send_json_error( esc_html_e( 'WordPress Nonce not validated.', 'astra' ) ); + } + + // Valid inputs? + if ( ! empty( $notice_id ) ) { + + if ( ! empty( $repeat_notice_after ) ) { + set_transient( $notice_id, true, $repeat_notice_after ); + } else { + update_user_meta( get_current_user_id(), $notice_id, 'notice-dismissed' ); + } + + wp_send_json_success(); + } + + wp_send_json_error(); + } + + /** + * Enqueue Scripts. + * + * @since 1.4.0 + * @return void + */ + public function enqueue_scripts() { + wp_register_script( 'astra-notices', self::_get_uri() . 'notices.js', array( 'jquery' ), self::$version, true ); + wp_localize_script( + 'astra-notices', + 'astraNotices', + array( + '_notice_nonce' => wp_create_nonce( 'astra-notices' ), + ) + ); + } + + /** + * Rating priority sort + * + * @since 1.5.2 + * @param array $array1 array one. + * @param array $array2 array two. + * @return array + */ + public function sort_notices( $array1, $array2 ) { + if ( ! isset( $array1['priority'] ) ) { + $array1['priority'] = 10; + } + if ( ! isset( $array2['priority'] ) ) { + $array2['priority'] = 10; + } + + return $array1['priority'] - $array2['priority']; + } + + /** + * Notice Types + * + * @since 1.4.0 + * @return void + */ + public function show_notices() { + + $defaults = array( + 'id' => '', // Optional, Notice ID. If empty it set `astra-notices-id-<$array-index>`. + 'type' => 'info', // Optional, Notice type. Default `info`. Expected [info, warning, notice, error]. + 'message' => '', // Optional, Message. + 'show_if' => true, // Optional, Show notice on custom condition. E.g. 'show_if' => if( is_admin() ) ? true, false, . + 'repeat-notice-after' => '', // Optional, Dismiss-able notice time. It'll auto show after given time. + 'display-notice-after' => false, // Optional, Dismiss-able notice time. It'll auto show after given time. + 'class' => '', // Optional, Additional notice wrapper class. + 'priority' => 10, // Priority of the notice. + 'display-with-other-notices' => true, // Should the notice be displayed if other notices are being displayed from Astra_Notices. + 'is_dismissible' => true, + ); + + // Count for the notices that are rendered. + $notices_displayed = 0; + + // sort the array with priority. + usort( self::$notices, array( $this, 'sort_notices' ) ); + + foreach ( self::$notices as $key => $notice ) { + + $notice = wp_parse_args( $notice, $defaults ); + + $notice['id'] = self::get_notice_id( $notice, $key ); + + $notice['classes'] = self::get_wrap_classes( $notice ); + + // Notices visible after transient expire. + if ( isset( $notice['show_if'] ) && true === $notice['show_if'] ) { + + // don't display the notice if it is not supposed to be displayed with other notices. + if ( 0 !== $notices_displayed && false === $notice['display-with-other-notices'] ) { + continue; + } + + if ( self::is_expired( $notice ) ) { + + self::markup( $notice ); + ++$notices_displayed; + } + } + } + + } + + /** + * Markup Notice. + * + * @since 1.4.0 + * @param array $notice Notice markup. + * @return void + */ + public static function markup( $notice = array() ) { + + wp_enqueue_script( 'astra-notices' ); + + do_action( 'astra_notice_before_markup' ); + + do_action( "astra_notice_before_markup_{$notice['id']}" ); + + ?> +
    +
    + + +
    +
    + ' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) ); - } -} - -/** - * Schema for tag. - */ -if ( ! function_exists( 'astra_schema_body' ) ) : - - /** - * Adds schema tags to the body classes. - * - * @since 1.0.0 - */ - function astra_schema_body() { - - if ( true !== apply_filters( 'astra_schema_enabled', true ) ) { - return; - } - - // Check conditions. - $is_blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; - - // Set up default itemtype. - $itemtype = 'WebPage'; - - // Get itemtype for the blog. - $itemtype = ( $is_blog ) ? 'Blog' : $itemtype; - - // Get itemtype for search results. - $itemtype = ( is_search() ) ? 'SearchResultsPage' : $itemtype; - // Get the result. - $result = apply_filters( 'astra_schema_body_itemtype', $itemtype ); - - // Return our HTML. - echo apply_filters( 'astra_schema_body', "itemtype='https://schema.org/" . esc_attr( $result ) . "' itemscope='itemscope'" ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } -endif; - -/** - * Adds custom classes to the array of body classes. - */ -if ( ! function_exists( 'astra_body_classes' ) ) { - - /** - * Adds custom classes to the array of body classes. - * - * @since 1.0.0 - * @param array $classes Classes for the body element. - * @return array - */ - function astra_body_classes( $classes ) { - - if ( wp_is_mobile() ) { - $classes[] = 'ast-header-break-point'; - } else { - $classes[] = 'ast-desktop'; - } - - if ( astra_is_amp_endpoint() ) { - $classes[] = 'ast-amp'; - } - - // Apply separate container class to the body. - $content_layout = astra_get_content_layout(); - if ( 'content-boxed-container' == $content_layout ) { - $classes[] = 'ast-separate-container'; - } elseif ( 'boxed-container' == $content_layout ) { - $classes[] = 'ast-separate-container ast-two-container'; - } elseif ( 'page-builder' == $content_layout ) { - $classes[] = 'ast-page-builder-template'; - } elseif ( 'plain-container' == $content_layout ) { - $classes[] = 'ast-plain-container'; - } - // Sidebar location. - $page_layout = 'ast-' . astra_page_layout(); - $classes[] = esc_attr( $page_layout ); - - // Current Astra verion. - $classes[] = esc_attr( 'astra-' . ASTRA_THEME_VERSION ); - - $menu_item = astra_get_option( 'header-main-rt-section' ); - $outside_menu = astra_get_option( 'header-display-outside-menu' ); - - if ( 'none' !== $menu_item && $outside_menu ) { - $classes[] = 'ast-header-custom-item-outside'; - } else { - $classes[] = 'ast-header-custom-item-inside'; - } - - /** - * Add class for header width - */ - $header_content_layout = astra_get_option( 'header-main-layout-width' ); - - if ( 'full' == $header_content_layout ) { - $classes[] = 'ast-full-width-primary-header'; - } - - return $classes; - } -} - -add_filter( 'body_class', 'astra_body_classes' ); - - -/** - * Astra Pagination - */ -if ( ! function_exists( 'astra_number_pagination' ) ) { - - /** - * Astra Pagination - * - * @since 1.0.0 - * @return void Generate & echo pagination markup. - */ - function astra_number_pagination() { - global $wp_query; - $enabled = apply_filters( 'astra_pagination_enabled', true ); - - // Don't print empty markup if their is only one page. - if ( $wp_query->max_num_pages < 2 || ! $enabled ) { - return; - } - - ob_start(); - echo "
    "; - the_posts_pagination( - array( - 'prev_text' => astra_default_strings( 'string-blog-navigation-previous', false ), - 'next_text' => astra_default_strings( 'string-blog-navigation-next', false ), - 'taxonomy' => 'category', - 'in_same_term' => true, - ) - ); - echo '
    '; - $output = ob_get_clean(); - echo apply_filters( 'astra_pagination_markup', $output ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } -} - -add_action( 'astra_pagination', 'astra_number_pagination' ); - -/** - * Return or echo site logo markup. - */ -if ( ! function_exists( 'astra_logo' ) ) { - - /** - * Return or echo site logo markup. - * - * @since 1.0.0 - * @param boolean $echo Echo markup. - * @return mixed echo or return markup. - */ - function astra_logo( $echo = true ) { - - $site_tagline = astra_get_option( 'display-site-tagline-responsive' ); - $display_site_tagline = ( $site_tagline['desktop'] || $site_tagline['tablet'] || $site_tagline['mobile'] ) ? true : false; - $site_title = astra_get_option( 'display-site-title-responsive' ); - $display_site_title = ( $site_title['desktop'] || $site_title['tablet'] || $site_title['mobile'] ) ? true : false; - - $html = ''; - - $has_custom_logo = apply_filters( 'astra_has_custom_logo', has_custom_logo() ); - - // Site logo. - if ( $has_custom_logo ) { - - if ( apply_filters( 'astra_replace_logo_width', true ) ) { - add_filter( 'wp_get_attachment_image_src', 'astra_replace_header_logo', 10, 4 ); - } - - $html .= ''; - $html .= get_custom_logo(); - $html .= ''; - - if ( apply_filters( 'astra_replace_logo_width', true ) ) { - remove_filter( 'wp_get_attachment_image_src', 'astra_replace_header_logo', 10 ); - } - } - - $html .= astra_get_site_title_tagline( $display_site_title, $display_site_tagline ); - - $html = apply_filters( 'astra_logo', $html, $display_site_title, $display_site_tagline ); - - /** - * Echo or Return the Logo Markup - */ - if ( $echo ) { - echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } else { - return $html; - } - } -} - -/** - * Return or echo site logo markup. - * - * @since 2.2.0 - * @param boolean $display_site_title Site title enable or not. - * @param boolean $display_site_tagline Site tagline enable or not. - * - * @return string return markup. - */ -function astra_get_site_title_tagline( $display_site_title, $display_site_tagline ) { - $html = ''; - - if ( ! apply_filters( 'astra_disable_site_identity', false ) ) { - - // Site Title. - $tag = 'span'; - if ( is_home() || is_front_page() ) { - $tag = 'h1'; - } - - /** - * Filters the site title output. - * - * @since 1.4.9 - * - * @param string the HTML output for Site Title. - */ - // Site Title. - $site_title_markup = apply_filters( - 'astra_site_title_output', - sprintf( - '<%1$s %4$s> -
    - %3$s - - ', - /** - * Filters the tags for site title. - * - * @since 1.3.1 - * - * @param string $tags string containing the HTML tags for Site Title. - */ - apply_filters( 'astra_site_title_tag', $tag ), - /** - * Filters the href for the site title. - * - * @since 1.4.9 - * - * @param string site title home url - */ - esc_url( apply_filters( 'astra_site_title_href', home_url( '/' ) ) ), - /** - * Filters the site title. - * - * @since 1.4.9 - * - * @param string site title - */ - apply_filters( 'astra_site_title', get_bloginfo( 'name' ) ), - astra_attr( - 'site-title', - array( - 'class' => 'site-title', - ) - ), - astra_attr( - 'site-title-link', - array() - ) - ) - ); - - // Site Description. - /** - * Filters the site description markup. - * - * @since 1.4.9 - * - * @param string the HTML output for Site Title. - */ - $site_tagline_markup = apply_filters( - 'astra_site_description_markup', - sprintf( - '<%1$s class="site-description" itemprop="description"> - %2$s - ', - /** - * Filters the tags for site tagline. - * - * @since 1.8.5 - */ - apply_filters( 'astra_site_tagline_tag', 'p' ), - /** - * Filters the site description. - * - * @since 1.4.9 - * - * @param string site description - */ - apply_filters( 'astra_site_description', get_bloginfo( 'description' ) ) - ) - ); - - if ( $display_site_title || $display_site_tagline ) { - /* translators: 1: Site Title Markup, 2: Site Tagline Markup */ - $html .= sprintf( - '
    - %1$s - %2$s -
    ', - ( $display_site_title ) ? $site_title_markup : '', - ( $display_site_tagline ) ? $site_tagline_markup : '' - ); - } - } - return $html; -} - -/** - * Return the selected sections - */ -if ( ! function_exists( 'astra_get_dynamic_header_content' ) ) { - - /** - * Return the selected sections - * - * @since 1.0.0 - * @param string $option Custom content type. E.g. search, text-html etc. - * @return array Array of Custom contents. - */ - function astra_get_dynamic_header_content( $option ) { - - $output = array(); - $section = astra_get_option( $option ); - - switch ( $section ) { - - case 'search': - $output[] = astra_get_search( $option ); - break; - - case 'text-html': - $output[] = astra_get_custom_html( $option . '-html' ); - break; - - case 'widget': - $output[] = astra_get_custom_widget( $option ); - break; - - case 'button': - $output[] = astra_get_custom_button( $option . '-button-text', $option . '-button-link-option', $option . '-button-style' ); - break; - - default: - $output[] = apply_filters( 'astra_get_dynamic_header_content', '', $option, $section ); - break; - } - - return apply_filters( 'astra_get_dynamic_header_content_final', $output ); - } -} - - -/** - * Adding Wrapper for Search Form. - */ -if ( ! function_exists( 'astra_get_search' ) ) { - - /** - * Adding Wrapper for Search Form. - * - * @since 1.0.0 - * @param string $option Search Option name. - * @param string $device Device name. - * @return mixed Search HTML structure created. - */ - function astra_get_search( $option = '', $device = '' ) { - ob_start(); - ?> - - ' . do_shortcode( $custom_html_content ) . ''; - } elseif ( current_user_can( 'edit_theme_options' ) ) { - $custom_html = '' . __( 'Add Custom HTML', 'astra' ) . ''; - } - - return $custom_html; - } -} - -/** - * Get custom Button. - */ -if ( ! function_exists( 'astra_get_custom_button' ) ) { - - /** - * Get custom HTML added by user. - * - * @since 1.0.0 - * @param string $button_text Button Text. - * @param string $button_options Button Link. - * @param string $button_style Button Style. - * @return String Button added by user in options panel. - */ - function astra_get_custom_button( $button_text = '', $button_options = '', $button_style = '' ) { - - $custom_html = ''; - $button_classes = ''; - $button_text = astra_get_option( $button_text ); - $button_style = astra_get_option( $button_style ); - $outside_menu = astra_get_option( 'header-display-outside-menu' ); - - $header_button = astra_get_option( $button_options ); - $new_tab = ( $header_button['new_tab'] ? 'target="_blank"' : 'target="_self"' ); - $link_rel = ( ! empty( $header_button['link_rel'] ) ? 'rel="' . esc_attr( $header_button['link_rel'] ) . '"' : '' ); - - $button_classes = ( 'theme-button' === $button_style ? 'ast-button' : 'ast-custom-button' ); - $outside_menu_item = apply_filters( 'astra_convert_link_to_button', $outside_menu ); - - if ( '1' == $outside_menu_item ) { - $custom_html = '
    ' . esc_attr( do_shortcode( $button_text ) ) . '
    '; - } else { - $custom_html = '
    ' . esc_attr( do_shortcode( $button_text ) ) . '
    '; - $custom_html .= '' . esc_attr( do_shortcode( $button_text ) ) . ''; - } - - return $custom_html; - } -} - -/** - * Get Widget added by user. - */ -if ( ! function_exists( 'astra_get_custom_widget' ) ) { - - /** - * Get custom widget added by user. - * - * @since 1.0.1.1 - * @param string $option_name Option name. - * @return Widget added by user in options panel. - */ - function astra_get_custom_widget( $option_name = '' ) { - - ob_start(); - - if ( 'header-main-rt-section' == $option_name ) { - $widget_id = 'header-widget'; - } - if ( 'footer-sml-section-1' == $option_name ) { - $widget_id = 'footer-widget-1'; - } elseif ( 'footer-sml-section-2' == $option_name ) { - $widget_id = 'footer-widget-2'; - } - - echo '
    '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - astra_get_sidebar( $widget_id ); - echo '
    '; - - return ob_get_clean(); - } -} - -/** - * Function to get Small Left/Right Footer - */ -if ( ! function_exists( 'astra_get_small_footer' ) ) { - - /** - * Function to get Small Left/Right Footer - * - * @since 1.0.0 - * @param string $section Sections of Small Footer. - * @return mixed Markup of sections. - */ - function astra_get_small_footer( $section = '' ) { - - $small_footer_type = astra_get_option( $section ); - $output = null; - - switch ( $small_footer_type ) { - case 'menu': - $output = astra_get_small_footer_menu(); - break; - - case 'custom': - $output = astra_get_small_footer_custom_text( $section . '-credit' ); - break; - - case 'widget': - $output = astra_get_custom_widget( $section ); - break; - } - - return $output; - } -} - -/** - * Function to get Small Footer Custom Text - */ -if ( ! function_exists( 'astra_get_small_footer_custom_text' ) ) { - - /** - * Function to get Small Footer Custom Text - * - * @since 1.0.14 - * @param string $option Custom text option name. - * @return mixed Markup of custom text option. - */ - function astra_get_small_footer_custom_text( $option = '' ) { - - $output = $option; - - if ( '' != $option ) { - $output = astra_get_option( $option ); - $output = str_replace( '[current_year]', date_i18n( 'Y' ), $output ); - $output = str_replace( '[site_title]', '' . get_bloginfo( 'name' ) . '', $output ); - - $theme_author = apply_filters( - 'astra_theme_author', - array( - 'theme_name' => __( 'Astra WordPress Theme', 'astra' ), - 'theme_author_url' => 'https://wpastra.com/', - ) - ); - - $output = str_replace( '[theme_author]', '' . $theme_author['theme_name'] . '', $output ); - } - - return do_shortcode( $output ); - } -} - -/** - * Function to get Footer Menu - */ -if ( ! function_exists( 'astra_get_small_footer_menu' ) ) { - - /** - * Function to get Footer Menu - * - * @since 1.0.0 - * @return html - */ - function astra_get_small_footer_menu() { - - ob_start(); - - if ( has_nav_menu( 'footer_menu' ) ) { - wp_nav_menu( - array( - 'container' => 'div', - 'container_class' => 'footer-primary-navigation', - 'theme_location' => 'footer_menu', - 'menu_class' => 'nav-menu', - 'items_wrap' => '
      %3$s
    ', - 'depth' => 1, - ) - ); - } else { - if ( is_user_logged_in() && current_user_can( 'edit_theme_options' ) ) { - ?> - - - * - * @since 1.0.0 - */ - function astra_header_markup() { - - do_action( 'astra_header_markup_before' ); - ?> -
    'masthead', - 'class' => join( ' ', astra_get_header_classes() ), - ) - ); - ?> - > - -
    - - -
    -
    'ast-site-identity', - ) - ); - ?> - > - -
    -
    - - - -
    - - - - - - - -
    - '; - /** - * Fires before the Primary Header Menu navigation. - * Disable Primary Menu is checked - * Last Item in Menu is not 'none'. - * Take Last Item in Menu outside is unchecked. - * - * @since 1.4.0 - */ - do_action( 'astra_main_header_custom_menu_item_before' ); - - echo astra_masthead_get_menu_items(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - - /** - * Fires after the Primary Header Menu navigation. - * Disable Primary Menu is checked - * Last Item in Menu is not 'none'. - * Take Last Item in Menu outside is unchecked. - * - * @since 1.4.0 - */ - do_action( 'astra_main_header_custom_menu_item_after' ); - - echo ''; - - } - } else { - - $submenu_class = apply_filters( 'primary_submenu_border_class', ' submenu-with-border' ); - - // Menu Animation. - $menu_animation = astra_get_option( 'header-main-submenu-container-animation' ); - if ( ! empty( $menu_animation ) ) { - $submenu_class .= ' astra-menu-animation-' . esc_attr( $menu_animation ) . ' '; - } - - /** - * Filter the classes(array) for Primary Menu (
      ). - * - * @since 1.5.0 - * @var Array - */ - $primary_menu_classes = apply_filters( 'astra_primary_menu_classes', array( 'main-header-menu', 'ast-nav-menu', 'ast-flex', 'ast-justify-content-flex-end', $submenu_class ) ); - - // Fallback Menu if primary menu not set. - $fallback_menu_args = array( - 'theme_location' => 'primary', - 'menu_id' => 'primary-menu', - 'menu_class' => 'main-navigation', - 'container' => 'div', - 'before' => '
        ', - 'after' => '
      ', - 'walker' => new Astra_Walker_Page(), - ); - - $items_wrap = ''; - - // Primary Menu. - $primary_menu_args = array( - 'theme_location' => 'primary', - 'menu_id' => 'primary-menu', - 'menu_class' => esc_attr( implode( ' ', $primary_menu_classes ) ), - 'container' => 'div', - 'container_class' => 'main-header-bar-navigation', - 'items_wrap' => $items_wrap, - ); - - if ( has_nav_menu( 'primary' ) ) { - // To add default alignment for navigation which can be added through any third party plugin. - // Do not add any CSS from theme except header alignment. - echo '
      '; - wp_nav_menu( $primary_menu_args ); - echo '
      '; - } else { - - echo '
      '; - echo '
      '; - echo ''; - echo '
      '; - echo '
      '; - } - } - - } -} - -add_action( 'astra_masthead_content', 'astra_primary_navigation_markup', 10 ); - -/** - * Add CSS classes for all menu links inside WP Nav menu items. - * - * Right now, if Addon is active we add 'menu-link' class through walker_nav_menu_start_el, but if only theme is being used no clas is assigned to anchors. - * - * As we are replacing tag based selector assets to class selector, adding 'menu-link' selector to all anchors inside menu items. - * Ex. .main-header-menu a => .main-header-menu .menu-link - * - * @since 2.5.0 - * @param array $atts An array of all parameters assigned to menu anchors. - */ -function astra_menu_anchor_class_for_nav_menus( $atts ) { - - if ( ! empty( $atts['class'] ) ) { - $atts['class'] = $atts['class'] . ' menu-link'; - } else { - $atts['class'] = 'menu-link'; - } - - return $atts; -} - -add_filter( 'nav_menu_link_attributes', 'astra_menu_anchor_class_for_nav_menus', 11 ); - -/** - * Add CSS classes for all menu links inside WP Page Menu items. - * - * As we are replacing tag based selector to class selector, adding 'menu-link' selector to all anchors inside menu items. - * - * @since 2.5.0 - * @param array $atts An array of all parameters assigned to menu anchors. - */ -function astra_menu_anchor_class_for_page_menus( $atts ) { - - if ( ! empty( $atts['class'] ) ) { - $atts['class'] = $atts['class'] . ' menu-link'; - } else { - $atts['class'] = 'menu-link'; - } - - return $atts; -} - -add_filter( 'page_menu_link_attributes', 'astra_menu_anchor_class_for_page_menus' ); - -/** - * Add CSS classes from wp_nav_menu the wp_page_menu()'s menu items. - * This will help avoid targeting wp_page_menu and wp_nav_manu separately in CSS/JS. - * - * @since 1.6.9 - * @param array $css_class An array of CSS classes to be applied - * to each list item. - * @param WP_Post $page Page data object. - * @param int $depth Depth of page, used for padding. - * @param array $args An array of arguments. - * @param int $current_page ID of the current page. - * @return Array CSS classes with added menu class `menu-item` - */ -function astra_page_css_class( $css_class, $page, $depth, $args, $current_page ) { - $css_class[] = 'menu-item'; - - if ( isset( $args['pages_with_children'][ $page->ID ] ) ) { - $css_class[] = 'menu-item-has-children'; - } - - if ( ! empty( $current_page ) ) { - $_current_page = get_post( $current_page ); - - if ( $_current_page && in_array( $page->ID, $_current_page->ancestors ) ) { - $css_class[] = 'current-menu-ancestor'; - } - - if ( $page->ID == $current_page ) { - $css_class[] = 'current-menu-item'; - } elseif ( $_current_page && $page->ID == $_current_page->post_parent ) { - $css_class[] = 'current-menu-parent'; - } - } elseif ( get_option( 'page_for_posts' ) == $page->ID ) { - $css_class[] = 'current-menu-parent'; - } - - return $css_class; -} - -add_filter( 'page_css_class', 'astra_page_css_class', 20, 5 ); - -/** - * Function to get site Footer - */ -if ( ! function_exists( 'astra_footer_markup' ) ) { - - /** - * Site Footer -
      - * - * @since 1.0.0 - */ - function astra_footer_markup() { - ?> - -
      'colophon', - 'class' => join( ' ', astra_get_footer_classes() ), - ) - ); - ?> - > - - - - - - - -
      - element. - * - * @since 2.1.0 - * @return Array classnames for the
      - */ -function astra_get_header_classes() { - $classes = array( 'site-header' ); - $menu_logo_location = astra_get_option( 'header-layouts' ); - $mobile_header_alignment = astra_get_option( 'header-main-menu-align' ); - $primary_menu_disable = astra_get_option( 'disable-primary-nav' ); - $primary_menu_custom_item = astra_get_option( 'header-main-rt-section' ); - $logo_title_inline = astra_get_option( 'logo-title-inline' ); - $mobile_header_logo = astra_get_option( 'mobile-header-logo' ); - $different_mobile_header_order = astra_get_option( 'different-mobile-logo' ); - $hide_custom_menu_mobile = astra_get_option( 'hide-custom-menu-mobile', false ); - $menu_mobile_target = astra_get_option( 'mobile-header-toggle-target', 'icon' ); - $submenu_container_animation = astra_get_option( 'header-main-submenu-container-animation' ); - $builder_menu_mobile_target = astra_get_option( 'header-builder-menu-toggle-target', 'icon' ); - - if ( '' !== $submenu_container_animation ) { - $classes[] = 'ast-primary-submenu-animation-' . $submenu_container_animation; - } - - if ( $menu_logo_location ) { - $classes[] = $menu_logo_location; - } - - if ( $primary_menu_disable ) { - - $classes[] = 'ast-primary-menu-disabled'; - - if ( 'none' == $primary_menu_custom_item ) { - $classes[] = 'ast-no-menu-items'; - } - } else { - $classes[] = 'ast-primary-menu-enabled'; - } - - // Add class if Mobile Header Logo is set. - if ( '' !== $mobile_header_logo && '1' == $different_mobile_header_order ) { - $classes[] = 'ast-has-mobile-header-logo'; - } - - // Add class if Inline Logo & Site Title. - if ( $logo_title_inline ) { - $classes[] = 'ast-logo-title-inline'; - } - - if ( '1' == $hide_custom_menu_mobile ) { - $classes[] = 'ast-hide-custom-menu-mobile'; - } - - if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { - $classes[] = 'ast-builder-menu-toggle-' . $builder_menu_mobile_target; - } else { - $classes[] = 'ast-menu-toggle-' . $menu_mobile_target; - } - - $classes[] = 'ast-mobile-header-' . $mobile_header_alignment; - - $classes = array_unique( apply_filters( 'astra_header_class', $classes ) ); - - $classes = array_map( 'sanitize_html_class', $classes ); - - return apply_filters( 'astra_get_header_classes', $classes ); -} - -/** - * Function to get Footer Classes - */ -if ( ! function_exists( 'astra_footer_classes' ) ) { - - /** - * Function to get Footer Classes - * - * @since 1.0.0 - */ - function astra_footer_classes() { - echo 'class="' . esc_attr( join( ' ', astra_get_footer_classes() ) ) . '"'; - } -} - -/** - * Return classnames for
      element. - * - * @since 2.1.0 - * @return Array classnames for the
      - */ -function astra_get_footer_classes() { - $classes = array_unique( apply_filters( 'astra_footer_class', array( 'site-footer' ) ) ); - $classes = array_map( 'sanitize_html_class', $classes ); - - return apply_filters( 'astra_get_footer_classes', $classes ); -} - -/** - * Function to filter comment form's default fields - */ -if ( ! function_exists( 'astra_comment_form_default_fields_markup' ) ) { - - /** - * Function filter comment form's default fields - * - * @since 1.0.0 - * @param array $fields Array of comment form's default fields. - * @return array Comment form fields. - */ - function astra_comment_form_default_fields_markup( $fields ) { - - $commenter = wp_get_current_commenter(); - $req = get_option( 'require_name_email' ); - $aria_req = ( $req ? " aria-required='true'" : '' ); - - $fields['author'] = '

      ' . - '

      '; - $fields['email'] = ''; - $fields['url'] = '

      '; - - return apply_filters( 'astra_comment_form_default_fields_markup', $fields ); - } -} - -add_filter( 'comment_form_default_fields', 'astra_comment_form_default_fields_markup' ); - -/** - * Function to filter comment form arguments - */ -if ( ! function_exists( 'astra_comment_form_default_markup' ) ) { - - /** - * Function filter comment form arguments - * - * @since 1.0.0 - * @param array $args Comment form arguments. - * @return array - */ - function astra_comment_form_default_markup( $args ) { - /** - * Filter to enabled Astra comment for all Post Types where the commnets are enabled. - * - * @since 1.5.0 - * - * @return bool - */ - $all_post_type_support = apply_filters( 'astra_comment_form_all_post_type_support', false ); - if ( 'post' == get_post_type() || $all_post_type_support ) { - $args['id_form'] = 'ast-commentform'; - $args['title_reply'] = astra_default_strings( 'string-comment-title-reply', false ); - $args['cancel_reply_link'] = astra_default_strings( 'string-comment-cancel-reply-link', false ); - $args['label_submit'] = astra_default_strings( 'string-comment-label-submit', false ); - $args['comment_field'] = '
      '; - } - return apply_filters( 'astra_comment_form_default_markup', $args ); - - } -} - -add_filter( 'comment_form_defaults', 'astra_comment_form_default_markup' ); - -/** - * Display Blog Post Excerpt - */ -if ( ! function_exists( 'astra_the_excerpt' ) ) { - - /** - * Display Blog Post Excerpt - * - * @since 1.0.0 - */ - function astra_the_excerpt() { - - $excerpt_type = apply_filters( 'astra_excerpt_type', astra_get_option( 'blog-post-content' ) ); - - do_action( 'astra_the_excerpt_before', $excerpt_type ); - - if ( 'full-content' === $excerpt_type ) { - the_content(); - } else { - the_excerpt(); - } - - do_action( 'astra_the_excerpt_after', $excerpt_type ); - } -} - -/** - * Display Sidebars - */ -if ( ! function_exists( 'astra_get_sidebar' ) ) { - /** - * Get Sidebar - * - * @since 1.0.1.1 - * @param string $sidebar_id Sidebar Id. - * @return void - */ - function astra_get_sidebar( $sidebar_id ) { - if ( is_active_sidebar( $sidebar_id ) ) { - dynamic_sidebar( $sidebar_id ); - } elseif ( current_user_can( 'edit_theme_options' ) ) { - ?> -
      -

      - '> - - -

      -
      - -
      -

      - -

      - '> - - -

      -
      - '; - if ( ! $check_is_singular ) { - $output .= apply_filters( - 'astra_blog_post_featured_image_link_before', - ' '', - 'href' => esc_url( get_permalink() ), - ) - ) . ' >' - ); - } - $output .= $post_thumb; - if ( ! $check_is_singular ) { - $output .= apply_filters( 'astra_blog_post_featured_image_link_after', '' ); - } - $output .= ''; - } - } - } - - if ( ! $check_is_singular ) { - $output = apply_filters( 'astra_blog_post_featured_image_after', $output ); - } - - $output = apply_filters( 'astra_get_post_thumbnail', $output, $before, $after ); - - if ( $echo ) { - echo $before . $output . $after; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } else { - return $before . $output . $after; - } - } -} - -/** - * Function to check if it is Internet Explorer - */ -if ( ! function_exists( 'astra_replace_header_attr' ) ) : - - /** - * Replace header logo. - * - * @param array $attr Image. - * @param object $attachment Image obj. - * @param sting $size Size name. - * - * @return array Image attr. - */ - function astra_replace_header_attr( $attr, $attachment, $size ) { - - if ( ! isset( $attachment ) ) { - return $attr; - } - - $custom_logo_id = get_theme_mod( 'custom_logo' ); - $is_logo_attachment = ( $custom_logo_id == $attachment->ID ) ? true : false; - - if ( apply_filters( 'astra_is_logo_attachment', $is_logo_attachment, $attachment ) ) { - - if ( ! is_customize_preview() ) { - $attach_data = wp_get_attachment_image_src( $attachment->ID, 'ast-logo-size' ); - - if ( isset( $attach_data[0] ) ) { - $attr['src'] = $attach_data[0]; - } - } - - $file_type = wp_check_filetype( $attr['src'] ); - $file_extension = $file_type['ext']; - - if ( 'svg' == $file_extension ) { - $existing_classes = isset( $attr['class'] ) ? $attr['class'] : ''; - $attr['class'] = $existing_classes . ' astra-logo-svg'; - } - } - - if ( apply_filters( 'astra_is_retina_logo_attachment', $is_logo_attachment, $attachment ) ) { - - $diff_retina_logo = astra_get_option( 'different-retina-logo' ); - - if ( '1' == $diff_retina_logo ) { - - $retina_logo = astra_get_option( 'ast-header-retina-logo' ); - - $attr['srcset'] = ''; - - if ( apply_filters( 'astra_main_header_retina', true ) && '' !== $retina_logo ) { - $cutom_logo = wp_get_attachment_image_src( $custom_logo_id, 'full' ); - $cutom_logo_url = $cutom_logo[0]; - - if ( astra_check_is_ie() ) { - // Replace header logo url to retina logo url. - $attr['src'] = $retina_logo; - } - - $attr['srcset'] = $cutom_logo_url . ' 1x, ' . $retina_logo . ' 2x'; - } - } - } - - return apply_filters( 'astra_replace_header_attr', $attr ); - } - -endif; - -add_filter( 'wp_get_attachment_image_attributes', 'astra_replace_header_attr', 10, 3 ); - -/** - * Astra Color Palletes. - */ -if ( ! function_exists( 'astra_color_palette' ) ) : - - /** - * Astra Color Palletes. - * - * @return array Color Palletes. - */ - function astra_color_palette() { - - $color_palette = array( - '#000000', - '#ffffff', - '#dd3333', - '#dd9933', - '#eeee22', - '#81d742', - '#1e73be', - '#8224e3', - ); - - return apply_filters( 'astra_color_palettes', $color_palette ); - } - -endif; - -if ( ! function_exists( 'astra_get_theme_name' ) ) : - - /** - * Get theme name. - * - * @return string Theme Name. - */ - function astra_get_theme_name() { - - $theme_name = __( 'Astra', 'astra' ); - - return apply_filters( 'astra_theme_name', $theme_name ); - } - -endif; - -if ( ! function_exists( 'astra_get_addon_name' ) ) : - - /** - * Get Addon name. - * - * @return string Addon Name. - */ - function astra_get_addon_name() { - - $pro_name = __( 'Astra Pro', 'astra' ); - // If addon is not updated & White Label added for Addon then show the updated addon name. - if ( class_exists( 'Astra_Ext_White_Label_Markup' ) ) { - - $plugin_data = Astra_Ext_White_Label_Markup::$branding; - - if ( '' != $plugin_data['astra-pro']['name'] ) { - $pro_name = $plugin_data['astra-pro']['name']; - } - } - - return apply_filters( 'astra_addon_name', $pro_name ); - } -endif; +' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) ); + } +} + +/** + * Schema for tag. + */ +if ( ! function_exists( 'astra_schema_body' ) ) : + + /** + * Adds schema tags to the body classes. + * + * @since 1.0.0 + */ + function astra_schema_body() { + + if ( true !== apply_filters( 'astra_schema_enabled', true ) ) { + return; + } + + // Check conditions. + $is_blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; + + // Set up default itemtype. + $itemtype = 'WebPage'; + + // Get itemtype for the blog. + $itemtype = ( $is_blog ) ? 'Blog' : $itemtype; + + // Get itemtype for search results. + $itemtype = ( is_search() ) ? 'SearchResultsPage' : $itemtype; + // Get the result. + $result = apply_filters( 'astra_schema_body_itemtype', $itemtype ); + + // Return our HTML. + echo apply_filters( 'astra_schema_body', "itemtype='https://schema.org/" . esc_attr( $result ) . "' itemscope='itemscope'" ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } +endif; + +/** + * Adds custom classes to the array of body classes. + */ +if ( ! function_exists( 'astra_body_classes' ) ) { + + /** + * Adds custom classes to the array of body classes. + * + * @since 1.0.0 + * @param array $classes Classes for the body element. + * @return array + */ + function astra_body_classes( $classes ) { + + if ( wp_is_mobile() ) { + $classes[] = 'ast-header-break-point'; + } else { + $classes[] = 'ast-desktop'; + } + + if ( astra_is_amp_endpoint() ) { + $classes[] = 'ast-amp'; + } + + // Apply separate container class to the body. + $content_layout = astra_get_content_layout(); + if ( 'content-boxed-container' == $content_layout ) { + $classes[] = 'ast-separate-container'; + } elseif ( 'boxed-container' == $content_layout ) { + $classes[] = 'ast-separate-container ast-two-container'; + } elseif ( 'page-builder' == $content_layout ) { + $classes[] = 'ast-page-builder-template'; + } elseif ( 'plain-container' == $content_layout ) { + $classes[] = 'ast-plain-container'; + } + // Sidebar location. + $page_layout = 'ast-' . astra_page_layout(); + $classes[] = esc_attr( $page_layout ); + + // Current Astra verion. + $classes[] = esc_attr( 'astra-' . ASTRA_THEME_VERSION ); + + $menu_item = astra_get_option( 'header-main-rt-section' ); + $outside_menu = astra_get_option( 'header-display-outside-menu' ); + + if ( 'none' !== $menu_item && $outside_menu ) { + $classes[] = 'ast-header-custom-item-outside'; + } else { + $classes[] = 'ast-header-custom-item-inside'; + } + + /** + * Add class for header width + */ + $header_content_layout = astra_get_option( 'header-main-layout-width' ); + + if ( 'full' == $header_content_layout ) { + $classes[] = 'ast-full-width-primary-header'; + } + + return $classes; + } +} + +add_filter( 'body_class', 'astra_body_classes' ); + + +/** + * Astra Pagination + */ +if ( ! function_exists( 'astra_number_pagination' ) ) { + + /** + * Astra Pagination + * + * @since 1.0.0 + * @return void Generate & echo pagination markup. + */ + function astra_number_pagination() { + global $wp_query; + $enabled = apply_filters( 'astra_pagination_enabled', true ); + + // Don't print empty markup if their is only one page. + if ( $wp_query->max_num_pages < 2 || ! $enabled ) { + return; + } + + ob_start(); + echo "
      "; + the_posts_pagination( + array( + 'prev_text' => astra_default_strings( 'string-blog-navigation-previous', false ), + 'next_text' => astra_default_strings( 'string-blog-navigation-next', false ), + 'taxonomy' => 'category', + 'in_same_term' => true, + ) + ); + echo '
      '; + $output = ob_get_clean(); + echo apply_filters( 'astra_pagination_markup', $output ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } +} + +add_action( 'astra_pagination', 'astra_number_pagination' ); + +/** + * Return or echo site logo markup. + */ +if ( ! function_exists( 'astra_logo' ) ) { + + /** + * Return or echo site logo markup. + * + * @since 1.0.0 + * @param boolean $echo Echo markup. + * @return mixed echo or return markup. + */ + function astra_logo( $echo = true ) { + + $site_tagline = astra_get_option( 'display-site-tagline-responsive' ); + $display_site_tagline = ( $site_tagline['desktop'] || $site_tagline['tablet'] || $site_tagline['mobile'] ) ? true : false; + $site_title = astra_get_option( 'display-site-title-responsive' ); + $display_site_title = ( $site_title['desktop'] || $site_title['tablet'] || $site_title['mobile'] ) ? true : false; + + $html = ''; + + $has_custom_logo = apply_filters( 'astra_has_custom_logo', has_custom_logo() ); + + // Site logo. + if ( $has_custom_logo ) { + + if ( apply_filters( 'astra_replace_logo_width', true ) ) { + add_filter( 'wp_get_attachment_image_src', 'astra_replace_header_logo', 10, 4 ); + } + + $html .= ''; + $html .= get_custom_logo(); + $html .= ''; + + if ( apply_filters( 'astra_replace_logo_width', true ) ) { + remove_filter( 'wp_get_attachment_image_src', 'astra_replace_header_logo', 10 ); + } + } + + $html .= astra_get_site_title_tagline( $display_site_title, $display_site_tagline ); + + $html = apply_filters( 'astra_logo', $html, $display_site_title, $display_site_tagline ); + + /** + * Echo or Return the Logo Markup + */ + if ( $echo ) { + echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } else { + return $html; + } + } +} + +/** + * Return or echo site logo markup. + * + * @since 2.2.0 + * @param boolean $display_site_title Site title enable or not. + * @param boolean $display_site_tagline Site tagline enable or not. + * + * @return string return markup. + */ +function astra_get_site_title_tagline( $display_site_title, $display_site_tagline ) { + $html = ''; + + if ( ! apply_filters( 'astra_disable_site_identity', false ) ) { + + // Site Title. + $tag = 'span'; + if ( is_home() || is_front_page() ) { + $tag = 'h1'; + } + + /** + * Filters the site title output. + * + * @since 1.4.9 + * + * @param string the HTML output for Site Title. + */ + // Site Title. + $site_title_markup = apply_filters( + 'astra_site_title_output', + sprintf( + '<%1$s %4$s> + + %3$s + + ', + /** + * Filters the tags for site title. + * + * @since 1.3.1 + * + * @param string $tags string containing the HTML tags for Site Title. + */ + apply_filters( 'astra_site_title_tag', $tag ), + /** + * Filters the href for the site title. + * + * @since 1.4.9 + * + * @param string site title home url + */ + esc_url( apply_filters( 'astra_site_title_href', home_url( '/' ) ) ), + /** + * Filters the site title. + * + * @since 1.4.9 + * + * @param string site title + */ + apply_filters( 'astra_site_title', get_bloginfo( 'name' ) ), + astra_attr( + 'site-title', + array( + 'class' => 'site-title', + ) + ), + astra_attr( + 'site-title-link', + array() + ) + ) + ); + + // Site Description. + /** + * Filters the site description markup. + * + * @since 1.4.9 + * + * @param string the HTML output for Site Title. + */ + $site_tagline_markup = apply_filters( + 'astra_site_description_markup', + sprintf( + '<%1$s class="site-description" itemprop="description"> + %2$s + ', + /** + * Filters the tags for site tagline. + * + * @since 1.8.5 + */ + apply_filters( 'astra_site_tagline_tag', 'p' ), + /** + * Filters the site description. + * + * @since 1.4.9 + * + * @param string site description + */ + apply_filters( 'astra_site_description', get_bloginfo( 'description' ) ) + ) + ); + + if ( $display_site_title || $display_site_tagline ) { + /* translators: 1: Site Title Markup, 2: Site Tagline Markup */ + $html .= sprintf( + '
      + %1$s + %2$s +
      ', + ( $display_site_title ) ? $site_title_markup : '', + ( $display_site_tagline ) ? $site_tagline_markup : '' + ); + } + } + return $html; +} + +/** + * Return the selected sections + */ +if ( ! function_exists( 'astra_get_dynamic_header_content' ) ) { + + /** + * Return the selected sections + * + * @since 1.0.0 + * @param string $option Custom content type. E.g. search, text-html etc. + * @return array Array of Custom contents. + */ + function astra_get_dynamic_header_content( $option ) { + + $output = array(); + $section = astra_get_option( $option ); + + switch ( $section ) { + + case 'search': + $output[] = astra_get_search( $option ); + break; + + case 'text-html': + $output[] = astra_get_custom_html( $option . '-html' ); + break; + + case 'widget': + $output[] = astra_get_custom_widget( $option ); + break; + + case 'button': + $output[] = astra_get_custom_button( $option . '-button-text', $option . '-button-link-option', $option . '-button-style' ); + break; + + default: + $output[] = apply_filters( 'astra_get_dynamic_header_content', '', $option, $section ); + break; + } + + return apply_filters( 'astra_get_dynamic_header_content_final', $output ); + } +} + + +/** + * Adding Wrapper for Search Form. + */ +if ( ! function_exists( 'astra_get_search' ) ) { + + /** + * Adding Wrapper for Search Form. + * + * @since 1.0.0 + * @param string $option Search Option name. + * @param string $device Device name. + * @return mixed Search HTML structure created. + */ + function astra_get_search( $option = '', $device = '' ) { + ob_start(); + ?> + + ' . do_shortcode( $custom_html_content ) . ''; + } elseif ( current_user_can( 'edit_theme_options' ) ) { + $custom_html = '' . __( 'Add Custom HTML', 'astra' ) . ''; + } + + return $custom_html; + } +} + +/** + * Get custom Button. + */ +if ( ! function_exists( 'astra_get_custom_button' ) ) { + + /** + * Get custom HTML added by user. + * + * @since 1.0.0 + * @param string $button_text Button Text. + * @param string $button_options Button Link. + * @param string $button_style Button Style. + * @return String Button added by user in options panel. + */ + function astra_get_custom_button( $button_text = '', $button_options = '', $button_style = '' ) { + + $custom_html = ''; + $button_classes = ''; + $button_text = astra_get_option( $button_text ); + $button_style = astra_get_option( $button_style ); + $outside_menu = astra_get_option( 'header-display-outside-menu' ); + + $header_button = astra_get_option( $button_options ); + $new_tab = ( $header_button['new_tab'] ? 'target="_blank"' : 'target="_self"' ); + $link_rel = ( ! empty( $header_button['link_rel'] ) ? 'rel="' . esc_attr( $header_button['link_rel'] ) . '"' : '' ); + + $button_classes = ( 'theme-button' === $button_style ? 'ast-button' : 'ast-custom-button' ); + $outside_menu_item = apply_filters( 'astra_convert_link_to_button', $outside_menu ); + + if ( '1' == $outside_menu_item ) { + $custom_html = '
      ' . esc_attr( do_shortcode( $button_text ) ) . '
      '; + } else { + $custom_html = '
      ' . esc_attr( do_shortcode( $button_text ) ) . '
      '; + $custom_html .= '' . esc_attr( do_shortcode( $button_text ) ) . ''; + } + + return $custom_html; + } +} + +/** + * Get Widget added by user. + */ +if ( ! function_exists( 'astra_get_custom_widget' ) ) { + + /** + * Get custom widget added by user. + * + * @since 1.0.1.1 + * @param string $option_name Option name. + * @return Widget added by user in options panel. + */ + function astra_get_custom_widget( $option_name = '' ) { + + ob_start(); + + if ( 'header-main-rt-section' == $option_name ) { + $widget_id = 'header-widget'; + } + if ( 'footer-sml-section-1' == $option_name ) { + $widget_id = 'footer-widget-1'; + } elseif ( 'footer-sml-section-2' == $option_name ) { + $widget_id = 'footer-widget-2'; + } + + echo '
      '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + astra_get_sidebar( $widget_id ); + echo '
      '; + + return ob_get_clean(); + } +} + +/** + * Function to get Small Left/Right Footer + */ +if ( ! function_exists( 'astra_get_small_footer' ) ) { + + /** + * Function to get Small Left/Right Footer + * + * @since 1.0.0 + * @param string $section Sections of Small Footer. + * @return mixed Markup of sections. + */ + function astra_get_small_footer( $section = '' ) { + + $small_footer_type = astra_get_option( $section ); + $output = null; + + switch ( $small_footer_type ) { + case 'menu': + $output = astra_get_small_footer_menu(); + break; + + case 'custom': + $output = astra_get_small_footer_custom_text( $section . '-credit' ); + break; + + case 'widget': + $output = astra_get_custom_widget( $section ); + break; + } + + return $output; + } +} + +/** + * Function to get Small Footer Custom Text + */ +if ( ! function_exists( 'astra_get_small_footer_custom_text' ) ) { + + /** + * Function to get Small Footer Custom Text + * + * @since 1.0.14 + * @param string $option Custom text option name. + * @return mixed Markup of custom text option. + */ + function astra_get_small_footer_custom_text( $option = '' ) { + + $output = $option; + + if ( '' != $option ) { + $output = astra_get_option( $option ); + $output = str_replace( '[current_year]', date_i18n( 'Y' ), $output ); + $output = str_replace( '[site_title]', '' . get_bloginfo( 'name' ) . '', $output ); + + $theme_author = apply_filters( + 'astra_theme_author', + array( + 'theme_name' => __( 'Adélie Linux WordPress Theme', 'astra' ), + 'theme_author_url' => 'https://git.adelielinux.org/adelie/blog-ng/', + ) + ); + + $output = str_replace( '[theme_author]', '' . $theme_author['theme_name'] . '', $output ); + } + + return do_shortcode( $output ); + } +} + +/** + * Function to get Footer Menu + */ +if ( ! function_exists( 'astra_get_small_footer_menu' ) ) { + + /** + * Function to get Footer Menu + * + * @since 1.0.0 + * @return html + */ + function astra_get_small_footer_menu() { + + ob_start(); + + if ( has_nav_menu( 'footer_menu' ) ) { + wp_nav_menu( + array( + 'container' => 'div', + 'container_class' => 'footer-primary-navigation', + 'theme_location' => 'footer_menu', + 'menu_class' => 'nav-menu', + 'items_wrap' => '
        %3$s
      ', + 'depth' => 1, + ) + ); + } else { + if ( is_user_logged_in() && current_user_can( 'edit_theme_options' ) ) { + ?> + + + * + * @since 1.0.0 + */ + function astra_header_markup() { + + do_action( 'astra_header_markup_before' ); + ?> +
      'masthead', + 'class' => join( ' ', astra_get_header_classes() ), + ) + ); + ?> + > + +
      + + +
      +
      'ast-site-identity', + ) + ); + ?> + > + +
      +
      + + + +
      + + + + + + + +
      + '; + /** + * Fires before the Primary Header Menu navigation. + * Disable Primary Menu is checked + * Last Item in Menu is not 'none'. + * Take Last Item in Menu outside is unchecked. + * + * @since 1.4.0 + */ + do_action( 'astra_main_header_custom_menu_item_before' ); + + echo astra_masthead_get_menu_items(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + + /** + * Fires after the Primary Header Menu navigation. + * Disable Primary Menu is checked + * Last Item in Menu is not 'none'. + * Take Last Item in Menu outside is unchecked. + * + * @since 1.4.0 + */ + do_action( 'astra_main_header_custom_menu_item_after' ); + + echo ''; + + } + } else { + + $submenu_class = apply_filters( 'primary_submenu_border_class', ' submenu-with-border' ); + + // Menu Animation. + $menu_animation = astra_get_option( 'header-main-submenu-container-animation' ); + if ( ! empty( $menu_animation ) ) { + $submenu_class .= ' astra-menu-animation-' . esc_attr( $menu_animation ) . ' '; + } + + /** + * Filter the classes(array) for Primary Menu (
        ). + * + * @since 1.5.0 + * @var Array + */ + $primary_menu_classes = apply_filters( 'astra_primary_menu_classes', array( 'main-header-menu', 'ast-nav-menu', 'ast-flex', 'ast-justify-content-flex-end', $submenu_class ) ); + + // Fallback Menu if primary menu not set. + $fallback_menu_args = array( + 'theme_location' => 'primary', + 'menu_id' => 'primary-menu', + 'menu_class' => 'main-navigation', + 'container' => 'div', + 'before' => '
          ', + 'after' => '
        ', + 'walker' => new Astra_Walker_Page(), + ); + + $items_wrap = ''; + + // Primary Menu. + $primary_menu_args = array( + 'theme_location' => 'primary', + 'menu_id' => 'primary-menu', + 'menu_class' => esc_attr( implode( ' ', $primary_menu_classes ) ), + 'container' => 'div', + 'container_class' => 'main-header-bar-navigation', + 'items_wrap' => $items_wrap, + ); + + if ( has_nav_menu( 'primary' ) ) { + // To add default alignment for navigation which can be added through any third party plugin. + // Do not add any CSS from theme except header alignment. + echo '
        '; + wp_nav_menu( $primary_menu_args ); + echo '
        '; + } else { + + echo '
        '; + echo '
        '; + echo ''; + echo '
        '; + echo '
        '; + } + } + + } +} + +add_action( 'astra_masthead_content', 'astra_primary_navigation_markup', 10 ); + +/** + * Add CSS classes for all menu links inside WP Nav menu items. + * + * Right now, if Addon is active we add 'menu-link' class through walker_nav_menu_start_el, but if only theme is being used no clas is assigned to anchors. + * + * As we are replacing tag based selector assets to class selector, adding 'menu-link' selector to all anchors inside menu items. + * Ex. .main-header-menu a => .main-header-menu .menu-link + * + * @since 2.5.0 + * @param array $atts An array of all parameters assigned to menu anchors. + */ +function astra_menu_anchor_class_for_nav_menus( $atts ) { + + if ( ! empty( $atts['class'] ) ) { + $atts['class'] = $atts['class'] . ' menu-link'; + } else { + $atts['class'] = 'menu-link'; + } + + return $atts; +} + +add_filter( 'nav_menu_link_attributes', 'astra_menu_anchor_class_for_nav_menus', 11 ); + +/** + * Add CSS classes for all menu links inside WP Page Menu items. + * + * As we are replacing tag based selector to class selector, adding 'menu-link' selector to all anchors inside menu items. + * + * @since 2.5.0 + * @param array $atts An array of all parameters assigned to menu anchors. + */ +function astra_menu_anchor_class_for_page_menus( $atts ) { + + if ( ! empty( $atts['class'] ) ) { + $atts['class'] = $atts['class'] . ' menu-link'; + } else { + $atts['class'] = 'menu-link'; + } + + return $atts; +} + +add_filter( 'page_menu_link_attributes', 'astra_menu_anchor_class_for_page_menus' ); + +/** + * Add CSS classes from wp_nav_menu the wp_page_menu()'s menu items. + * This will help avoid targeting wp_page_menu and wp_nav_manu separately in CSS/JS. + * + * @since 1.6.9 + * @param array $css_class An array of CSS classes to be applied + * to each list item. + * @param WP_Post $page Page data object. + * @param int $depth Depth of page, used for padding. + * @param array $args An array of arguments. + * @param int $current_page ID of the current page. + * @return Array CSS classes with added menu class `menu-item` + */ +function astra_page_css_class( $css_class, $page, $depth, $args, $current_page ) { + $css_class[] = 'menu-item'; + + if ( isset( $args['pages_with_children'][ $page->ID ] ) ) { + $css_class[] = 'menu-item-has-children'; + } + + if ( ! empty( $current_page ) ) { + $_current_page = get_post( $current_page ); + + if ( $_current_page && in_array( $page->ID, $_current_page->ancestors ) ) { + $css_class[] = 'current-menu-ancestor'; + } + + if ( $page->ID == $current_page ) { + $css_class[] = 'current-menu-item'; + } elseif ( $_current_page && $page->ID == $_current_page->post_parent ) { + $css_class[] = 'current-menu-parent'; + } + } elseif ( get_option( 'page_for_posts' ) == $page->ID ) { + $css_class[] = 'current-menu-parent'; + } + + return $css_class; +} + +add_filter( 'page_css_class', 'astra_page_css_class', 20, 5 ); + +/** + * Function to get site Footer + */ +if ( ! function_exists( 'astra_footer_markup' ) ) { + + /** + * Site Footer -
        + * + * @since 1.0.0 + */ + function astra_footer_markup() { + ?> + +
        'colophon', + 'class' => join( ' ', astra_get_footer_classes() ), + ) + ); + ?> + > + + + + + + + +
        + element. + * + * @since 2.1.0 + * @return Array classnames for the
        + */ +function astra_get_header_classes() { + $classes = array( 'site-header' ); + $menu_logo_location = astra_get_option( 'header-layouts' ); + $mobile_header_alignment = astra_get_option( 'header-main-menu-align' ); + $primary_menu_disable = astra_get_option( 'disable-primary-nav' ); + $primary_menu_custom_item = astra_get_option( 'header-main-rt-section' ); + $logo_title_inline = astra_get_option( 'logo-title-inline' ); + $mobile_header_logo = astra_get_option( 'mobile-header-logo' ); + $different_mobile_header_order = astra_get_option( 'different-mobile-logo' ); + $hide_custom_menu_mobile = astra_get_option( 'hide-custom-menu-mobile', false ); + $menu_mobile_target = astra_get_option( 'mobile-header-toggle-target', 'icon' ); + $submenu_container_animation = astra_get_option( 'header-main-submenu-container-animation' ); + $builder_menu_mobile_target = astra_get_option( 'header-builder-menu-toggle-target', 'icon' ); + + if ( '' !== $submenu_container_animation ) { + $classes[] = 'ast-primary-submenu-animation-' . $submenu_container_animation; + } + + if ( $menu_logo_location ) { + $classes[] = $menu_logo_location; + } + + if ( $primary_menu_disable ) { + + $classes[] = 'ast-primary-menu-disabled'; + + if ( 'none' == $primary_menu_custom_item ) { + $classes[] = 'ast-no-menu-items'; + } + } else { + $classes[] = 'ast-primary-menu-enabled'; + } + + // Add class if Mobile Header Logo is set. + if ( '' !== $mobile_header_logo && '1' == $different_mobile_header_order ) { + $classes[] = 'ast-has-mobile-header-logo'; + } + + // Add class if Inline Logo & Site Title. + if ( $logo_title_inline ) { + $classes[] = 'ast-logo-title-inline'; + } + + if ( '1' == $hide_custom_menu_mobile ) { + $classes[] = 'ast-hide-custom-menu-mobile'; + } + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + $classes[] = 'ast-builder-menu-toggle-' . $builder_menu_mobile_target; + } else { + $classes[] = 'ast-menu-toggle-' . $menu_mobile_target; + } + + $classes[] = 'ast-mobile-header-' . $mobile_header_alignment; + + $classes = array_unique( apply_filters( 'astra_header_class', $classes ) ); + + $classes = array_map( 'sanitize_html_class', $classes ); + + return apply_filters( 'astra_get_header_classes', $classes ); +} + +/** + * Function to get Footer Classes + */ +if ( ! function_exists( 'astra_footer_classes' ) ) { + + /** + * Function to get Footer Classes + * + * @since 1.0.0 + */ + function astra_footer_classes() { + echo 'class="' . esc_attr( join( ' ', astra_get_footer_classes() ) ) . '"'; + } +} + +/** + * Return classnames for
        element. + * + * @since 2.1.0 + * @return Array classnames for the
        + */ +function astra_get_footer_classes() { + $classes = array_unique( apply_filters( 'astra_footer_class', array( 'site-footer' ) ) ); + $classes = array_map( 'sanitize_html_class', $classes ); + + return apply_filters( 'astra_get_footer_classes', $classes ); +} + +/** + * Function to filter comment form's default fields + */ +if ( ! function_exists( 'astra_comment_form_default_fields_markup' ) ) { + + /** + * Function filter comment form's default fields + * + * @since 1.0.0 + * @param array $fields Array of comment form's default fields. + * @return array Comment form fields. + */ + function astra_comment_form_default_fields_markup( $fields ) { + + $commenter = wp_get_current_commenter(); + $req = get_option( 'require_name_email' ); + $aria_req = ( $req ? " aria-required='true'" : '' ); + + $fields['author'] = '

        ' . + '

        '; + $fields['email'] = ''; + $fields['url'] = '

        '; + + return apply_filters( 'astra_comment_form_default_fields_markup', $fields ); + } +} + +add_filter( 'comment_form_default_fields', 'astra_comment_form_default_fields_markup' ); + +/** + * Function to filter comment form arguments + */ +if ( ! function_exists( 'astra_comment_form_default_markup' ) ) { + + /** + * Function filter comment form arguments + * + * @since 1.0.0 + * @param array $args Comment form arguments. + * @return array + */ + function astra_comment_form_default_markup( $args ) { + /** + * Filter to enabled Astra comment for all Post Types where the commnets are enabled. + * + * @since 1.5.0 + * + * @return bool + */ + $all_post_type_support = apply_filters( 'astra_comment_form_all_post_type_support', false ); + if ( 'post' == get_post_type() || $all_post_type_support ) { + $args['id_form'] = 'ast-commentform'; + $args['title_reply'] = astra_default_strings( 'string-comment-title-reply', false ); + $args['cancel_reply_link'] = astra_default_strings( 'string-comment-cancel-reply-link', false ); + $args['label_submit'] = astra_default_strings( 'string-comment-label-submit', false ); + $args['comment_field'] = '
        '; + } + return apply_filters( 'astra_comment_form_default_markup', $args ); + + } +} + +add_filter( 'comment_form_defaults', 'astra_comment_form_default_markup' ); + +/** + * Display Blog Post Excerpt + */ +if ( ! function_exists( 'astra_the_excerpt' ) ) { + + /** + * Display Blog Post Excerpt + * + * @since 1.0.0 + */ + function astra_the_excerpt() { + + $excerpt_type = apply_filters( 'astra_excerpt_type', astra_get_option( 'blog-post-content' ) ); + + do_action( 'astra_the_excerpt_before', $excerpt_type ); + + if ( 'full-content' === $excerpt_type ) { + the_content(); + } else { + the_excerpt(); + } + + do_action( 'astra_the_excerpt_after', $excerpt_type ); + } +} + +/** + * Display Sidebars + */ +if ( ! function_exists( 'astra_get_sidebar' ) ) { + /** + * Get Sidebar + * + * @since 1.0.1.1 + * @param string $sidebar_id Sidebar Id. + * @return void + */ + function astra_get_sidebar( $sidebar_id ) { + if ( is_active_sidebar( $sidebar_id ) ) { + dynamic_sidebar( $sidebar_id ); + } elseif ( current_user_can( 'edit_theme_options' ) ) { + ?> +
        +

        + '> + + +

        +
        + +
        +

        + +

        + '> + + +

        +
        + '; + if ( ! $check_is_singular ) { + $output .= apply_filters( + 'astra_blog_post_featured_image_link_before', + ' '', + 'href' => esc_url( get_permalink() ), + ) + ) . ' >' + ); + } + $output .= $post_thumb; + if ( ! $check_is_singular ) { + $output .= apply_filters( 'astra_blog_post_featured_image_link_after', '' ); + } + $output .= ''; + } + } + } + + if ( ! $check_is_singular ) { + $output = apply_filters( 'astra_blog_post_featured_image_after', $output ); + } + + $output = apply_filters( 'astra_get_post_thumbnail', $output, $before, $after ); + + if ( $echo ) { + echo $before . $output . $after; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } else { + return $before . $output . $after; + } + } +} + +/** + * Function to check if it is Internet Explorer + */ +if ( ! function_exists( 'astra_replace_header_attr' ) ) : + + /** + * Replace header logo. + * + * @param array $attr Image. + * @param object $attachment Image obj. + * @param sting $size Size name. + * + * @return array Image attr. + */ + function astra_replace_header_attr( $attr, $attachment, $size ) { + + if ( ! isset( $attachment ) ) { + return $attr; + } + + $custom_logo_id = get_theme_mod( 'custom_logo' ); + $is_logo_attachment = ( $custom_logo_id == $attachment->ID ) ? true : false; + + if ( apply_filters( 'astra_is_logo_attachment', $is_logo_attachment, $attachment ) ) { + + if ( ! is_customize_preview() ) { + $attach_data = wp_get_attachment_image_src( $attachment->ID, 'ast-logo-size' ); + + if ( isset( $attach_data[0] ) ) { + $attr['src'] = $attach_data[0]; + } + } + + $file_type = wp_check_filetype( $attr['src'] ); + $file_extension = $file_type['ext']; + + if ( 'svg' == $file_extension ) { + $existing_classes = isset( $attr['class'] ) ? $attr['class'] : ''; + $attr['class'] = $existing_classes . ' astra-logo-svg'; + } + } + + if ( apply_filters( 'astra_is_retina_logo_attachment', $is_logo_attachment, $attachment ) ) { + + $diff_retina_logo = astra_get_option( 'different-retina-logo' ); + + if ( '1' == $diff_retina_logo ) { + + $retina_logo = astra_get_option( 'ast-header-retina-logo' ); + + $attr['srcset'] = ''; + + if ( apply_filters( 'astra_main_header_retina', true ) && '' !== $retina_logo ) { + $cutom_logo = wp_get_attachment_image_src( $custom_logo_id, 'full' ); + $cutom_logo_url = $cutom_logo[0]; + + if ( astra_check_is_ie() ) { + // Replace header logo url to retina logo url. + $attr['src'] = $retina_logo; + } + + $attr['srcset'] = $cutom_logo_url . ' 1x, ' . $retina_logo . ' 2x'; + } + } + } + + return apply_filters( 'astra_replace_header_attr', $attr ); + } + +endif; + +add_filter( 'wp_get_attachment_image_attributes', 'astra_replace_header_attr', 10, 3 ); + +/** + * Astra Color Palletes. + */ +if ( ! function_exists( 'astra_color_palette' ) ) : + + /** + * Astra Color Palletes. + * + * @return array Color Palletes. + */ + function astra_color_palette() { + + $color_palette = array( + '#000000', + '#ffffff', + '#dd3333', + '#dd9933', + '#eeee22', + '#81d742', + '#1e73be', + '#8224e3', + ); + + return apply_filters( 'astra_color_palettes', $color_palette ); + } + +endif; + +if ( ! function_exists( 'astra_get_theme_name' ) ) : + + /** + * Get theme name. + * + * @return string Theme Name. + */ + function astra_get_theme_name() { + + $theme_name = __( 'Astra', 'astra' ); + + return apply_filters( 'astra_theme_name', $theme_name ); + } + +endif; + +if ( ! function_exists( 'astra_get_addon_name' ) ) : + + /** + * Get Addon name. + * + * @return string Addon Name. + */ + function astra_get_addon_name() { + + $pro_name = __( 'Astra Pro', 'astra' ); + // If addon is not updated & White Label added for Addon then show the updated addon name. + if ( class_exists( 'Astra_Ext_White_Label_Markup' ) ) { + + $plugin_data = Astra_Ext_White_Label_Markup::$branding; + + if ( '' != $plugin_data['astra-pro']['name'] ) { + $pro_name = $plugin_data['astra-pro']['name']; + } + } + + return apply_filters( 'astra_addon_name', $pro_name ); + } +endif; diff --git a/inc/metabox/class-astra-meta-box-operations.php b/inc/metabox/class-astra-meta-box-operations.php index c9cc708..a1c8f8e 100644 --- a/inc/metabox/class-astra-meta-box-operations.php +++ b/inc/metabox/class-astra-meta-box-operations.php @@ -1,115 +1,115 @@ - array( - 'sanitize' => 'FILTER_DEFAULT', - ), - 'ast-main-header-display' => array( - 'sanitize' => 'FILTER_DEFAULT', - ), - 'ast-hfb-below-header-display' => array( - 'sanitize' => 'FILTER_DEFAULT', - ), - 'ast-hfb-mobile-header-display' => array( - 'sanitize' => 'FILTER_DEFAULT', - ), - 'footer-sml-layout' => array( - 'sanitize' => 'FILTER_DEFAULT', - ), - 'footer-adv-display' => array( - 'sanitize' => 'FILTER_DEFAULT', - ), - 'site-post-title' => array( - 'sanitize' => 'FILTER_DEFAULT', - ), - 'site-sidebar-layout' => array( - 'default' => 'default', - 'sanitize' => 'FILTER_DEFAULT', - ), - 'site-content-layout' => array( - 'default' => 'default', - 'sanitize' => 'FILTER_DEFAULT', - ), - 'ast-featured-img' => array( - 'sanitize' => 'FILTER_DEFAULT', - ), - 'ast-breadcrumbs-content' => array( - 'sanitize' => 'FILTER_DEFAULT', - ), - ) - ); - } - - /** - * Setup Metabox - */ - public function setup_meta_box() { - - // Get all public posts. - $post_types = get_post_types( - array( - 'public' => true, - ) - ); - - $post_types['fl-theme-layout'] = 'fl-theme-layout'; - - $metabox_name = sprintf( - // Translators: %s is the theme name. - __( '%s Settings', 'astra' ), - astra_get_theme_name() - ); - - // Enable for all posts. - foreach ( $post_types as $type ) { - - if ( 'attachment' !== $type ) { - add_meta_box( - 'astra_settings_meta_box', // Id. - $metabox_name, // Title. - array( $this, 'markup_meta_box' ), // Callback. - $type, // Post_type. - 'side', // Context. - 'default' // Priority. - ); - } - } - } - - /** - * Get metabox options - */ - public static function get_meta_option() { - return self::$meta_option; - } - - /** - * Metabox Markup - * - * @param object $post Post object. - * @return void - */ - public function markup_meta_box( $post ) { - - wp_nonce_field( basename( __FILE__ ), 'astra_settings_meta_box' ); - $stored = get_post_meta( $post->ID ); - - if ( is_array( $stored ) ) { - - // Set stored and override defaults. - foreach ( $stored as $key => $value ) { - self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : ''; - } - } - - // Get defaults. - $meta = self::get_meta_option(); - - /** - * Get options - */ - $site_sidebar = ( isset( $meta['site-sidebar-layout']['default'] ) ) ? $meta['site-sidebar-layout']['default'] : 'default'; - $site_content_layout = ( isset( $meta['site-content-layout']['default'] ) ) ? $meta['site-content-layout']['default'] : 'default'; - $site_post_title = ( isset( $meta['site-post-title']['default'] ) ) ? $meta['site-post-title']['default'] : ''; - $footer_bar = ( isset( $meta['footer-sml-layout']['default'] ) ) ? $meta['footer-sml-layout']['default'] : ''; - $footer_widgets = ( isset( $meta['footer-adv-display']['default'] ) ) ? $meta['footer-adv-display']['default'] : ''; - $above_header = ( isset( $meta['ast-hfb-above-header-display']['default'] ) ) ? $meta['ast-hfb-above-header-display']['default'] : 'default'; - $primary_header = ( isset( $meta['ast-main-header-display']['default'] ) ) ? $meta['ast-main-header-display']['default'] : ''; - $below_header = ( isset( $meta['ast-hfb-below-header-display']['default'] ) ) ? $meta['ast-hfb-below-header-display']['default'] : 'default'; - $mobile_header = ( isset( $meta['ast-hfb-mobile-header-display']['default'] ) ) ? $meta['ast-hfb-mobile-header-display']['default'] : 'default'; - $ast_featured_img = ( isset( $meta['ast-featured-img']['default'] ) ) ? $meta['ast-featured-img']['default'] : ''; - $breadcrumbs_content = ( isset( $meta['ast-breadcrumbs-content']['default'] ) ) ? $meta['ast-breadcrumbs-content']['default'] : ''; - - $show_meta_field = ! self::is_bb_themer_layout(); - do_action( 'astra_meta_box_markup_before', $meta ); - - /** - * Option: Sidebar - */ - ?> -
        -

        - -

        - -
        - -
        -

        - -

        - -
        - - - $data ) { - - // Sanitize values. - $sanitize_filter = ( isset( $data['sanitize'] ) ) ? $data['sanitize'] : 'FILTER_DEFAULT'; - - switch ( $sanitize_filter ) { - - case 'FILTER_SANITIZE_STRING': - $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_STRING ); - break; - - case 'FILTER_SANITIZE_URL': - $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_URL ); - break; - - case 'FILTER_SANITIZE_NUMBER_INT': - $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_NUMBER_INT ); - break; - - default: - $meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT ); - break; - } - - // Store values. - if ( $meta_value ) { - update_post_meta( $post_id, $key, $meta_value ); - } else { - delete_post_meta( $post_id, $key ); - } - } - - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_Meta_Boxes::get_instance(); + array( + 'sanitize' => 'FILTER_DEFAULT', + ), + 'ast-main-header-display' => array( + 'sanitize' => 'FILTER_DEFAULT', + ), + 'ast-hfb-below-header-display' => array( + 'sanitize' => 'FILTER_DEFAULT', + ), + 'ast-hfb-mobile-header-display' => array( + 'sanitize' => 'FILTER_DEFAULT', + ), + 'footer-sml-layout' => array( + 'sanitize' => 'FILTER_DEFAULT', + ), + 'footer-adv-display' => array( + 'sanitize' => 'FILTER_DEFAULT', + ), + 'site-post-title' => array( + 'sanitize' => 'FILTER_DEFAULT', + ), + 'site-sidebar-layout' => array( + 'default' => 'default', + 'sanitize' => 'FILTER_DEFAULT', + ), + 'site-content-layout' => array( + 'default' => 'default', + 'sanitize' => 'FILTER_DEFAULT', + ), + 'ast-featured-img' => array( + 'sanitize' => 'FILTER_DEFAULT', + ), + 'ast-breadcrumbs-content' => array( + 'sanitize' => 'FILTER_DEFAULT', + ), + ) + ); + } + + /** + * Setup Metabox + */ + public function setup_meta_box() { + + // Get all public posts. + $post_types = get_post_types( + array( + 'public' => true, + ) + ); + + $post_types['fl-theme-layout'] = 'fl-theme-layout'; + + $metabox_name = sprintf( + // Translators: %s is the theme name. + __( '%s Settings', 'astra' ), + astra_get_theme_name() + ); + + // Enable for all posts. + foreach ( $post_types as $type ) { + + if ( 'attachment' !== $type ) { + add_meta_box( + 'astra_settings_meta_box', // Id. + $metabox_name, // Title. + array( $this, 'markup_meta_box' ), // Callback. + $type, // Post_type. + 'side', // Context. + 'default' // Priority. + ); + } + } + } + + /** + * Get metabox options + */ + public static function get_meta_option() { + return self::$meta_option; + } + + /** + * Metabox Markup + * + * @param object $post Post object. + * @return void + */ + public function markup_meta_box( $post ) { + + wp_nonce_field( basename( __FILE__ ), 'astra_settings_meta_box' ); + $stored = get_post_meta( $post->ID ); + + if ( is_array( $stored ) ) { + + // Set stored and override defaults. + foreach ( $stored as $key => $value ) { + self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : ''; + } + } + + // Get defaults. + $meta = self::get_meta_option(); + + /** + * Get options + */ + $site_sidebar = ( isset( $meta['site-sidebar-layout']['default'] ) ) ? $meta['site-sidebar-layout']['default'] : 'default'; + $site_content_layout = ( isset( $meta['site-content-layout']['default'] ) ) ? $meta['site-content-layout']['default'] : 'default'; + $site_post_title = ( isset( $meta['site-post-title']['default'] ) ) ? $meta['site-post-title']['default'] : ''; + $footer_bar = ( isset( $meta['footer-sml-layout']['default'] ) ) ? $meta['footer-sml-layout']['default'] : ''; + $footer_widgets = ( isset( $meta['footer-adv-display']['default'] ) ) ? $meta['footer-adv-display']['default'] : ''; + $above_header = ( isset( $meta['ast-hfb-above-header-display']['default'] ) ) ? $meta['ast-hfb-above-header-display']['default'] : 'default'; + $primary_header = ( isset( $meta['ast-main-header-display']['default'] ) ) ? $meta['ast-main-header-display']['default'] : ''; + $below_header = ( isset( $meta['ast-hfb-below-header-display']['default'] ) ) ? $meta['ast-hfb-below-header-display']['default'] : 'default'; + $mobile_header = ( isset( $meta['ast-hfb-mobile-header-display']['default'] ) ) ? $meta['ast-hfb-mobile-header-display']['default'] : 'default'; + $ast_featured_img = ( isset( $meta['ast-featured-img']['default'] ) ) ? $meta['ast-featured-img']['default'] : ''; + $breadcrumbs_content = ( isset( $meta['ast-breadcrumbs-content']['default'] ) ) ? $meta['ast-breadcrumbs-content']['default'] : ''; + + $show_meta_field = ! self::is_bb_themer_layout(); + do_action( 'astra_meta_box_markup_before', $meta ); + + /** + * Option: Sidebar + */ + ?> +
        +

        + +

        + +
        + +
        +

        + +

        + +
        + + + $data ) { + + // Sanitize values. + $sanitize_filter = ( isset( $data['sanitize'] ) ) ? $data['sanitize'] : 'FILTER_DEFAULT'; + + switch ( $sanitize_filter ) { + + case 'FILTER_SANITIZE_STRING': + $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_STRING ); + break; + + case 'FILTER_SANITIZE_URL': + $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_URL ); + break; + + case 'FILTER_SANITIZE_NUMBER_INT': + $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_NUMBER_INT ); + break; + + default: + $meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT ); + break; + } + + // Store values. + if ( $meta_value ) { + update_post_meta( $post_id, $key, $meta_value ); + } else { + delete_post_meta( $post_id, $key ); + } + } + + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_Meta_Boxes::get_instance(); diff --git a/inc/metabox/index.php b/inc/metabox/index.php index 8b96815..820bcb9 100644 --- a/inc/metabox/index.php +++ b/inc/metabox/index.php @@ -1,9 +1,9 @@ -schema_enabled() ) ) { - add_filter( 'astra_breadcrumb_trail_args', array( $this, 'breadcrumb_schema' ) ); - } - } - - /** - * Disable schema by passing false to the 'schema' param to the filter. - * - * @since 2.1.3 - * - * @param array $args An array of default values. - * - * @return array Updated schema param. - */ - public function breadcrumb_schema( $args ) { - $args['schema'] = false; - - return $args; - } - - /** - * Enabled schema - * - * @since 2.1.3 - */ - protected function schema_enabled() { - return apply_filters( 'astra_breadcrumb_schema_enabled', parent::schema_enabled() ); - } - -} - -new Astra_Breadcrumb_Schema(); +schema_enabled() ) ) { + add_filter( 'astra_breadcrumb_trail_args', array( $this, 'breadcrumb_schema' ) ); + } + } + + /** + * Disable schema by passing false to the 'schema' param to the filter. + * + * @since 2.1.3 + * + * @param array $args An array of default values. + * + * @return array Updated schema param. + */ + public function breadcrumb_schema( $args ) { + $args['schema'] = false; + + return $args; + } + + /** + * Enabled schema + * + * @since 2.1.3 + */ + protected function schema_enabled() { + return apply_filters( 'astra_breadcrumb_schema_enabled', parent::schema_enabled() ); + } + +} + +new Astra_Breadcrumb_Schema(); diff --git a/inc/schema/class-astra-creativework-schema.php b/inc/schema/class-astra-creativework-schema.php index 1707f84..f6ef390 100644 --- a/inc/schema/class-astra-creativework-schema.php +++ b/inc/schema/class-astra-creativework-schema.php @@ -1,247 +1,247 @@ -schema_enabled() ) { - return false; - } - - add_filter( 'astra_attr_article-blog', array( $this, 'creative_work_schema' ) ); - add_filter( 'astra_attr_article-page', array( $this, 'creative_work_schema' ) ); - add_filter( 'astra_attr_article-single', array( $this, 'creative_work_schema' ) ); - add_filter( 'astra_attr_article-content', array( $this, 'creative_work_schema' ) ); - add_filter( 'astra_attr_article-title-blog', array( $this, 'article_title_blog_schema_prop' ) ); - add_filter( 'astra_attr_article-title-blog-single', array( $this, 'article_title_blog_single_schema_prop' ) ); - add_filter( 'astra_attr_article-title-content-page', array( $this, 'article_title_content_page_schema_prop' ) ); - add_filter( 'astra_attr_article-title-content', array( $this, 'article_title_content_schema_prop' ) ); - add_filter( 'astra_attr_article-entry-content-blog-layout', array( $this, 'article_content_blog_layout_schema_prop' ) ); - add_filter( 'astra_attr_article-entry-content-page', array( $this, 'article_content_page_schema_prop' ) ); - add_filter( 'astra_attr_article-entry-content', array( $this, 'article_content_schema_prop' ) ); - add_filter( 'astra_attr_article-entry-content-blog-layout-2', array( $this, 'article_content_blog_layout_2_schema_prop' ) ); - add_filter( 'astra_attr_article-entry-content-blog-layout-3', array( $this, 'article_content_blog_layout_3_schema_prop' ) ); - add_filter( 'astra_attr_article-entry-content-single-layout', array( $this, 'article_content_single_layout_schema_prop' ) ); - add_filter( 'astra_post_thumbnail_itemprop', array( $this, 'article_image_schema_prop' ) ); - add_filter( 'astra_attr_article-image-blog-archive', array( $this, 'article_image_blog_archive_schema_prop' ) ); - add_filter( 'astra_attr_article-image-blog-single-post', array( $this, 'article_image_blog_single_post_schema_prop' ) ); - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function creative_work_schema( $attr ) { - $attr['itemtype'] = 'https://schema.org/CreativeWork'; - $attr['itemscope'] = 'itemscope'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_title_blog_schema_prop( $attr ) { - $attr['itemprop'] = 'headline'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_title_blog_single_schema_prop( $attr ) { - $attr['itemprop'] = 'headline'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_title_content_page_schema_prop( $attr ) { - $attr['itemprop'] = 'headline'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_title_content_schema_prop( $attr ) { - $attr['itemprop'] = 'headline'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_content_blog_layout_schema_prop( $attr ) { - $attr['itemprop'] = 'text'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_content_page_schema_prop( $attr ) { - $attr['itemprop'] = 'text'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_content_schema_prop( $attr ) { - $attr['itemprop'] = 'text'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_content_blog_layout_2_schema_prop( $attr ) { - $attr['itemprop'] = 'text'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_content_blog_layout_3_schema_prop( $attr ) { - $attr['itemprop'] = 'text'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_content_single_layout_schema_prop( $attr ) { - $attr['itemprop'] = 'text'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_image_schema_prop( $attr ) { - $attr = 'itemprop=image'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_image_blog_archive_schema_prop( $attr ) { - $attr['itemprop'] = 'image'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function article_image_blog_single_post_schema_prop( $attr ) { - $attr['itemprop'] = 'image'; - - return $attr; - } - - /** - * Enabled schema - * - * @since 2.1.3 - */ - protected function schema_enabled() { - return apply_filters( 'astra_creativework_schema_enabled', parent::schema_enabled() ); - } - -} - -new Astra_CreativeWork_Schema(); +schema_enabled() ) { + return false; + } + + add_filter( 'astra_attr_article-blog', array( $this, 'creative_work_schema' ) ); + add_filter( 'astra_attr_article-page', array( $this, 'creative_work_schema' ) ); + add_filter( 'astra_attr_article-single', array( $this, 'creative_work_schema' ) ); + add_filter( 'astra_attr_article-content', array( $this, 'creative_work_schema' ) ); + add_filter( 'astra_attr_article-title-blog', array( $this, 'article_title_blog_schema_prop' ) ); + add_filter( 'astra_attr_article-title-blog-single', array( $this, 'article_title_blog_single_schema_prop' ) ); + add_filter( 'astra_attr_article-title-content-page', array( $this, 'article_title_content_page_schema_prop' ) ); + add_filter( 'astra_attr_article-title-content', array( $this, 'article_title_content_schema_prop' ) ); + add_filter( 'astra_attr_article-entry-content-blog-layout', array( $this, 'article_content_blog_layout_schema_prop' ) ); + add_filter( 'astra_attr_article-entry-content-page', array( $this, 'article_content_page_schema_prop' ) ); + add_filter( 'astra_attr_article-entry-content', array( $this, 'article_content_schema_prop' ) ); + add_filter( 'astra_attr_article-entry-content-blog-layout-2', array( $this, 'article_content_blog_layout_2_schema_prop' ) ); + add_filter( 'astra_attr_article-entry-content-blog-layout-3', array( $this, 'article_content_blog_layout_3_schema_prop' ) ); + add_filter( 'astra_attr_article-entry-content-single-layout', array( $this, 'article_content_single_layout_schema_prop' ) ); + add_filter( 'astra_post_thumbnail_itemprop', array( $this, 'article_image_schema_prop' ) ); + add_filter( 'astra_attr_article-image-blog-archive', array( $this, 'article_image_blog_archive_schema_prop' ) ); + add_filter( 'astra_attr_article-image-blog-single-post', array( $this, 'article_image_blog_single_post_schema_prop' ) ); + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function creative_work_schema( $attr ) { + $attr['itemtype'] = 'https://schema.org/CreativeWork'; + $attr['itemscope'] = 'itemscope'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_title_blog_schema_prop( $attr ) { + $attr['itemprop'] = 'headline'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_title_blog_single_schema_prop( $attr ) { + $attr['itemprop'] = 'headline'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_title_content_page_schema_prop( $attr ) { + $attr['itemprop'] = 'headline'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_title_content_schema_prop( $attr ) { + $attr['itemprop'] = 'headline'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_content_blog_layout_schema_prop( $attr ) { + $attr['itemprop'] = 'text'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_content_page_schema_prop( $attr ) { + $attr['itemprop'] = 'text'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_content_schema_prop( $attr ) { + $attr['itemprop'] = 'text'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_content_blog_layout_2_schema_prop( $attr ) { + $attr['itemprop'] = 'text'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_content_blog_layout_3_schema_prop( $attr ) { + $attr['itemprop'] = 'text'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_content_single_layout_schema_prop( $attr ) { + $attr['itemprop'] = 'text'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_image_schema_prop( $attr ) { + $attr = 'itemprop=image'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_image_blog_archive_schema_prop( $attr ) { + $attr['itemprop'] = 'image'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function article_image_blog_single_post_schema_prop( $attr ) { + $attr['itemprop'] = 'image'; + + return $attr; + } + + /** + * Enabled schema + * + * @since 2.1.3 + */ + protected function schema_enabled() { + return apply_filters( 'astra_creativework_schema_enabled', parent::schema_enabled() ); + } + +} + +new Astra_CreativeWork_Schema(); diff --git a/inc/schema/class-astra-organization-schema.php b/inc/schema/class-astra-organization-schema.php index 7e72f4c..2d358b3 100644 --- a/inc/schema/class-astra-organization-schema.php +++ b/inc/schema/class-astra-organization-schema.php @@ -1,151 +1,151 @@ -schema_enabled() ) { - return false; - } - - add_filter( 'astra_attr_site-identity', array( $this, 'organization_Schema' ) ); - add_filter( 'astra_attr_site-title', array( $this, 'site_title_attr' ) ); - add_filter( 'astra_attr_site-title-link', array( $this, 'site_title_link_attr' ) ); - add_filter( 'astra_attr_site-title-custom-link', array( $this, 'site_title_custom_link_attr' ) ); - add_filter( 'astra_attr_site-title-sticky-custom-link', array( $this, 'site_title_sticky_custom_link_attr' ) ); - add_filter( 'astra_attr_site-title-none-sticky-custom-link', array( $this, 'site_title_none_sticky_custom_link_attr' ) ); - add_filter( 'astra_attr_site-title-sticky-custom-logo-link', array( $this, 'site_title_sticky_custom_logo_link_attr' ) ); - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function organization_Schema( $attr ) { - $attr['itemtype'] = 'https://schema.org/Organization'; - $attr['itemscope'] = 'itemscope'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function site_title_attr( $attr ) { - $attr['itemprop'] = 'name'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function site_title_link_attr( $attr ) { - $attr['itemprop'] = 'url'; - $attr['class'] = ''; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function site_title_custom_link_attr( $attr ) { - $attr['itemprop'] = 'url'; - $attr['class'] = ''; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function site_title_sticky_custom_link_attr( $attr ) { - $attr['itemprop'] = 'url'; - $attr['class'] = ''; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function site_title_none_sticky_custom_link_attr( $attr ) { - $attr['itemprop'] = 'url'; - $attr['class'] = ''; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function site_title_sticky_custom_logo_link_attr( $attr ) { - $attr['itemprop'] = 'url'; - $attr['class'] = ''; - - return $attr; - } - - /** - * Enabled schema - * - * @since 2.1.3 - */ - protected function schema_enabled() { - return apply_filters( 'astra_organization_schema_enabled', parent::schema_enabled() ); - } - -} - -new Astra_Organization_Schema(); +schema_enabled() ) { + return false; + } + + add_filter( 'astra_attr_site-identity', array( $this, 'organization_Schema' ) ); + add_filter( 'astra_attr_site-title', array( $this, 'site_title_attr' ) ); + add_filter( 'astra_attr_site-title-link', array( $this, 'site_title_link_attr' ) ); + add_filter( 'astra_attr_site-title-custom-link', array( $this, 'site_title_custom_link_attr' ) ); + add_filter( 'astra_attr_site-title-sticky-custom-link', array( $this, 'site_title_sticky_custom_link_attr' ) ); + add_filter( 'astra_attr_site-title-none-sticky-custom-link', array( $this, 'site_title_none_sticky_custom_link_attr' ) ); + add_filter( 'astra_attr_site-title-sticky-custom-logo-link', array( $this, 'site_title_sticky_custom_logo_link_attr' ) ); + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function organization_Schema( $attr ) { + $attr['itemtype'] = 'https://schema.org/Organization'; + $attr['itemscope'] = 'itemscope'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function site_title_attr( $attr ) { + $attr['itemprop'] = 'name'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function site_title_link_attr( $attr ) { + $attr['itemprop'] = 'url'; + $attr['class'] = ''; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function site_title_custom_link_attr( $attr ) { + $attr['itemprop'] = 'url'; + $attr['class'] = ''; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function site_title_sticky_custom_link_attr( $attr ) { + $attr['itemprop'] = 'url'; + $attr['class'] = ''; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function site_title_none_sticky_custom_link_attr( $attr ) { + $attr['itemprop'] = 'url'; + $attr['class'] = ''; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function site_title_sticky_custom_logo_link_attr( $attr ) { + $attr['itemprop'] = 'url'; + $attr['class'] = ''; + + return $attr; + } + + /** + * Enabled schema + * + * @since 2.1.3 + */ + protected function schema_enabled() { + return apply_filters( 'astra_organization_schema_enabled', parent::schema_enabled() ); + } + +} + +new Astra_Organization_Schema(); diff --git a/inc/schema/class-astra-person-schema.php b/inc/schema/class-astra-person-schema.php index 6097267..e70be77 100644 --- a/inc/schema/class-astra-person-schema.php +++ b/inc/schema/class-astra-person-schema.php @@ -1,148 +1,148 @@ -schema_enabled() ) { - return false; - } - - add_filter( 'astra_attr_post-meta-author', array( $this, 'person_Schema' ) ); - add_filter( 'astra_attr_author-name', array( $this, 'author_name_schema_itemprop' ) ); - add_filter( 'astra_attr_author-url', array( $this, 'author_url_schema_itemprop' ) ); - add_filter( 'astra_attr_author-name-info', array( $this, 'author_name_info_schema_itemprop' ) ); - add_filter( 'astra_attr_author-url-info', array( $this, 'author_info_url_schema_itemprop' ) ); - add_filter( 'astra_attr_author-item-info', array( $this, 'author_item_schema_itemprop' ) ); - add_filter( 'astra_attr_author-desc-info', array( $this, 'author_desc_schema_itemprop' ) ); - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function person_Schema( $attr ) { - $attr['itemtype'] = 'https://schema.org/Person'; - $attr['itemscope'] = 'itemscope'; - $attr['itemprop'] = 'author'; - $attr['class'] = 'posted-by vcard author'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function author_name_schema_itemprop( $attr ) { - $attr['itemprop'] = 'name'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function author_name_info_schema_itemprop( $attr ) { - $attr['itemprop'] = 'name'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function author_url_schema_itemprop( $attr ) { - $attr['itemprop'] = 'url'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function author_info_url_schema_itemprop( $attr ) { - $attr['itemprop'] = 'url'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function author_desc_schema_itemprop( $attr ) { - $attr['itemprop'] = 'description'; - - return $attr; - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function author_item_schema_itemprop( $attr ) { - $attr['itemprop'] = 'author'; - - return $attr; - } - - /** - * Enabled schema - * - * @since 2.1.3 - */ - protected function schema_enabled() { - return apply_filters( 'astra_person_schema_enabled', parent::schema_enabled() ); - } - -} - -new Astra_Person_Schema(); +schema_enabled() ) { + return false; + } + + add_filter( 'astra_attr_post-meta-author', array( $this, 'person_Schema' ) ); + add_filter( 'astra_attr_author-name', array( $this, 'author_name_schema_itemprop' ) ); + add_filter( 'astra_attr_author-url', array( $this, 'author_url_schema_itemprop' ) ); + add_filter( 'astra_attr_author-name-info', array( $this, 'author_name_info_schema_itemprop' ) ); + add_filter( 'astra_attr_author-url-info', array( $this, 'author_info_url_schema_itemprop' ) ); + add_filter( 'astra_attr_author-item-info', array( $this, 'author_item_schema_itemprop' ) ); + add_filter( 'astra_attr_author-desc-info', array( $this, 'author_desc_schema_itemprop' ) ); + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function person_Schema( $attr ) { + $attr['itemtype'] = 'https://schema.org/Person'; + $attr['itemscope'] = 'itemscope'; + $attr['itemprop'] = 'author'; + $attr['class'] = 'posted-by vcard author'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function author_name_schema_itemprop( $attr ) { + $attr['itemprop'] = 'name'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function author_name_info_schema_itemprop( $attr ) { + $attr['itemprop'] = 'name'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function author_url_schema_itemprop( $attr ) { + $attr['itemprop'] = 'url'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function author_info_url_schema_itemprop( $attr ) { + $attr['itemprop'] = 'url'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function author_desc_schema_itemprop( $attr ) { + $attr['itemprop'] = 'description'; + + return $attr; + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function author_item_schema_itemprop( $attr ) { + $attr['itemprop'] = 'author'; + + return $attr; + } + + /** + * Enabled schema + * + * @since 2.1.3 + */ + protected function schema_enabled() { + return apply_filters( 'astra_person_schema_enabled', parent::schema_enabled() ); + } + +} + +new Astra_Person_Schema(); diff --git a/inc/schema/class-astra-schema.php b/inc/schema/class-astra-schema.php index d963687..d08c3e3 100644 --- a/inc/schema/class-astra-schema.php +++ b/inc/schema/class-astra-schema.php @@ -1,68 +1,68 @@ -include_schemas(); - - add_action( 'wp', array( $this, 'setup_schema' ) ); - } - - /** - * Setup schema - * - * @since 2.1.3 - */ - public function setup_schema() { } - - /** - * Include schema files. - * - * @since 2.1.3 - */ - private function include_schemas() { - // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-creativework-schema.php'; - require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-wpheader-schema.php'; - require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-wpfooter-schema.php'; - require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-wpsidebar-schema.php'; - require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-person-schema.php'; - require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-organization-schema.php'; - require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-site-navigation-schema.php'; - require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-breadcrumb-schema.php'; - // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - } - - /** - * Enabled schema - * - * @since 2.1.3 - */ - protected function schema_enabled() { - return apply_filters( 'astra_schema_enabled', true ); - } - -} - -new Astra_Schema(); +include_schemas(); + + add_action( 'wp', array( $this, 'setup_schema' ) ); + } + + /** + * Setup schema + * + * @since 2.1.3 + */ + public function setup_schema() { } + + /** + * Include schema files. + * + * @since 2.1.3 + */ + private function include_schemas() { + // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-creativework-schema.php'; + require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-wpheader-schema.php'; + require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-wpfooter-schema.php'; + require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-wpsidebar-schema.php'; + require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-person-schema.php'; + require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-organization-schema.php'; + require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-site-navigation-schema.php'; + require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-breadcrumb-schema.php'; + // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + } + + /** + * Enabled schema + * + * @since 2.1.3 + */ + protected function schema_enabled() { + return apply_filters( 'astra_schema_enabled', true ); + } + +} + +new Astra_Schema(); diff --git a/inc/schema/class-astra-site-navigation-schema.php b/inc/schema/class-astra-site-navigation-schema.php index 356cad5..623c4e3 100644 --- a/inc/schema/class-astra-site-navigation-schema.php +++ b/inc/schema/class-astra-site-navigation-schema.php @@ -1,62 +1,62 @@ -schema_enabled() ) { - return false; - } - - add_filter( 'astra_attr_site-navigation', array( $this, 'site_navigation_schema' ) ); - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function site_navigation_schema( $attr ) { - $attr['itemtype'] = 'https://schema.org/SiteNavigationElement'; - $attr['itemscope'] = 'itemscope'; - - return $attr; - } - - /** - * Enabled schema - * - * @since 2.1.3 - */ - protected function schema_enabled() { - return apply_filters( 'astra_site_navigation_schema_enabled', parent::schema_enabled() ); - } - -} - -new Astra_Site_Navigation_Schema(); +schema_enabled() ) { + return false; + } + + add_filter( 'astra_attr_site-navigation', array( $this, 'site_navigation_schema' ) ); + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function site_navigation_schema( $attr ) { + $attr['itemtype'] = 'https://schema.org/SiteNavigationElement'; + $attr['itemscope'] = 'itemscope'; + + return $attr; + } + + /** + * Enabled schema + * + * @since 2.1.3 + */ + protected function schema_enabled() { + return apply_filters( 'astra_site_navigation_schema_enabled', parent::schema_enabled() ); + } + +} + +new Astra_Site_Navigation_Schema(); diff --git a/inc/schema/class-astra-wpfooter-schema.php b/inc/schema/class-astra-wpfooter-schema.php index 100d94f..f6afae8 100644 --- a/inc/schema/class-astra-wpfooter-schema.php +++ b/inc/schema/class-astra-wpfooter-schema.php @@ -1,62 +1,62 @@ -schema_enabled() ) { - return false; - } - - add_filter( 'astra_attr_footer', array( $this, 'wpfooter_Schema' ) ); - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function wpfooter_Schema( $attr ) { - $attr['itemtype'] = 'https://schema.org/WPFooter'; - $attr['itemscope'] = 'itemscope'; - $attr['itemid'] = '#colophon'; - return $attr; - } - - /** - * Enabled schema - * - * @since 2.1.3 - */ - protected function schema_enabled() { - return apply_filters( 'astra_wpfooter_schema_enabled', parent::schema_enabled() ); - } - -} - -new Astra_WPFooter_Schema(); +schema_enabled() ) { + return false; + } + + add_filter( 'astra_attr_footer', array( $this, 'wpfooter_Schema' ) ); + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function wpfooter_Schema( $attr ) { + $attr['itemtype'] = 'https://schema.org/WPFooter'; + $attr['itemscope'] = 'itemscope'; + $attr['itemid'] = '#colophon'; + return $attr; + } + + /** + * Enabled schema + * + * @since 2.1.3 + */ + protected function schema_enabled() { + return apply_filters( 'astra_wpfooter_schema_enabled', parent::schema_enabled() ); + } + +} + +new Astra_WPFooter_Schema(); diff --git a/inc/schema/class-astra-wpheader-schema.php b/inc/schema/class-astra-wpheader-schema.php index 0bbd5fe..970eca2 100644 --- a/inc/schema/class-astra-wpheader-schema.php +++ b/inc/schema/class-astra-wpheader-schema.php @@ -1,63 +1,63 @@ -schema_enabled() ) { - return false; - } - - add_filter( 'astra_attr_header', array( $this, 'wpheader_Schema' ) ); - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function wpheader_Schema( $attr ) { - $attr['itemtype'] = 'https://schema.org/WPHeader'; - $attr['itemscope'] = 'itemscope'; - $attr['itemid'] = '#masthead'; - - return $attr; - } - - /** - * Enabled schema - * - * @since 2.1.3 - */ - protected function schema_enabled() { - return apply_filters( 'astra_wpheader_schema_enabled', parent::schema_enabled() ); - } - -} - -new Astra_WPHeader_Schema(); +schema_enabled() ) { + return false; + } + + add_filter( 'astra_attr_header', array( $this, 'wpheader_Schema' ) ); + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function wpheader_Schema( $attr ) { + $attr['itemtype'] = 'https://schema.org/WPHeader'; + $attr['itemscope'] = 'itemscope'; + $attr['itemid'] = '#masthead'; + + return $attr; + } + + /** + * Enabled schema + * + * @since 2.1.3 + */ + protected function schema_enabled() { + return apply_filters( 'astra_wpheader_schema_enabled', parent::schema_enabled() ); + } + +} + +new Astra_WPHeader_Schema(); diff --git a/inc/schema/class-astra-wpsidebar-schema.php b/inc/schema/class-astra-wpsidebar-schema.php index 6254d37..1f04229 100644 --- a/inc/schema/class-astra-wpsidebar-schema.php +++ b/inc/schema/class-astra-wpsidebar-schema.php @@ -1,62 +1,62 @@ -schema_enabled() ) { - return false; - } - - add_filter( 'astra_attr_sidebar', array( $this, 'wpsidebar_Schema' ) ); - } - - /** - * Update Schema markup attribute. - * - * @param array $attr An array of attributes. - * - * @return array Updated embed markup. - */ - public function wpsidebar_Schema( $attr ) { - $attr['itemtype'] = 'https://schema.org/WPSideBar'; - $attr['itemscope'] = 'itemscope'; - - return $attr; - } - - /** - * Enabled schema - * - * @since 2.1.3 - */ - protected function schema_enabled() { - return apply_filters( 'astra_wpsidebar_schema_enabled', parent::schema_enabled() ); - } - -} - -new Astra_WPSideBar_Schema(); +schema_enabled() ) { + return false; + } + + add_filter( 'astra_attr_sidebar', array( $this, 'wpsidebar_Schema' ) ); + } + + /** + * Update Schema markup attribute. + * + * @param array $attr An array of attributes. + * + * @return array Updated embed markup. + */ + public function wpsidebar_Schema( $attr ) { + $attr['itemtype'] = 'https://schema.org/WPSideBar'; + $attr['itemscope'] = 'itemscope'; + + return $attr; + } + + /** + * Enabled schema + * + * @since 2.1.3 + */ + protected function schema_enabled() { + return apply_filters( 'astra_wpsidebar_schema_enabled', parent::schema_enabled() ); + } + +} + +new Astra_WPSideBar_Schema(); diff --git a/inc/template-parts.php b/inc/template-parts.php index cf2fef1..d6c1b83 100644 --- a/inc/template-parts.php +++ b/inc/template-parts.php @@ -1,363 +1,363 @@ - 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( 'ast_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 - } - } -} + 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( 'ast_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 + } + } +} diff --git a/inc/template-tags.php b/inc/template-tags.php index 7cc12c8..b24b18d 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -1,42 +1,42 @@ -'; - - /** - * Get default strings. - * - * @see astra_default_strings - */ - comments_popup_link( astra_default_strings( 'string-blog-meta-leave-a-comment', false ), astra_default_strings( 'string-blog-meta-one-comment', false ), astra_default_strings( 'string-blog-meta-multiple-comment', false ) ); - echo ''; - } - - astra_edit_post_link( - sprintf( - /* translators: %s: Name of current post */ - esc_html__( 'Edit %s', 'astra' ), - the_title( '"', '"', false ) - ), - '', - '' - ); - } -endif; +'; + + /** + * Get default strings. + * + * @see astra_default_strings + */ + comments_popup_link( astra_default_strings( 'string-blog-meta-leave-a-comment', false ), astra_default_strings( 'string-blog-meta-one-comment', false ), astra_default_strings( 'string-blog-meta-multiple-comment', false ) ); + echo ''; + } + + astra_edit_post_link( + sprintf( + /* translators: %s: Name of current post */ + esc_html__( 'Edit %s', 'astra' ), + the_title( '"', '"', false ) + ), + '', + '' + ); + } +endif; diff --git a/inc/theme-update/astra-update-functions.php b/inc/theme-update/astra-update-functions.php index 5bb286d..0d21d26 100644 --- a/inc/theme-update/astra-update-functions.php +++ b/inc/theme-update/astra-update-functions.php @@ -1,3132 +1,3132 @@ - array( - 'top' => $btn_vertical_padding, - 'right' => $btn_horizontal_padding, - 'bottom' => $btn_vertical_padding, - 'left' => $btn_horizontal_padding, - ), - 'tablet' => array( - 'top' => '', - 'right' => '', - 'bottom' => '', - 'left' => '', - ), - 'mobile' => array( - 'top' => '', - 'right' => '', - 'bottom' => '', - 'left' => '', - ), - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ); - - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Migrate option data from button url to the new link param. - * - * @since 2.3.0 - * - * @return void - */ -function astra_header_button_new_options() { - - $theme_options = get_option( 'astra-settings', array() ); - - $btn_url = isset( $theme_options['header-main-rt-section-button-link'] ) ? $theme_options['header-main-rt-section-button-link'] : 'https://www.wpastra.com'; - $theme_options['header-main-rt-section-button-link-option'] = array( - 'url' => $btn_url, - 'new_tab' => false, - 'link_rel' => '', - ); - - update_option( 'astra-settings', $theme_options ); -} - -/** - * For existing users, do not provide Elementor Default Color Typo settings compatibility by default. - * - * @since 2.3.3 - * - * @return void - */ -function astra_elementor_default_color_typo_comp() { - - $theme_options = get_option( 'astra-settings', array() ); - - // Set flag to not load button specific CSS. - if ( ! isset( $theme_options['ele-default-color-typo-setting-comp'] ) ) { - $theme_options['ele-default-color-typo-setting-comp'] = false; - update_option( 'astra-settings', $theme_options ); - } - -} - -/** - * For existing users, change the separator from html entity to css entity. - * - * @since 2.3.4 - * - * @return void - */ -function astra_breadcrumb_separator_fix() { - - $theme_options = get_option( 'astra-settings', array() ); - - // Check if the saved database value for Breadcrumb Separator is "»", then change it to '\00bb'. - if ( isset( $theme_options['breadcrumb-separator'] ) && '»' === $theme_options['breadcrumb-separator'] ) { - $theme_options['breadcrumb-separator'] = '\00bb'; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Check if we need to change the default value for tablet breakpoint. - * - * @since 2.4.0 - * @return void - */ -function astra_update_theme_tablet_breakpoint() { - - $theme_options = get_option( 'astra-settings' ); - - if ( ! isset( $theme_options['can-update-theme-tablet-breakpoint'] ) ) { - // Set a flag to check if we need to change the theme tablet breakpoint value. - $theme_options['can-update-theme-tablet-breakpoint'] = false; - } - - update_option( 'astra-settings', $theme_options ); -} - -/** - * Migrate option data from site layout background option to its desktop counterpart. - * - * @since 2.4.0 - * - * @return void - */ -function astra_responsive_base_background_option() { - - $theme_options = get_option( 'astra-settings', array() ); - - if ( false === get_option( 'site-layout-outside-bg-obj-responsive', false ) && isset( $theme_options['site-layout-outside-bg-obj'] ) ) { - - $theme_options['site-layout-outside-bg-obj-responsive']['desktop'] = $theme_options['site-layout-outside-bg-obj']; - $theme_options['site-layout-outside-bg-obj-responsive']['tablet'] = array( - 'background-color' => '', - 'background-image' => '', - 'background-repeat' => 'repeat', - 'background-position' => 'center center', - 'background-size' => 'auto', - 'background-attachment' => 'scroll', - ); - $theme_options['site-layout-outside-bg-obj-responsive']['mobile'] = array( - 'background-color' => '', - 'background-image' => '', - 'background-repeat' => 'repeat', - 'background-position' => 'center center', - 'background-size' => 'auto', - 'background-attachment' => 'scroll', - ); - } - - update_option( 'astra-settings', $theme_options ); -} - -/** - * Do not apply new wide/full image CSS for existing users. - * - * @since 2.4.4 - * - * @return void - */ -function astra_gtn_full_wide_image_group_css() { - - $theme_options = get_option( 'astra-settings', array() ); - - // Set flag to not load button specific CSS. - if ( ! isset( $theme_options['gtn-full-wide-image-grp-css'] ) ) { - $theme_options['gtn-full-wide-image-grp-css'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Do not apply new wide/full Group and Cover block CSS for existing users. - * - * @since 2.5.0 - * - * @return void - */ -function astra_gtn_full_wide_group_cover_css() { - $theme_options = get_option( 'astra-settings', array() ); - - if ( ! isset( $theme_options['gtn-full-wide-grp-cover-css'] ) ) { - $theme_options['gtn-full-wide-grp-cover-css'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - - -/** - * Do not apply the global border width and border color setting for the existng users. - * - * @since 2.5.0 - * - * @return void - */ -function astra_global_button_woo_css() { - $theme_options = get_option( 'astra-settings', array() ); - - // Set flag to not load button specific CSS. - if ( ! isset( $theme_options['global-btn-woo-css'] ) ) { - $theme_options['global-btn-woo-css'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Migrate Footer Widget param to array. - * - * @since 2.5.2 - * - * @return void - */ -function astra_footer_widget_bg() { - $theme_options = get_option( 'astra-settings', array() ); - - // Check if Footer Backgound array is already set or not. If not then set it as array. - if ( isset( $theme_options['footer-adv-bg-obj'] ) && ! is_array( $theme_options['footer-adv-bg-obj'] ) ) { - $theme_options['footer-adv-bg-obj'] = array( - 'background-color' => '', - 'background-image' => '', - 'background-repeat' => 'repeat', - 'background-position' => 'center center', - 'background-size' => 'auto', - 'background-attachment' => 'scroll', - ); - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Check if we need to load icons as font or SVG. - * - * @since 3.3.0 - * @return void - */ -function astra_icons_svg_compatibility() { - - $theme_options = get_option( 'astra-settings' ); - - if ( ! isset( $theme_options['can-update-astra-icons-svg'] ) ) { - // Set a flag to check if we need to add icons as SVG. - $theme_options['can-update-astra-icons-svg'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Migrate Background control options to new array. - * - * @since 3.0.0 - * - * @return void - */ -function astra_bg_control_migration() { - - $db_options = array( - 'footer-adv-bg-obj', - 'footer-bg-obj', - 'sidebar-bg-obj', - ); - - $theme_options = get_option( 'astra-settings', array() ); - - foreach ( $db_options as $option_name ) { - - if ( ! ( isset( $theme_options[ $option_name ]['background-type'] ) && isset( $theme_options[ $option_name ]['background-media'] ) ) && isset( $theme_options[ $option_name ] ) ) { - - if ( ! empty( $theme_options[ $option_name ]['background-image'] ) ) { - $theme_options[ $option_name ]['background-type'] = 'image'; - $theme_options[ $option_name ]['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['background-image'] ); - } else { - $theme_options[ $option_name ]['background-type'] = ''; - $theme_options[ $option_name ]['background-media'] = ''; - } - - error_log( sprintf( 'Astra: Migrating Background Option - %s', $option_name ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log - update_option( 'astra-settings', $theme_options ); - } - } -} - -/** - * Migrate Background Responsive options to new array. - * - * @since 3.0.0 - * - * @return void - */ -function astra_bg_responsive_control_migration() { - - $db_options = array( - 'site-layout-outside-bg-obj-responsive', - 'content-bg-obj-responsive', - 'header-bg-obj-responsive', - 'primary-menu-bg-obj-responsive', - 'above-header-bg-obj-responsive', - 'above-header-menu-bg-obj-responsive', - 'below-header-bg-obj-responsive', - 'below-header-menu-bg-obj-responsive', - ); - - $theme_options = get_option( 'astra-settings', array() ); - - foreach ( $db_options as $option_name ) { - - if ( ! ( isset( $theme_options[ $option_name ]['desktop']['background-type'] ) && isset( $theme_options[ $option_name ]['desktop']['background-media'] ) ) && isset( $theme_options[ $option_name ] ) ) { - - if ( ! empty( $theme_options[ $option_name ]['desktop']['background-image'] ) ) { - $theme_options[ $option_name ]['desktop']['background-type'] = 'image'; - $theme_options[ $option_name ]['desktop']['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['desktop']['background-image'] ); - } else { - $theme_options[ $option_name ]['desktop']['background-type'] = ''; - $theme_options[ $option_name ]['desktop']['background-media'] = ''; - } - - if ( ! empty( $theme_options[ $option_name ]['tablet']['background-image'] ) ) { - $theme_options[ $option_name ]['tablet']['background-type'] = 'image'; - $theme_options[ $option_name ]['tablet']['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['tablet']['background-image'] ); - } else { - $theme_options[ $option_name ]['tablet']['background-type'] = ''; - $theme_options[ $option_name ]['tablet']['background-media'] = ''; - } - - if ( ! empty( $theme_options[ $option_name ]['mobile']['background-image'] ) ) { - $theme_options[ $option_name ]['mobile']['background-type'] = 'image'; - $theme_options[ $option_name ]['mobile']['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['mobile']['background-image'] ); - } else { - $theme_options[ $option_name ]['mobile']['background-type'] = ''; - $theme_options[ $option_name ]['mobile']['background-media'] = ''; - } - - error_log( sprintf( 'Astra: Migrating Background Response Option - %s', $option_name ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log - update_option( 'astra-settings', $theme_options ); - } - } -} - -/** - * Do not apply new Group, Column and Media & Text block CSS for existing users. - * - * @since 3.0.0 - * - * @return void - */ -function astra_gutenberg_core_blocks_design_compatibility() { - $theme_options = get_option( 'astra-settings', array() ); - - if ( ! isset( $theme_options['guntenberg-core-blocks-comp-css'] ) ) { - $theme_options['guntenberg-core-blocks-comp-css'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Header Footer builder - Migration compatibility. - * - * @since 3.0.0 - * - * @return void - */ -function astra_header_builder_compatibility() { - $theme_options = get_option( 'astra-settings', array() ); - - // Set flag to not load button specific CSS. - if ( ! isset( $theme_options['is-header-footer-builder'] ) ) { - $theme_options['is-header-footer-builder'] = false; - update_option( 'astra-settings', $theme_options ); - } - if ( ! isset( $theme_options['header-footer-builder-notice'] ) ) { - $theme_options['header-footer-builder-notice'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Clears assets cache and regenerates new assets files. - * - * @since 3.0.1 - * - * @return void - */ -function astra_clear_assets_cache() { - if ( is_callable( 'Astra_Minify::refresh_assets' ) ) { - Astra_Minify::refresh_assets(); - } -} - -/** - * Header Footer builder - Migration of options. - * - * @since 3.0.0 - * - * @return void - */ -function astra_header_builder_migration() { - - /** - * All theme options. - */ - $theme_options = get_option( 'astra-settings', array() ); - - // WordPress sidebar_widgets option. - $widget_options = get_option( 'sidebars_widgets', array() ); - - $used_elements = array(); - - $options = array( - 'theme_options' => $theme_options, - 'used_elements' => $used_elements, - 'widget_options' => $widget_options, - ); - - $options = astra_primary_header_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); - - $options = astra_below_header_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); - - $options = astra_above_header_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); - - $options = astra_footer_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); - - $options = astra_footer_widgets_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); - - $options = astra_primary_menu_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); - - $options = astra_sticky_header_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); - - $theme_options = $options['theme_options']; - $widget_options = $options['widget_options']; - - $theme_options['v3-option-migration'] = true; - - update_option( 'astra-settings', $theme_options ); - update_option( 'sidebars_widgets', $widget_options ); - -} - -/** - * Header Footer builder - Migration of Sticky Header. - * - * @since 3.0.0 - * @param array $theme_options Theme options. - * @param array $used_elements Used Elements array. - * @param array $widget_options Widget options. - * @return array - */ -function astra_sticky_header_builder_migration( $theme_options, $used_elements, $widget_options ) { - - // Menu. - $is_menu_in_primary = false; - $is_menu_in_above = false; - $is_menu_in_below = false; - - if ( isset( $theme_options['header-desktop-items']['primary'] ) ) { - foreach ( $theme_options['header-desktop-items']['primary'] as $zone ) { - if ( false !== array_search( 'menu-1', $zone ) ) { - $is_menu_in_primary = true; - } - } - } - - if ( isset( $theme_options['header-desktop-items']['above'] ) ) { - foreach ( $theme_options['header-desktop-items']['above'] as $zone ) { - if ( false !== array_search( 'menu-1', $zone ) ) { - $is_menu_in_above = true; - } - } - } - - if ( isset( $theme_options['header-desktop-items']['below'] ) ) { - foreach ( $theme_options['header-desktop-items']['below'] as $zone ) { - if ( false !== array_search( 'menu-1', $zone ) ) { - $is_menu_in_below = true; - } - } - } - - if ( $is_menu_in_primary ) { - - // Menu. - // Normal. - if ( isset( $theme_options['sticky-header-menu-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-color-responsive'] = $theme_options['sticky-header-menu-color-responsive']; - } - - if ( isset( $theme_options['sticky-header-menu-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-bg-obj-responsive'] = $theme_options['sticky-header-menu-bg-color-responsive']; - } - - - // Hover. - if ( isset( $theme_options['sticky-header-menu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-h-color-responsive'] = $theme_options['sticky-header-menu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-header-menu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-h-bg-color-responsive'] = $theme_options['sticky-header-menu-h-a-bg-color-responsive']; - } - - - // Active. - if ( isset( $theme_options['sticky-header-menu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-a-color-responsive'] = $theme_options['sticky-header-menu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-header-menu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-a-bg-color-responsive'] = $theme_options['sticky-header-menu-h-a-bg-color-responsive']; - } - - - // Submenu. - - // Normal. - if ( isset( $theme_options['sticky-header-submenu-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-submenu-color-responsive'] = $theme_options['sticky-header-submenu-color-responsive']; - } - - if ( isset( $theme_options['sticky-header-submenu-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-submenu-bg-color-responsive'] = $theme_options['sticky-header-submenu-bg-color-responsive']; - } - - - // Hover. - if ( isset( $theme_options['sticky-header-submenu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-submenu-h-color-responsive'] = $theme_options['sticky-header-submenu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-header-submenu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-submenu-h-bg-color-responsive'] = $theme_options['sticky-header-submenu-h-a-bg-color-responsive']; - } - - - // Active. - if ( isset( $theme_options['sticky-header-submenu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-submenu-a-color-responsive'] = $theme_options['sticky-header-submenu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-header-submenu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu1-submenu-a-bg-color-responsive'] = $theme_options['sticky-header-submenu-h-a-bg-color-responsive']; - } - - - // Mega menu. - - // Normal. - if ( isset( $theme_options['sticky-primary-header-megamenu-heading-color'] ) ) { - $theme_options['sticky-header-menu1-header-megamenu-heading-color'] = $theme_options['sticky-primary-header-megamenu-heading-color']; - } - - - // Hover. - if ( isset( $theme_options['sticky-primary-header-megamenu-heading-h-color'] ) ) { - $theme_options['sticky-header-menu1-header-megamenu-heading-h-color'] = $theme_options['sticky-primary-header-megamenu-heading-h-color']; - } - } - - if ( $is_menu_in_above ) { - - // Menu. - - // Normal. - if ( isset( $theme_options['sticky-above-header-menu-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-color-responsive'] = $theme_options['sticky-above-header-menu-color-responsive']; - } - - if ( isset( $theme_options['sticky-above-header-menu-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-bg-obj-responsive'] = $theme_options['sticky-above-header-menu-bg-color-responsive']; - } - - - // Hover. - if ( isset( $theme_options['sticky-above-header-menu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-h-color-responsive'] = $theme_options['sticky-above-header-menu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-above-header-menu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-h-bg-color-responsive'] = $theme_options['sticky-above-header-menu-h-a-bg-color-responsive']; - } - - - // Active. - if ( isset( $theme_options['sticky-above-header-menu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-a-color-responsive'] = $theme_options['sticky-above-header-menu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-above-header-menu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-a-bg-color-responsive'] = $theme_options['sticky-above-header-menu-h-a-bg-color-responsive']; - } - - - // Submenu. - - // Normal. - if ( isset( $theme_options['sticky-above-header-submenu-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-submenu-color-responsive'] = $theme_options['sticky-above-header-submenu-color-responsive']; - } - - if ( isset( $theme_options['sticky-above-header-submenu-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-submenu-bg-obj-responsive'] = $theme_options['sticky-above-header-submenu-bg-color-responsive']; - } - - - // Hover. - if ( isset( $theme_options['sticky-above-header-submenu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-submenu-h-color-responsive'] = $theme_options['sticky-above-header-submenu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-above-header-submenu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-submenu-h-bg-color-responsive'] = $theme_options['sticky-above-header-submenu-h-a-bg-color-responsive']; - } - - - // Active. - if ( isset( $theme_options['sticky-above-header-submenu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-submenu-a-color-responsive'] = $theme_options['sticky-above-header-submenu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-above-header-submenu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu3-submenu-a-bg-color-responsive'] = $theme_options['sticky-above-header-submenu-h-a-bg-color-responsive']; - } - - - // Mega menu. - - // Normal. - if ( isset( $theme_options['sticky-above-header-megamenu-heading-color'] ) ) { - $theme_options['sticky-header-menu3-header-megamenu-heading-color'] = $theme_options['sticky-above-header-megamenu-heading-color']; - } - - - // Hover. - if ( isset( $theme_options['sticky-above-header-megamenu-heading-h-color'] ) ) { - $theme_options['sticky-header-menu3-header-megamenu-heading-h-color'] = $theme_options['sticky-above-header-megamenu-heading-h-color']; - } - } - - if ( $is_menu_in_below ) { - - // Menu. - - // Normal. - if ( isset( $theme_options['sticky-below-header-menu-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-color-responsive'] = $theme_options['sticky-below-header-menu-color-responsive']; - } - - if ( isset( $theme_options['sticky-below-header-menu-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-bg-obj-responsive'] = $theme_options['sticky-below-header-menu-bg-color-responsive']; - } - - - // Hover. - if ( isset( $theme_options['sticky-below-header-menu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-h-color-responsive'] = $theme_options['sticky-below-header-menu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-below-header-menu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-h-bg-color-responsive'] = $theme_options['sticky-below-header-menu-h-a-bg-color-responsive']; - } - - - // Active. - if ( isset( $theme_options['sticky-below-header-menu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-a-color-responsive'] = $theme_options['sticky-below-header-menu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-below-header-menu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-a-bg-color-responsive'] = $theme_options['sticky-below-header-menu-h-a-bg-color-responsive']; - } - - - // Submenu. - - // Normal. - if ( isset( $theme_options['sticky-below-header-submenu-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-submenu-color-responsive'] = $theme_options['sticky-below-header-submenu-color-responsive']; - } - - if ( isset( $theme_options['sticky-below-header-submenu-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-submenu-bg-obj-responsive'] = $theme_options['sticky-below-header-submenu-bg-color-responsive']; - } - - - // Hover. - if ( isset( $theme_options['sticky-below-header-submenu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-submenu-h-color-responsive'] = $theme_options['sticky-below-header-submenu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-below-header-submenu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-submenu-h-bg-color-responsive'] = $theme_options['sticky-below-header-submenu-h-a-bg-color-responsive']; - } - - - // Active. - if ( isset( $theme_options['sticky-below-header-submenu-h-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-submenu-a-color-responsive'] = $theme_options['sticky-below-header-submenu-h-color-responsive']; - } - - if ( isset( $theme_options['sticky-below-header-submenu-h-a-bg-color-responsive'] ) ) { - $theme_options['sticky-header-menu2-submenu-a-bg-color-responsive'] = $theme_options['sticky-below-header-submenu-h-a-bg-color-responsive']; - } - - - // Mega menu. - - // Normal. - if ( isset( $theme_options['sticky-below-header-megamenu-heading-color'] ) ) { - $theme_options['sticky-header-menu2-header-megamenu-heading-color'] = $theme_options['sticky-below-header-megamenu-heading-color']; - } - - - // Hover. - if ( isset( $theme_options['sticky-below-header-megamenu-heading-h-color'] ) ) { - $theme_options['sticky-header-menu2-header-megamenu-heading-h-color'] = $theme_options['sticky-below-header-megamenu-heading-h-color']; - } - } - - // Sticky Site Title. - - // Normal. - if ( isset( $theme_options['sticky-header-color-site-title-responsive']['desktop'] ) ) { - $theme_options['sticky-header-builder-site-title-color'] = $theme_options['sticky-header-color-site-title-responsive']['desktop']; - } - - - // Hover. - if ( isset( $theme_options['sticky-header-color-h-site-title-responsive']['desktop'] ) ) { - $theme_options['sticky-header-builder-site-title-h-color'] = $theme_options['sticky-header-color-h-site-title-responsive']['desktop']; - } - - - // Sticky Site Tagline. - if ( isset( $theme_options['sticky-header-color-site-tagline-responsive']['desktop'] ) ) { - $theme_options['sticky-header-builder-site-tagline-color'] = $theme_options['sticky-header-color-site-tagline-responsive']['desktop']; - } - - - // Sticky Above/Below Header HTML. - $is_html_in_above = false; - $is_html_in_below = false; - - foreach ( $theme_options['header-desktop-items']['above'] as $zone ) { - if ( false !== array_search( 'html-3', $zone ) ) { - $is_html_in_above = true; - } - } - foreach ( $theme_options['header-desktop-items']['below'] as $zone ) { - if ( false !== array_search( 'html-2', $zone ) ) { - $is_html_in_below = true; - } - } - - if ( $is_html_in_above ) { - - if ( isset( $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-html-3color'] = $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop']; - } - } - if ( $is_html_in_below ) { - - if ( isset( $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-html-2color'] = $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop']; - } - } - - // Sticky Above/Below Header Search. - $is_search_in_above = false; - $is_search_in_below = false; - - foreach ( $theme_options['header-desktop-items']['above'] as $zone ) { - if ( false !== array_search( 'search', $zone ) ) { - $is_search_in_above = true; - } - } - foreach ( $theme_options['header-desktop-items']['below'] as $zone ) { - if ( false !== array_search( 'search', $zone ) ) { - $is_search_in_below = true; - } - } - - if ( $is_search_in_above ) { - - if ( isset( $theme_options['sticky-above-header-content-section-link-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-search-icon-color'] = $theme_options['sticky-above-header-content-section-link-color-responsive']['desktop']; - } - } - if ( $is_search_in_below ) { - - if ( isset( $theme_options['sticky-below-header-content-section-link-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-search-icon-color'] = $theme_options['sticky-below-header-content-section-link-color-responsive']['desktop']; - } - } - - // Sticky Above/Below Header Widget. - $is_widget_in_above = false; - $is_widget_in_below = false; - - foreach ( $theme_options['header-desktop-items']['above'] as $zone ) { - if ( false !== array_search( 'widget-3', $zone ) ) { - $is_widget_in_above = true; - } - } - foreach ( $theme_options['header-desktop-items']['below'] as $zone ) { - if ( false !== array_search( 'widget-2', $zone ) ) { - $is_widget_in_below = true; - } - } - - if ( $is_widget_in_above ) { - - if ( isset( $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-widget-3-title-color'] = $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop']; - } - - if ( isset( $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-widget-3-color'] = $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop']; - } - - if ( isset( $theme_options['sticky-above-header-content-section-link-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-widget-3-link-color'] = $theme_options['sticky-above-header-content-section-link-color-responsive']['desktop']; - } - - if ( isset( $theme_options['sticky-above-header-content-section-link-h-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-widget-3-link-h-color'] = $theme_options['sticky-above-header-content-section-link-h-color-responsive']['desktop']; - } - } - if ( $is_widget_in_below ) { - - if ( isset( $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-widget-2-title-color'] = $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop']; - } - - if ( isset( $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-widget-2-color'] = $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop']; - } - - if ( isset( $theme_options['sticky-below-header-content-section-link-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-widget-2-link-color'] = $theme_options['sticky-below-header-content-section-link-color-responsive']['desktop']; - } - - if ( isset( $theme_options['sticky-below-header-content-section-link-h-color-responsive']['desktop'] ) ) { - $theme_options['sticky-header-widget-2-link-h-color'] = $theme_options['sticky-below-header-content-section-link-h-color-responsive']['desktop']; - } - } - - return array( - 'theme_options' => $theme_options, - 'used_elements' => $used_elements, - 'widget_options' => $widget_options, - ); -} - -/** - * Header Footer builder - Migration of Primary Menu. - * - * @since 3.0.0 - * @param array $theme_options Theme options. - * @param array $used_elements Used Elements array. - * @param array $widget_options Widget options. - * @return array - */ -function astra_primary_menu_builder_migration( $theme_options, $used_elements, $widget_options ) { - - /** - * Primary Menu. - */ - if ( isset( $theme_options['header-main-submenu-container-animation'] ) ) { - $theme_options['header-menu1-submenu-container-animation'] = $theme_options['header-main-submenu-container-animation']; - } - if ( isset( $theme_options['primary-submenu-border'] ) ) { - $theme_options['header-menu1-submenu-border'] = $theme_options['primary-submenu-border']; - } - if ( isset( $theme_options['primary-submenu-b-color'] ) ) { - $theme_options['header-menu1-submenu-b-color'] = $theme_options['primary-submenu-b-color']; - } - if ( isset( $theme_options['primary-submenu-item-border'] ) ) { - $theme_options['header-menu1-submenu-item-border'] = $theme_options['primary-submenu-item-border']; - } - if ( isset( $theme_options['primary-submenu-item-b-color'] ) ) { - $theme_options['header-menu1-submenu-item-b-color'] = $theme_options['primary-submenu-item-b-color']; - } - - /** - * Primary Menu. - */ - - if ( isset( $theme_options['primary-menu-color-responsive'] ) ) { - $theme_options['header-menu1-color-responsive'] = $theme_options['primary-menu-color-responsive']; - } - - if ( isset( $theme_options['primary-menu-bg-obj-responsive'] ) ) { - $theme_options['header-menu1-bg-obj-responsive'] = $theme_options['primary-menu-bg-obj-responsive']; - } - - - if ( isset( $theme_options['primary-menu-text-h-color-responsive'] ) ) { - $theme_options['header-menu1-h-color-responsive'] = $theme_options['primary-menu-text-h-color-responsive']; - } - - if ( isset( $theme_options['primary-menu-h-bg-color-responsive'] ) ) { - $theme_options['header-menu1-h-bg-color-responsive'] = $theme_options['primary-menu-h-bg-color-responsive']; - } - - - if ( isset( $theme_options['primary-menu-a-color-responsive'] ) ) { - $theme_options['header-menu1-a-color-responsive'] = $theme_options['primary-menu-a-color-responsive']; - } - - if ( isset( $theme_options['primary-menu-a-bg-color-responsive'] ) ) { - $theme_options['header-menu1-a-bg-color-responsive'] = $theme_options['primary-menu-a-bg-color-responsive']; - } - - - if ( isset( $theme_options['font-size-primary-menu'] ) ) { - $theme_options['header-menu1-font-size'] = $theme_options['font-size-primary-menu']; - } - - if ( isset( $theme_options['font-weight-primary-menu'] ) ) { - $theme_options['header-menu1-font-weight'] = $theme_options['font-weight-primary-menu']; - } - - if ( isset( $theme_options['line-height-primary-menu'] ) ) { - $theme_options['header-menu1-line-height'] = $theme_options['line-height-primary-menu']; - } - - if ( isset( $theme_options['font-family-primary-menu'] ) ) { - $theme_options['header-menu1-font-family'] = $theme_options['font-family-primary-menu']; - } - - if ( isset( $theme_options['text-transform-primary-menu'] ) ) { - $theme_options['header-menu1-text-transform'] = $theme_options['text-transform-primary-menu']; - } - - if ( isset( $theme_options['primary-menu-spacing'] ) ) { - $theme_options['header-menu1-menu-spacing'] = $theme_options['primary-menu-spacing']; - } - - // Primary Menu - Submenu. - if ( isset( $theme_options['primary-submenu-color-responsive'] ) ) { - $theme_options['header-menu1-submenu-color-responsive'] = $theme_options['primary-submenu-color-responsive']; - } - - if ( isset( $theme_options['primary-submenu-bg-color-responsive'] ) ) { - $theme_options['header-menu1-submenu-bg-color-responsive'] = $theme_options['primary-submenu-bg-color-responsive']; - } - - if ( isset( $theme_options['primary-submenu-h-color-responsive'] ) ) { - $theme_options['header-menu1-submenu-h-color-responsive'] = $theme_options['primary-submenu-h-color-responsive']; - } - - if ( isset( $theme_options['primary-submenu-h-bg-color-responsive'] ) ) { - $theme_options['header-menu1-submenu-h-bg-color-responsive'] = $theme_options['primary-submenu-h-bg-color-responsive']; - } - - if ( isset( $theme_options['primary-submenu-a-color-responsive'] ) ) { - $theme_options['header-menu1-submenu-a-color-responsive'] = $theme_options['primary-submenu-a-color-responsive']; - } - - if ( isset( $theme_options['primary-submenu-a-bg-color-responsive'] ) ) { - $theme_options['header-menu1-submenu-a-bg-color-responsive'] = $theme_options['primary-submenu-a-bg-color-responsive']; - } - - if ( isset( $theme_options['font-size-primary-dropdown-menu'] ) ) { - $theme_options['header-font-size-menu1-sub-menu'] = $theme_options['font-size-primary-dropdown-menu']; - } - - if ( isset( $theme_options['font-weight-primary-dropdown-menu'] ) ) { - $theme_options['header-font-weight-menu1-sub-menu'] = $theme_options['font-weight-primary-dropdown-menu']; - } - - if ( isset( $theme_options['line-height-primary-dropdown-menu'] ) ) { - $theme_options['header-line-height-menu1-sub-menu'] = $theme_options['line-height-primary-dropdown-menu']; - } - - if ( isset( $theme_options['font-family-primary-dropdown-menu'] ) ) { - $theme_options['header-font-family-menu1-sub-menu'] = $theme_options['font-family-primary-dropdown-menu']; - } - - if ( isset( $theme_options['text-transform-primary-dropdown-menu'] ) ) { - $theme_options['header-text-transform-menu1-sub-menu'] = $theme_options['text-transform-primary-dropdown-menu']; - } - - if ( isset( $theme_options['primary-submenu-spacing'] ) ) { - $theme_options['header-menu1-submenu-spacing'] = $theme_options['primary-submenu-spacing']; - } - - // Primary Menu - Mega Menu. - if ( isset( $theme_options['primary-header-megamenu-heading-color'] ) ) { - $theme_options['header-menu1-header-megamenu-heading-color'] = $theme_options['primary-header-megamenu-heading-color']; - } - - if ( isset( $theme_options['primary-header-megamenu-heading-h-color'] ) ) { - $theme_options['header-menu1-header-megamenu-heading-h-color'] = $theme_options['primary-header-megamenu-heading-h-color']; - } - - if ( isset( $theme_options['primary-header-megamenu-heading-font-size'] ) ) { - $theme_options['header-menu1-megamenu-heading-font-size'] = $theme_options['primary-header-megamenu-heading-font-size']; - } - - if ( isset( $theme_options['primary-header-megamenu-heading-font-weight'] ) ) { - $theme_options['header-menu1-megamenu-heading-font-weight'] = $theme_options['primary-header-megamenu-heading-font-weight']; - } - - if ( isset( $theme_options['primary-header-megamenu-heading-line-height'] ) ) { - $theme_options['header-menu1-megamenu-heading-line-height'] = $theme_options['primary-header-megamenu-heading-line-height']; - } - - if ( isset( $theme_options['primary-header-megamenu-heading-font-family'] ) ) { - $theme_options['header-menu1-megamenu-heading-font-family'] = $theme_options['primary-header-megamenu-heading-font-family']; - } - - if ( isset( $theme_options['primary-header-megamenu-heading-text-transform'] ) ) { - $theme_options['header-menu1-megamenu-heading-text-transform'] = $theme_options['primary-header-megamenu-heading-text-transform']; - } - - if ( isset( $theme_options['primary-header-megamenu-heading-space'] ) ) { - $theme_options['header-menu1-megamenu-heading-space'] = $theme_options['primary-header-megamenu-heading-space']; - } - - - /** - * Primary Menu - Mobile. - */ - if ( isset( $theme_options['header-main-menu-label'] ) ) { - $theme_options['mobile-header-menu-label'] = $theme_options['header-main-menu-label']; - } - - if ( isset( $theme_options['mobile-header-toggle-btn-style-color'] ) ) { - $theme_options['mobile-header-toggle-btn-color'] = $theme_options['mobile-header-toggle-btn-style-color']; - $theme_options['mobile-header-toggle-border-color'] = $theme_options['mobile-header-toggle-btn-style-color']; - } - - if ( isset( $theme_options['mobile-header-toggle-btn-border-radius'] ) ) { - $theme_options['mobile-header-toggle-border-radius'] = $theme_options['mobile-header-toggle-btn-border-radius']; - } - - return array( - 'theme_options' => $theme_options, - 'used_elements' => $used_elements, - 'widget_options' => $widget_options, - ); -} - -/** - * Header Footer builder - Migration of Primary Header. - * - * @since 3.0.0 - * @param array $theme_options Theme options. - * @param array $used_elements Used Elements array. - * @param array $widget_options Widget options. - * @return array - */ -function astra_primary_header_builder_migration( $theme_options, $used_elements, $widget_options ) { - - /** - * Primary Header. - */ - - // Header : Primary Header - Layout. - $primary_header_layout = ( isset( $theme_options['header-layouts'] ) ) ? $theme_options['header-layouts'] : ''; - - // Header : Primary Header - Last Menu Item. - $last_menu_item = ( isset( $theme_options['header-main-rt-section'] ) ) ? $theme_options['header-main-rt-section'] : ''; - $last_menu_item_mobile_flag = ( isset( $theme_options['hide-custom-menu-mobile'] ) ) ? $theme_options['hide-custom-menu-mobile'] : ''; - $last_menu_item_mobile_outside = ( isset( $theme_options['header-display-outside-menu'] ) ) ? $theme_options['header-display-outside-menu'] : ''; - $new_menu_item = ''; - - $theme_options['mobile-header-type'] = 'dropdown'; - - if ( isset( $theme_options['mobile-menu-style'] ) ) { - switch ( $theme_options['mobile-menu-style'] ) { - case 'flyout': - $theme_options['mobile-header-type'] = 'off-canvas'; - if ( isset( $theme_options['flyout-mobile-menu-alignment'] ) ) { - $theme_options['off-canvas-slide'] = $theme_options['flyout-mobile-menu-alignment']; - } - break; - case 'fullscreen': - $theme_options['mobile-header-type'] = 'full-width'; - break; - - case 'default': - default: - $theme_options['mobile-header-type'] = 'dropdown'; - break; - } - } - - switch ( $last_menu_item ) { - case 'search': - $new_menu_item = 'search'; - if ( isset( $theme_options['header-main-rt-section-search-box-type'] ) ) { - $theme_options['header-search-box-type'] = $theme_options['header-main-rt-section-search-box-type']; - } - break; - - case 'button': - $new_menu_item = 'button-1'; - if ( isset( $theme_options['header-main-rt-section-button-text'] ) ) { - $theme_options['header-button1-text'] = $theme_options['header-main-rt-section-button-text']; - } - if ( isset( $theme_options['header-main-rt-section-button-link-option'] ) ) { - $theme_options['header-button1-link-option'] = $theme_options['header-main-rt-section-button-link-option']; - } - if ( isset( $theme_options['header-main-rt-section-button-text-color'] ) ) { - $theme_options['header-button1-text-color'] = array( - 'desktop' => $theme_options['header-main-rt-section-button-text-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['header-main-rt-section-button-back-color'] ) ) { - $theme_options['header-button1-back-color'] = array( - 'desktop' => $theme_options['header-main-rt-section-button-back-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['header-main-rt-section-button-text-h-color'] ) ) { - $theme_options['header-button1-text-h-color'] = array( - 'desktop' => $theme_options['header-main-rt-section-button-text-h-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['header-main-rt-section-button-back-h-color'] ) ) { - $theme_options['header-button1-back-h-color'] = array( - 'desktop' => $theme_options['header-main-rt-section-button-back-h-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['header-main-rt-section-button-border-size'] ) ) { - $theme_options['header-button1-border-size'] = $theme_options['header-main-rt-section-button-border-size']; - } - if ( isset( $theme_options['header-main-rt-section-button-border-color'] ) ) { - $theme_options['header-button1-border-color'] = array( - 'desktop' => $theme_options['header-main-rt-section-button-border-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['header-main-rt-section-button-border-h-color'] ) ) { - $theme_options['header-button1-border-h-color'] = array( - 'desktop' => $theme_options['header-main-rt-section-button-border-h-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['header-main-rt-section-button-border-radius'] ) ) { - $theme_options['header-button1-border-radius'] = $theme_options['header-main-rt-section-button-border-radius']; - } - if ( isset( $theme_options['primary-header-button-font-family'] ) ) { - $theme_options['header-button1-font-family'] = $theme_options['primary-header-button-font-family']; - } - if ( isset( $theme_options['primary-header-button-font-size'] ) ) { - $theme_options['header-button1-font-size'] = $theme_options['primary-header-button-font-size']; - } - if ( isset( $theme_options['primary-header-button-font-weight'] ) ) { - $theme_options['header-button1-font-weight'] = $theme_options['primary-header-button-font-weight']; - } - if ( isset( $theme_options['primary-header-button-text-transform'] ) ) { - $theme_options['header-button1-text-transform'] = $theme_options['primary-header-button-text-transform']; - } - if ( isset( $theme_options['primary-header-button-line-height'] ) ) { - $theme_options['header-button1-line-height'] = $theme_options['primary-header-button-line-height']; - } - if ( isset( $theme_options['primary-header-button-letter-spacing'] ) ) { - $theme_options['header-button1-letter-spacing'] = $theme_options['primary-header-button-letter-spacing']; - } - if ( isset( $theme_options['header-main-rt-section-button-padding'] ) ) { - $theme_options['section-hb-button-1-padding'] = $theme_options['header-main-rt-section-button-padding']; - } - // Sticky Header Button options. - - // Text Color. - if ( isset( $theme_options['header-main-rt-sticky-section-button-text-color'] ) ) { - - $theme_options['sticky-header-button1-text-color'] = array( - 'desktop' => $theme_options['header-main-rt-sticky-section-button-text-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - // BG Color. - if ( isset( $theme_options['header-main-rt-sticky-section-button-back-color'] ) ) { - $theme_options['sticky-header-button1-back-color'] = array( - 'desktop' => $theme_options['header-main-rt-sticky-section-button-back-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - // Text Hover Color. - if ( isset( $theme_options['header-main-rt-sticky-section-button-text-h-color'] ) ) { - $theme_options['sticky-header-button1-text-h-color'] = array( - 'desktop' => $theme_options['header-main-rt-sticky-section-button-text-h-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - // BG Hover Color. - if ( isset( $theme_options['header-main-rt-sticky-section-button-back-h-color'] ) ) { - $theme_options['sticky-header-button1-back-h-color'] = array( - 'desktop' => $theme_options['header-main-rt-sticky-section-button-back-h-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - // Border Width. - if ( isset( $theme_options['header-main-rt-sticky-section-button-border-size'] ) ) { - $theme_options['sticky-header-button1-border-size'] = $theme_options['header-main-rt-sticky-section-button-border-size']; - } - // Border Color. - if ( isset( $theme_options['header-main-rt-sticky-section-button-border-color'] ) ) { - $theme_options['sticky-header-button1-border-color'] = array( - 'desktop' => $theme_options['header-main-rt-sticky-section-button-border-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - // Border Hover Color. - if ( isset( $theme_options['header-main-rt-sticky-section-button-border-h-color'] ) ) { - $theme_options['sticky-header-button1-border-h-color'] = array( - 'desktop' => $theme_options['header-main-rt-sticky-section-button-border-h-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - // Border Radius. - if ( isset( $theme_options['header-main-rt-sticky-section-button-border-radius'] ) ) { - $theme_options['sticky-header-button1-border-radius'] = $theme_options['header-main-rt-sticky-section-button-border-radius']; - } - // Padding. - if ( isset( $theme_options['header-main-rt-sticky-section-button-padding'] ) ) { - $theme_options['sticky-header-button1-padding'] = $theme_options['header-main-rt-sticky-section-button-padding']; - } - - break; - - case 'text-html': - $new_menu_item = 'html-1'; - if ( isset( $theme_options['header-main-rt-section-html'] ) ) { - $theme_options['header-html-1'] = $theme_options['header-main-rt-section-html']; - } - break; - - case 'widget': - $new_menu_item = 'widget-1'; - if ( isset( $widget_options['header-widget'] ) ) { - $widget_options['header-widget-1'] = $widget_options['header-widget']; - } - break; - - case 'woocommerce': - $new_menu_item = 'woo-cart'; - if ( ! empty( $theme_options['woo-header-cart-icon-color'] ) ) { - $theme_options['header-woo-cart-icon-color'] = $theme_options['woo-header-cart-icon-color']; - } - break; - - case 'edd': - $new_menu_item = 'edd-cart'; - break; - } - - $used_elements[] = $new_menu_item; - - $new_menu_item_mobile = ( ! $last_menu_item_mobile_flag ) ? $new_menu_item : ''; - - $new_menu_item_mobile_outside = ''; - if ( ! $last_menu_item_mobile_flag && $last_menu_item_mobile_outside ) { - $new_menu_item_mobile_outside = $new_menu_item; - $new_menu_item_mobile = ''; - } - - $theme_options['header-desktop-items']['above'] = array( - 'above_left' => array(), - 'above_left_center' => array(), - 'above_center' => array(), - 'above_right_center' => array(), - 'above_right' => array(), - ); - $theme_options['header-mobile-items']['above'] = array( - 'above_left' => array(), - 'above_center' => array(), - 'above_right' => array(), - ); - - - $theme_options['header-desktop-items']['below'] = array( - 'below_left' => array(), - 'below_left_center' => array(), - 'below_center' => array(), - 'below_right_center' => array(), - 'below_right' => array(), - ); - - $theme_options['header-mobile-items']['below'] = array( - 'below_left' => array(), - 'below_center' => array(), - 'below_right' => array(), - ); - - /** - * Assign the new locations. - */ - switch ( $primary_header_layout ) { - case 'header-main-layout-1': - $theme_options['header-desktop-items']['primary'] = array( - 'primary_left' => array( 'logo' ), - 'primary_left_center' => array(), - 'primary_center' => array(), - 'primary_right_center' => array(), - 'primary_right' => ( '' !== $new_menu_item ) ? array( 'menu-1', $new_menu_item ) : array( 'menu-1' ), - ); - break; - - case 'header-main-layout-2': - $theme_options['header-desktop-items']['primary'] = array( - 'primary_left' => array(), - 'primary_left_center' => array(), - 'primary_center' => array( 'logo' ), - 'primary_right_center' => array(), - 'primary_right' => array(), - ); - $theme_options['header-desktop-items']['below'] = array( - 'below_left' => array(), - 'below_left_center' => array(), - 'below_center' => ( '' !== $new_menu_item ) ? array( 'menu-1', $new_menu_item ) : array( 'menu-1' ), - 'below_right_center' => array(), - 'below_right' => array(), - ); - break; - - case 'header-main-layout-3': - $theme_options['header-desktop-items']['primary'] = array( - 'primary_left' => ( '' !== $new_menu_item ) ? array( 'menu-1', $new_menu_item ) : array( 'menu-1' ), - 'primary_left_center' => array(), - 'primary_center' => array(), - 'primary_right_center' => array(), - 'primary_right' => array( 'logo' ), - ); - break; - - default: - $theme_options['header-desktop-items']['primary'] = array( - 'primary_left' => array( 'logo' ), - 'primary_left_center' => array(), - 'primary_center' => array(), - 'primary_right_center' => array(), - 'primary_right' => array( 'menu-1' ), - ); - } - - // Header : Primary Header - Mobile Layout. - $mobile_layout = astra_get_option( 'header-main-menu-align' ); - - if ( 'stack' === $mobile_layout ) { - $theme_options['header-mobile-items']['popup'] = array( 'popup_content' => ( '' !== $new_menu_item_mobile && '' !== $new_menu_item_mobile_outside ) ? array( 'menu-1', $new_menu_item_mobile ) : array( 'menu-1' ) ); - - $theme_options['header-mobile-items']['primary'] = array( - 'primary_left' => array(), - 'primary_center' => array( 'logo' ), - 'primary_right' => array(), - ); - - $theme_options['header-mobile-items']['below'] = array( - 'below_left' => array(), - 'below_center' => ( '' !== $new_menu_item_mobile_outside ) ? array( $new_menu_item_mobile_outside, 'mobile-trigger' ) : array( 'mobile-trigger' ), - 'below_right' => array(), - ); - } else { - - $theme_options['header-mobile-items']['popup'] = array( 'popup_content' => ( '' !== $new_menu_item_mobile ) ? array( 'menu-1', $new_menu_item_mobile ) : array( 'menu-1' ) ); - - if ( 'header-main-layout-3' === $primary_header_layout ) { - $theme_options['header-mobile-items']['primary'] = array( - 'primary_left' => ( '' !== $new_menu_item_mobile_outside ) ? array( $new_menu_item_mobile_outside, 'mobile-trigger' ) : array( 'mobile-trigger' ), - 'primary_center' => array(), - 'primary_right' => array( 'logo' ), - ); - } else { - $theme_options['header-mobile-items']['primary'] = array( - 'primary_left' => array( 'logo' ), - 'primary_center' => array(), - 'primary_right' => ( '' !== $new_menu_item_mobile_outside ) ? array( $new_menu_item_mobile_outside, 'mobile-trigger' ) : array( 'mobile-trigger' ), - ); - } - } - - // Header - Primary Header - Content Width. - if ( isset( $theme_options['header-main-layout-width'] ) ) { - $theme_options['hb-header-main-layout-width'] = $theme_options['header-main-layout-width']; - } - - // Header - Primary Header - Border Bottom. - if ( isset( $theme_options['header-main-sep'] ) ) { - $theme_options['hb-header-main-sep'] = $theme_options['header-main-sep']; - } - - if ( isset( $theme_options['header-main-sep-color'] ) ) { - $theme_options['hb-header-main-sep-color'] = $theme_options['header-main-sep-color']; - } - - if ( isset( $theme_options['header-bg-obj-responsive'] ) ) { - $theme_options['hb-header-bg-obj-responsive'] = $theme_options['header-bg-obj-responsive']; - } - - if ( isset( $theme_options['header-spacing'] ) ) { - $theme_options['section-primary-header-builder-padding'] = $theme_options['header-spacing']; - } - - return array( - 'theme_options' => $theme_options, - 'used_elements' => $used_elements, - 'widget_options' => $widget_options, - ); -} - -/** - * Header Footer builder - Migration of Above Header. - * - * @since 3.0.0 - * @param array $theme_options Theme options. - * @param array $used_elements Used Elements array. - * @param array $widget_options Widget options. - * @return array - */ -function astra_above_header_builder_migration( $theme_options, $used_elements, $widget_options ) { - /** - * Above Header. - */ - - $above_header_layout = ( isset( $theme_options['above-header-layout'] ) ) ? $theme_options['above-header-layout'] : ''; - $above_header_on_mobile = ( isset( $theme_options['above-header-on-mobile'] ) ) ? $theme_options['above-header-on-mobile'] : ''; - $above_header_merge_menu = ( isset( $theme_options['above-header-merge-menu'] ) ) ? $theme_options['above-header-merge-menu'] : ''; - $above_header_swap_mobile = ( isset( $theme_options['above-header-swap-mobile'] ) ) ? $theme_options['above-header-swap-mobile'] : ''; - - if ( isset( $theme_options['above-header-height'] ) ) { - $theme_options['hba-header-height'] = array( - 'desktop' => $theme_options['above-header-height'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['above-header-divider'] ) ) { - $theme_options['hba-header-separator'] = $theme_options['above-header-divider']; - } - if ( isset( $theme_options['above-header-divider-color'] ) ) { - $theme_options['hba-header-bottom-border-color'] = $theme_options['above-header-divider-color']; - } - if ( isset( $theme_options['above-header-bg-obj-responsive'] ) ) { - $theme_options['hba-header-bg-obj-responsive'] = $theme_options['above-header-bg-obj-responsive']; - } - if ( isset( $theme_options['above-header-spacing'] ) ) { - $theme_options['section-above-header-builder-padding'] = $theme_options['above-header-spacing']; - } - // Above Header Section 1. - $above_header_section_1 = ( isset( $theme_options['above-header-section-1'] ) ) ? $theme_options['above-header-section-1'] : ''; - $new_above_header_section_1_item = ''; - - switch ( $above_header_section_1 ) { - case 'menu': - $new_above_header_section_1_item = 'menu-3'; - break; - - case 'search': - if ( ! in_array( 'search', $used_elements ) ) { - $new_above_header_section_1_item = 'search'; - if ( isset( $theme_options['above-header-section-1-search-box-type'] ) ) { - $theme_options['header-search-box-type'] = $theme_options['above-header-section-1-search-box-type']; - } - } - break; - - case 'text-html': - if ( ! in_array( 'html-3', $used_elements ) ) { - $new_above_header_section_1_item = 'html-3'; - if ( isset( $theme_options['above-header-section-1-html'] ) ) { - $theme_options['header-html-3'] = $theme_options['above-header-section-1-html']; - } - } - - break; - - case 'widget': - if ( ! in_array( 'widget-3', $used_elements ) ) { - $new_above_header_section_1_item = 'widget-3'; - if ( isset( $widget_options['above-header-widget-1'] ) ) { - $widget_options['header-widget-3'] = $widget_options['above-header-widget-1']; - } - } - break; - - case 'woocommerce': - if ( ! in_array( 'woo-cart', $used_elements ) ) { - $new_above_header_section_1_item = 'woo-cart'; - } - break; - - case 'edd': - if ( ! in_array( 'edd-cart', $used_elements ) ) { - $new_above_header_section_1_item = 'edd-cart'; - } - break; - } - - // Above Header Section 2. - $above_header_section_2 = ( isset( $theme_options['above-header-section-2'] ) ) ? $theme_options['above-header-section-2'] : ''; - $new_above_header_section_2_item = ''; - switch ( $above_header_section_2 ) { - case 'menu': - $new_above_header_section_2_item = 'menu-3'; - break; - - case 'search': - if ( ! in_array( 'search', $used_elements ) ) { - $new_above_header_section_2_item = 'search'; - if ( isset( $theme_options['above-header-section-2-search-box-type'] ) ) { - $theme_options['header-search-box-type'] = $theme_options['above-header-section-2-search-box-type']; - } - } - break; - - case 'text-html': - if ( ! in_array( 'html-3', $used_elements ) ) { - $new_above_header_section_2_item = 'html-3'; - if ( isset( $theme_options['above-header-section-2-html'] ) ) { - $theme_options['header-html-3'] = $theme_options['above-header-section-2-html']; - } - } - - break; - - case 'widget': - if ( ! in_array( 'widget-3', $used_elements ) ) { - $new_above_header_section_2_item = 'widget-3'; - if ( isset( $widget_options['above-header-widget-2'] ) ) { - $widget_options['header-widget-3'] = $widget_options['above-header-widget-2']; - } - } - break; - - case 'woocommerce': - if ( ! in_array( 'woo-cart', $used_elements ) ) { - $new_above_header_section_2_item = 'woo-cart'; - } - break; - - case 'edd': - if ( ! in_array( 'edd-cart', $used_elements ) ) { - $new_above_header_section_2_item = 'edd-cart'; - } - break; - } - - if ( 'menu' === $above_header_section_1 || 'menu' === $above_header_section_2 ) { - $theme_options['header-menu3-menu-stack-on-mobile'] = false; - /** - * Menu - 3 - */ - if ( isset( $theme_options['above-header-submenu-container-animation'] ) ) { - $theme_options['header-menu3-submenu-container-animation'] = $theme_options['above-header-submenu-container-animation']; - } - if ( isset( $theme_options['above-header-submenu-border'] ) ) { - $theme_options['header-menu3-submenu-border'] = $theme_options['above-header-submenu-border']; - } - if ( isset( $theme_options['above-header-submenu-b-color'] ) ) { - $theme_options['header-menu3-submenu-b-color'] = $theme_options['above-header-submenu-b-color']; - } - if ( isset( $theme_options['above-header-submenu-item-border'] ) ) { - $theme_options['header-menu3-submenu-item-border'] = $theme_options['above-header-submenu-item-border']; - } - if ( isset( $theme_options['above-header-submenu-item-b-color'] ) ) { - $theme_options['header-menu3-submenu-item-b-color'] = $theme_options['above-header-submenu-item-b-color']; - } - - if ( isset( $theme_options['above-header-menu-text-color-responsive'] ) ) { - $theme_options['header-menu3-color-responsive'] = $theme_options['above-header-menu-text-color-responsive']; - } - if ( isset( $theme_options['above-header-menu-bg-obj-responsive'] ) ) { - $theme_options['header-menu3-bg-obj-responsive'] = $theme_options['above-header-menu-bg-obj-responsive']; - } - - if ( isset( $theme_options['above-header-menu-text-hover-color-responsive'] ) ) { - $theme_options['header-menu3-h-color-responsive'] = $theme_options['above-header-menu-text-hover-color-responsive']; - } - if ( isset( $theme_options['above-header-menu-bg-hover-color-responsive'] ) ) { - $theme_options['header-menu3-h-bg-color-responsive'] = $theme_options['above-header-menu-bg-hover-color-responsive']; - } - - if ( isset( $theme_options['above-header-current-menu-text-color-responsive'] ) ) { - $theme_options['header-menu3-a-color-responsive'] = $theme_options['above-header-current-menu-text-color-responsive']; - } - if ( isset( $theme_options['above-header-current-menu-bg-color-responsive'] ) ) { - $theme_options['header-menu3-a-bg-color-responsive'] = $theme_options['above-header-current-menu-bg-color-responsive']; - } - - if ( isset( $theme_options['above-header-font-size'] ) ) { - $theme_options['header-menu3-font-size'] = $theme_options['above-header-font-size']; - } - if ( isset( $theme_options['above-header-font-weight'] ) ) { - $theme_options['header-menu3-font-weight'] = $theme_options['above-header-font-weight']; - } - if ( isset( $theme_options['above-header-line-height'] ) ) { - $theme_options['header-menu3-line-height'] = $theme_options['above-header-line-height']; - } - if ( isset( $theme_options['above-header-font-family'] ) ) { - $theme_options['header-menu3-font-family'] = $theme_options['above-header-font-family']; - } - if ( isset( $theme_options['above-header-text-transform'] ) ) { - $theme_options['header-menu3-text-transform'] = $theme_options['above-header-text-transform']; - } - - if ( isset( $theme_options['above-header-menu-spacing'] ) ) { - $theme_options['header-menu3-menu-spacing'] = $theme_options['above-header-menu-spacing']; - } - - // Menu 3 - Submenu. - if ( isset( $theme_options['above-header-submenu-text-color-responsive'] ) ) { - $theme_options['header-menu3-submenu-color-responsive'] = $theme_options['above-header-submenu-text-color-responsive']; - } - if ( isset( $theme_options['above-header-submenu-bg-color-responsive'] ) ) { - $theme_options['header-menu3-submenu-bg-color-responsive'] = $theme_options['above-header-submenu-bg-color-responsive']; - } - - if ( isset( $theme_options['above-header-submenu-hover-color-responsive'] ) ) { - $theme_options['header-menu3-submenu-h-color-responsive'] = $theme_options['above-header-submenu-hover-color-responsive']; - } - if ( isset( $theme_options['above-header-submenu-bg-hover-color-responsive'] ) ) { - $theme_options['header-menu3-submenu-h-bg-color-responsive'] = $theme_options['above-header-submenu-bg-hover-color-responsive']; - } - - if ( isset( $theme_options['above-header-submenu-active-color-responsive'] ) ) { - $theme_options['header-menu3-submenu-a-color-responsive'] = $theme_options['above-header-submenu-active-color-responsive']; - } - if ( isset( $theme_options['above-header-submenu-active-bg-color-responsive'] ) ) { - $theme_options['header-menu3-submenu-a-bg-color-responsive'] = $theme_options['above-header-submenu-active-bg-color-responsive']; - } - - if ( isset( $theme_options['font-size-above-header-dropdown-menu'] ) ) { - $theme_options['header-font-size-menu3-sub-menu'] = $theme_options['font-size-above-header-dropdown-menu']; - } - if ( isset( $theme_options['font-weight-above-header-dropdown-menu'] ) ) { - $theme_options['header-font-weight-menu3-sub-menu'] = $theme_options['font-weight-above-header-dropdown-menu']; - } - if ( isset( $theme_options['line-height-above-header-dropdown-menu'] ) ) { - $theme_options['header-line-height-menu3-sub-menu'] = $theme_options['line-height-above-header-dropdown-menu']; - } - if ( isset( $theme_options['font-family-above-header-dropdown-menu'] ) ) { - $theme_options['header-font-family-menu3-sub-menu'] = $theme_options['font-family-above-header-dropdown-menu']; - } - if ( isset( $theme_options['text-transform-above-header-dropdown-menu'] ) ) { - $theme_options['header-text-transform-menu3-sub-menu'] = $theme_options['text-transform-above-header-dropdown-menu']; - } - - if ( isset( $theme_options['above-header-submenu-spacing'] ) ) { - $theme_options['header-menu3-submenu-spacing'] = $theme_options['above-header-submenu-spacing']; - } - } - - if ( 'search' === $above_header_section_1 || 'search' === $above_header_section_2 ) { - if ( isset( $theme_options['above-header-text-color-responsive'] ) ) { - $theme_options['header-search-icon-color'] = $theme_options['above-header-text-color-responsive']; - } - } - - if ( 'text-html' === $above_header_section_1 || 'text-html' === $above_header_section_2 ) { - if ( isset( $theme_options['above-header-text-color-responsive'] ) ) { - $theme_options['header-html-3color'] = $theme_options['above-header-text-color-responsive']; - } - if ( isset( $theme_options['above-header-link-color-responsive'] ) ) { - $theme_options['header-html-3link-color'] = $theme_options['above-header-link-color-responsive']; - } - if ( isset( $theme_options['above-header-link-hover-color-responsive'] ) ) { - $theme_options['header-html-3link-h-color'] = $theme_options['above-header-link-hover-color-responsive']; - } - if ( isset( $theme_options['font-size-above-header-content'] ) ) { - $theme_options['font-size-section-hb-html-3'] = $theme_options['font-size-above-header-content']; - } - if ( isset( $theme_options['font-weight-above-header-content'] ) ) { - $theme_options['font-weight-section-hb-html-3'] = $theme_options['font-weight-above-header-content']; - } - if ( isset( $theme_options['line-height-above-header-content'] ) ) { - $theme_options['line-height-section-hb-html-3'] = $theme_options['line-height-above-header-content']; - } - if ( isset( $theme_options['font-family-above-header-content'] ) ) { - $theme_options['font-family-section-hb-html-3'] = $theme_options['font-family-above-header-content']; - } - if ( isset( $theme_options['text-transform-above-header-content'] ) ) { - $theme_options['text-transform-section-hb-html-3'] = $theme_options['text-transform-above-header-content']; - } - } - - if ( 'widget' === $above_header_section_1 || 'widget' === $above_header_section_2 ) { - if ( isset( $theme_options['above-header-text-color-responsive'] ) ) { - $theme_options['header-widget-3-color'] = $theme_options['above-header-text-color-responsive']; - $theme_options['header-widget-3-title-color'] = $theme_options['above-header-text-color-responsive']; - } - if ( isset( $theme_options['above-header-link-color-responsive'] ) ) { - $theme_options['header-widget-3-link-color'] = $theme_options['above-header-link-color-responsive']; - } - if ( isset( $theme_options['above-header-link-hover-color-responsive'] ) ) { - $theme_options['header-widget-3-link-h-color'] = $theme_options['above-header-link-hover-color-responsive']; - } - if ( isset( $theme_options['font-size-above-header-content'] ) ) { - $theme_options['header-widget-3-content-font-size'] = $theme_options['font-size-above-header-content']; - } - if ( isset( $theme_options['font-weight-above-header-content'] ) ) { - $theme_options['header-widget-3-content-font-weight'] = $theme_options['font-weight-above-header-content']; - } - if ( isset( $theme_options['line-height-above-header-content'] ) ) { - $theme_options['header-widget-3-content-line-height'] = $theme_options['line-height-above-header-content']; - } - if ( isset( $theme_options['font-family-above-header-content'] ) ) { - $theme_options['header-widget-3-content-font-family'] = $theme_options['font-family-above-header-content']; - } - if ( isset( $theme_options['text-transform-above-header-content'] ) ) { - $theme_options['header-widget-3-content-text-transform'] = $theme_options['text-transform-above-header-content']; - } - } - - switch ( $above_header_layout ) { - - case 'above-header-layout-1': - $theme_options['header-desktop-items']['above'] = array( - 'above_left' => ( '' !== $new_above_header_section_1_item ) ? array( $new_above_header_section_1_item ) : array(), - 'above_left_center' => array(), - 'above_center' => array(), - 'above_right_center' => array(), - 'above_right' => ( '' !== $new_above_header_section_2_item ) ? array( $new_above_header_section_2_item ) : array(), - ); - break; - - case 'above-header-layout-2': - $theme_options['header-desktop-items']['above'] = array( - 'above_left' => array(), - 'above_left_center' => array(), - 'above_center' => ( '' !== $new_above_header_section_1_item ) ? array( $new_above_header_section_1_item ) : array(), - 'above_right_center' => array(), - 'above_right' => array(), - ); - break; - } - - if ( $above_header_on_mobile ) { - - if ( $above_header_swap_mobile && ( 'menu' === $above_header_section_1 || 'menu' === $above_header_section_2 ) ) { - $temp = $new_above_header_section_1_item; - $new_above_header_section_1_item = $new_above_header_section_2_item; - $new_above_header_section_2_item = $temp; - } - - if ( $above_header_merge_menu && ( 'menu' === $above_header_section_1 || 'menu' === $above_header_section_2 ) ) { - if ( '' !== $new_above_header_section_1_item ) { - $theme_options['header-mobile-items']['popup']['popup_content'][] = $new_above_header_section_1_item; - } - if ( '' !== $new_above_header_section_2_item ) { - $theme_options['header-mobile-items']['popup']['popup_content'][] = $new_above_header_section_2_item; - } - $theme_options['header-menu3-menu-stack-on-mobile'] = true; - $theme_options['header-mobile-items']['above'] = array( - 'above_left' => array(), - 'above_center' => array(), - 'above_right' => array(), - ); - } else { - switch ( $above_header_layout ) { - - case 'above-header-layout-1': - $theme_options['header-mobile-items']['above'] = array( - 'above_left' => ( '' !== $new_above_header_section_1_item ) ? array( $new_above_header_section_1_item ) : array(), - 'above_center' => array(), - 'above_right' => ( '' !== $new_above_header_section_2_item ) ? array( $new_above_header_section_2_item ) : array(), - ); - break; - - case 'above-header-layout-2': - $theme_options['header-mobile-items']['above'] = array( - 'above_left' => array(), - 'above_center' => ( '' !== $new_above_header_section_1_item ) ? array( $new_above_header_section_1_item ) : array(), - 'above_right' => array(), - ); - break; - } - } - } - - return array( - 'theme_options' => $theme_options, - 'used_elements' => $used_elements, - 'widget_options' => $widget_options, - ); - -} - -/** - * Header Footer builder - Migration of Below Header. - * - * @since 3.0.0 - * @param array $theme_options Theme options. - * @param array $used_elements Used Elements array. - * @param array $widget_options Widget options. - * @return array - */ -function astra_below_header_builder_migration( $theme_options, $used_elements, $widget_options ) { - /** - * Below Header - */ - - $below_header_layout = ( isset( $theme_options['below-header-layout'] ) ) ? $theme_options['below-header-layout'] : ''; - $below_header_on_mobile = ( isset( $theme_options['below-header-on-mobile'] ) ) ? $theme_options['below-header-on-mobile'] : ''; - $below_header_merge_menu = ( isset( $theme_options['below-header-merge-menu'] ) ) ? $theme_options['below-header-merge-menu'] : ''; - $below_header_swap_mobile = ( isset( $theme_options['below-header-swap-mobile'] ) ) ? $theme_options['below-header-swap-mobile'] : ''; - - if ( isset( $theme_options['below-header-height'] ) ) { - $theme_options['hbb-header-height'] = array( - 'desktop' => $theme_options['below-header-height'], - 'tablet' => '', - 'mobile' => '', - ); - } - - if ( isset( $theme_options['below-header-divider'] ) ) { - $theme_options['hbb-header-separator'] = $theme_options['below-header-divider']; - } - if ( isset( $theme_options['below-header-divider-color'] ) ) { - $theme_options['hbb-header-bottom-border-color'] = $theme_options['below-header-divider-color']; - } - if ( isset( $theme_options['below-header-bg-obj-responsive'] ) ) { - $theme_options['hbb-header-bg-obj-responsive'] = $theme_options['below-header-bg-obj-responsive']; - } - if ( isset( $theme_options['below-header-spacing'] ) ) { - $theme_options['section-below-header-builder-padding'] = $theme_options['below-header-spacing']; - } - // Below Header Section 1. - $below_header_section_1 = ( isset( $theme_options['below-header-section-1'] ) ) ? $theme_options['below-header-section-1'] : ''; - $new_below_header_section_1_item = ''; - switch ( $below_header_section_1 ) { - case 'menu': - $new_below_header_section_1_item = 'menu-2'; - break; - - case 'search': - if ( ! in_array( 'search', $used_elements ) ) { - $new_below_header_section_1_item = 'search'; - if ( isset( $theme_options['below-header-section-1-search-box-type'] ) ) { - $theme_options['header-search-box-type'] = $theme_options['below-header-section-1-search-box-type']; - } - } - break; - - case 'text-html': - if ( ! in_array( 'html-2', $used_elements ) ) { - $new_below_header_section_1_item = 'html-2'; - if ( isset( $theme_options['below-header-section-1-html'] ) ) { - $theme_options['header-html-2'] = $theme_options['below-header-section-1-html']; - } - } - - break; - - case 'widget': - if ( ! in_array( 'widget-2', $used_elements ) ) { - $new_below_header_section_1_item = 'widget-2'; - if ( isset( $widget_options['below-header-widget-1'] ) ) { - $widget_options['header-widget-2'] = $widget_options['below-header-widget-1']; - } - } - break; - - case 'woocommerce': - if ( ! in_array( 'woo-cart', $used_elements ) ) { - $new_below_header_section_1_item = 'woo-cart'; - } - break; - - case 'edd': - if ( ! in_array( 'edd-cart', $used_elements ) ) { - $new_below_header_section_1_item = 'edd-cart'; - } - break; - } - - // Below Header Section 2. - $below_header_section_2 = ( isset( $theme_options['below-header-section-2'] ) ) ? $theme_options['below-header-section-2'] : ''; - $new_below_header_section_2_item = ''; - switch ( $below_header_section_2 ) { - case 'menu': - $new_below_header_section_2_item = 'menu-2'; - break; - - case 'search': - if ( ! in_array( 'search', $used_elements ) ) { - $new_below_header_section_2_item = 'search'; - if ( isset( $theme_options['below-header-section-2-search-box-type'] ) ) { - $theme_options['header-search-box-type'] = $theme_options['below-header-section-2-search-box-type']; - } - } - break; - - case 'text-html': - if ( ! in_array( 'html-2', $used_elements ) ) { - $new_below_header_section_2_item = 'html-2'; - if ( isset( $theme_options['below-header-section-2-html'] ) ) { - $theme_options['header-html-2'] = $theme_options['below-header-section-2-html']; - } - } - break; - - case 'widget': - if ( ! in_array( 'widget-2', $used_elements ) ) { - $new_below_header_section_2_item = 'widget-2'; - if ( isset( $widget_options['below-header-widget-2'] ) ) { - $widget_options['header-widget-2'] = $widget_options['below-header-widget-2']; - } - } - break; - - case 'woocommerce': - if ( ! in_array( 'woo-cart', $used_elements ) ) { - $new_below_header_section_2_item = 'woo-cart'; - } - break; - - case 'edd': - if ( ! in_array( 'edd-cart', $used_elements ) ) { - $new_below_header_section_2_item = 'edd-cart'; - } - break; - } - - if ( 'menu' === $below_header_section_1 || 'menu' === $below_header_section_2 ) { - $theme_options['header-menu2-menu-stack-on-mobile'] = false; - /** - * Menu - 2 - */ - if ( isset( $theme_options['below-header-submenu-container-animation'] ) ) { - $theme_options['header-menu2-submenu-container-animation'] = $theme_options['below-header-submenu-container-animation']; - } - if ( isset( $theme_options['below-header-submenu-border'] ) ) { - $theme_options['header-menu2-submenu-border'] = $theme_options['below-header-submenu-border']; - } - if ( isset( $theme_options['below-header-submenu-b-color'] ) ) { - $theme_options['header-menu2-submenu-b-color'] = $theme_options['below-header-submenu-b-color']; - } - if ( isset( $theme_options['below-header-submenu-item-border'] ) ) { - $theme_options['header-menu2-submenu-item-border'] = $theme_options['below-header-submenu-item-border']; - } - if ( isset( $theme_options['below-header-submenu-item-b-color'] ) ) { - $theme_options['header-menu2-submenu-item-b-color'] = $theme_options['below-header-submenu-item-b-color']; - } - - if ( isset( $theme_options['below-header-menu-text-color-responsive'] ) ) { - $theme_options['header-menu2-color-responsive'] = $theme_options['below-header-menu-text-color-responsive']; - } - if ( isset( $theme_options['below-header-menu-bg-obj-responsive'] ) ) { - $theme_options['header-menu2-bg-obj-responsive'] = $theme_options['below-header-menu-bg-obj-responsive']; - } - - if ( isset( $theme_options['below-header-menu-text-hover-color-responsive'] ) ) { - $theme_options['header-menu2-h-color-responsive'] = $theme_options['below-header-menu-text-hover-color-responsive']; - } - if ( isset( $theme_options['below-header-menu-bg-hover-color-responsive'] ) ) { - $theme_options['header-menu2-h-bg-color-responsive'] = $theme_options['below-header-menu-bg-hover-color-responsive']; - } - - if ( isset( $theme_options['below-header-current-menu-text-color-responsive'] ) ) { - $theme_options['header-menu2-a-color-responsive'] = $theme_options['below-header-current-menu-text-color-responsive']; - } - if ( isset( $theme_options['below-header-current-menu-bg-color-responsive'] ) ) { - $theme_options['header-menu2-a-bg-color-responsive'] = $theme_options['below-header-current-menu-bg-color-responsive']; - } - - if ( isset( $theme_options['below-header-font-size'] ) ) { - $theme_options['header-menu2-font-size'] = $theme_options['below-header-font-size']; - } - if ( isset( $theme_options['below-header-font-weight'] ) ) { - $theme_options['header-menu2-font-weight'] = $theme_options['below-header-font-weight']; - } - if ( isset( $theme_options['below-header-line-height'] ) ) { - $theme_options['header-menu2-line-height'] = $theme_options['below-header-line-height']; - } - if ( isset( $theme_options['below-header-font-family'] ) ) { - $theme_options['header-menu2-font-family'] = $theme_options['below-header-font-family']; - } - if ( isset( $theme_options['below-header-text-transform'] ) ) { - $theme_options['header-menu2-text-transform'] = $theme_options['below-header-text-transform']; - } - - if ( isset( $theme_options['below-header-menu-spacing'] ) ) { - $theme_options['header-menu2-menu-spacing'] = $theme_options['below-header-menu-spacing']; - } - - // Menu 2 - Submenu. - if ( isset( $theme_options['below-header-submenu-text-color-responsive'] ) ) { - $theme_options['header-menu2-submenu-color-responsive'] = $theme_options['below-header-submenu-text-color-responsive']; - } - if ( isset( $theme_options['below-header-submenu-bg-color-responsive'] ) ) { - $theme_options['header-menu2-submenu-bg-color-responsive'] = $theme_options['below-header-submenu-bg-color-responsive']; - } - - if ( isset( $theme_options['below-header-submenu-hover-color-responsive'] ) ) { - $theme_options['header-menu2-submenu-h-color-responsive'] = $theme_options['below-header-submenu-hover-color-responsive']; - } - if ( isset( $theme_options['below-header-submenu-bg-hover-color-responsive'] ) ) { - $theme_options['header-menu2-submenu-h-bg-color-responsive'] = $theme_options['below-header-submenu-bg-hover-color-responsive']; - } - - if ( isset( $theme_options['below-header-submenu-active-color-responsive'] ) ) { - $theme_options['header-menu2-submenu-a-color-responsive'] = $theme_options['below-header-submenu-active-color-responsive']; - } - if ( isset( $theme_options['below-header-submenu-active-bg-color-responsive'] ) ) { - $theme_options['header-menu2-submenu-a-bg-color-responsive'] = $theme_options['below-header-submenu-active-bg-color-responsive']; - } - - if ( isset( $theme_options['font-size-below-header-dropdown-menu'] ) ) { - $theme_options['header-font-size-menu2-sub-menu'] = $theme_options['font-size-below-header-dropdown-menu']; - } - if ( isset( $theme_options['font-weight-below-header-dropdown-menu'] ) ) { - $theme_options['header-font-weight-menu2-sub-menu'] = $theme_options['font-weight-below-header-dropdown-menu']; - } - if ( isset( $theme_options['line-height-below-header-dropdown-menu'] ) ) { - $theme_options['header-line-height-menu2-sub-menu'] = $theme_options['line-height-below-header-dropdown-menu']; - } - if ( isset( $theme_options['font-family-below-header-dropdown-menu'] ) ) { - $theme_options['header-font-family-menu2-sub-menu'] = $theme_options['font-family-below-header-dropdown-menu']; - } - if ( isset( $theme_options['text-transform-below-header-dropdown-menu'] ) ) { - $theme_options['header-text-transform-menu2-sub-menu'] = $theme_options['text-transform-below-header-dropdown-menu']; - } - - if ( isset( $theme_options['below-header-submenu-spacing'] ) ) { - $theme_options['header-menu2-submenu-spacing'] = $theme_options['below-header-submenu-spacing']; - } - } - - if ( 'search' === $below_header_section_1 || 'search' === $below_header_section_2 ) { - if ( isset( $theme_options['below-header-text-color-responsive'] ) ) { - $theme_options['header-search-icon-color'] = $theme_options['below-header-text-color-responsive']; - } - } - - if ( 'text-html' === $below_header_section_1 || 'text-html' === $below_header_section_2 ) { - if ( isset( $theme_options['below-header-text-color-responsive'] ) ) { - $theme_options['header-html-2color'] = $theme_options['below-header-text-color-responsive']; - } - if ( isset( $theme_options['below-header-link-color-responsive'] ) ) { - $theme_options['header-html-2link-color'] = $theme_options['below-header-link-color-responsive']; - } - if ( isset( $theme_options['below-header-link-hover-color-responsive'] ) ) { - $theme_options['header-html-2link-h-color'] = $theme_options['below-header-link-hover-color-responsive']; - } - if ( isset( $theme_options['font-size-below-header-content'] ) ) { - $theme_options['font-size-section-hb-html-2'] = $theme_options['font-size-below-header-content']; - } - if ( isset( $theme_options['font-weight-below-header-content'] ) ) { - $theme_options['font-weight-section-hb-html-2'] = $theme_options['font-weight-below-header-content']; - } - if ( isset( $theme_options['line-height-below-header-content'] ) ) { - $theme_options['line-height-section-hb-html-2'] = $theme_options['line-height-below-header-content']; - } - if ( isset( $theme_options['font-family-below-header-content'] ) ) { - $theme_options['font-family-section-hb-html-2'] = $theme_options['font-family-below-header-content']; - } - if ( isset( $theme_options['text-transform-below-header-content'] ) ) { - $theme_options['text-transform-section-hb-html-2'] = $theme_options['text-transform-below-header-content']; - } - } - - if ( 'widget' === $below_header_section_1 || 'widget' === $below_header_section_2 ) { - if ( isset( $theme_options['below-header-text-color-responsive'] ) ) { - $theme_options['header-widget-2-color'] = $theme_options['below-header-text-color-responsive']; - $theme_options['header-widget-2-title-color'] = $theme_options['below-header-text-color-responsive']; - } - if ( isset( $theme_options['below-header-link-color-responsive'] ) ) { - $theme_options['header-widget-2-link-color'] = $theme_options['below-header-link-color-responsive']; - } - if ( isset( $theme_options['below-header-link-hover-color-responsive'] ) ) { - $theme_options['header-widget-2-link-h-color'] = $theme_options['below-header-link-hover-color-responsive']; - } - if ( isset( $theme_options['font-size-below-header-content'] ) ) { - $theme_options['header-widget-2-content-font-size'] = $theme_options['font-size-below-header-content']; - } - if ( isset( $theme_options['font-weight-below-header-content'] ) ) { - $theme_options['header-widget-2-content-font-weight'] = $theme_options['font-weight-below-header-content']; - } - if ( isset( $theme_options['line-height-below-header-content'] ) ) { - $theme_options['header-widget-2-content-line-height'] = $theme_options['line-height-below-header-content']; - } - if ( isset( $theme_options['font-family-below-header-content'] ) ) { - $theme_options['header-widget-2-content-font-family'] = $theme_options['font-family-below-header-content']; - } - if ( isset( $theme_options['text-transform-below-header-content'] ) ) { - $theme_options['header-widget-2-content-text-transform'] = $theme_options['text-transform-below-header-content']; - } - } - - switch ( $below_header_layout ) { - - case 'below-header-layout-1': - $theme_options['header-desktop-items']['below'] = array( - 'below_left' => ( '' !== $new_below_header_section_1_item ) ? array( $new_below_header_section_1_item ) : array(), - 'below_left_center' => array(), - 'below_center' => array(), - 'below_right_center' => array(), - 'below_right' => ( '' !== $new_below_header_section_2_item ) ? array( $new_below_header_section_2_item ) : array(), - ); - break; - - case 'below-header-layout-2': - $theme_options['header-desktop-items']['below'] = array( - 'below_left' => array(), - 'below_left_center' => array(), - 'below_center' => ( '' !== $new_below_header_section_1_item ) ? array( $new_below_header_section_1_item ) : array(), - 'below_right_center' => array(), - 'below_right' => array(), - ); - break; - } - - if ( $below_header_on_mobile ) { - - if ( $below_header_swap_mobile && ( 'menu' === $below_header_section_1 || 'menu' === $below_header_section_2 ) ) { - $temp = $new_below_header_section_1_item; - $new_below_header_section_1_item = $new_below_header_section_2_item; - $new_below_header_section_2_item = $temp; - } - - if ( $below_header_merge_menu && ( 'menu' === $below_header_section_1 || 'menu' === $below_header_section_2 ) ) { - if ( '' !== $new_below_header_section_1_item ) { - $theme_options['header-mobile-items']['popup']['popup_content'][] = $new_below_header_section_1_item; - } - if ( '' !== $new_below_header_section_2_item ) { - $theme_options['header-mobile-items']['popup']['popup_content'][] = $new_below_header_section_2_item; - } - $theme_options['header-menu2-menu-stack-on-mobile'] = true; - $theme_options['header-mobile-items']['below'] = array( - 'below_left' => array(), - 'below_center' => array(), - 'below_right' => array(), - ); - } else { - switch ( $below_header_layout ) { - - case 'below-header-layout-1': - $theme_options['header-mobile-items']['below'] = array( - 'below_left' => ( '' !== $new_below_header_section_1_item ) ? array( $new_below_header_section_1_item ) : array(), - 'below_center' => array(), - 'below_right' => ( '' !== $new_below_header_section_2_item ) ? array( $new_below_header_section_2_item ) : array(), - ); - break; - - case 'below-header-layout-2': - $theme_options['header-mobile-items']['below'] = array( - 'below_left' => array(), - 'below_center' => ( '' !== $new_below_header_section_1_item ) ? array( $new_below_header_section_1_item ) : array(), - 'below_right' => array(), - ); - break; - } - } - } - - return array( - 'theme_options' => $theme_options, - 'used_elements' => $used_elements, - 'widget_options' => $widget_options, - ); -} - -/** - * Header Footer builder - Migration of Footer. - * - * @since 3.0.0 - * @param array $theme_options Theme options. - * @param array $used_elements Used Elements array. - * @param array $widget_options Widget options. - * @return array - */ -function astra_footer_builder_migration( $theme_options, $used_elements, $widget_options ) { - /** - * Footer - */ - $footer_layout = ( isset( $theme_options['footer-sml-layout'] ) ) ? $theme_options['footer-sml-layout'] : ''; - - if ( isset( $theme_options['footer-layout-width'] ) ) { - $theme_options['hb-footer-layout-width'] = $theme_options['footer-layout-width']; - } - if ( isset( $theme_options['footer-sml-divider'] ) ) { - $theme_options['hbb-footer-separator'] = $theme_options['footer-sml-divider']; - } - if ( isset( $theme_options['footer-sml-divider-color'] ) ) { - $theme_options['hbb-footer-top-border-color'] = $theme_options['footer-sml-divider-color']; - } - if ( isset( $theme_options['footer-bg-obj'] ) ) { - $theme_options['hbb-footer-bg-obj-responsive'] = array( - 'desktop' => $theme_options['footer-bg-obj'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['footer-sml-spacing'] ) ) { - $theme_options['section-below-footer-builder-padding'] = $theme_options['footer-sml-spacing']; - } - - // Footer Section 1. - $footer_section_1 = ( isset( $theme_options['footer-sml-section-1'] ) ) ? $theme_options['footer-sml-section-1'] : ''; - $new_section_1_item = ''; - $used_elements[] = $new_section_1_item; - - $footer_section_2 = ( isset( $theme_options['footer-sml-section-2'] ) ) ? $theme_options['footer-sml-section-2'] : ''; - $new_section_2_item = ''; - $used_elements[] = $new_section_2_item; - - switch ( $footer_section_1 ) { - case 'custom': - $new_section_1_item = 'copyright'; - $theme_options['footer-copyright-alignment'] = array( - 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'left', - 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'left', - 'mobile' => 'center', - ); - break; - - case 'widget': - $new_section_1_item = 'widget-1'; - $theme_options['footer-widget-alignment-1'] = array( - 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'left', - 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'left', - 'mobile' => 'center', - ); - if ( isset( $theme_options['footer-color'] ) ) { - $theme_options['footer-widget-1-color'] = array( - 'desktop' => $theme_options['footer-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['footer-link-color'] ) ) { - $theme_options['footer-widget-1-link-color'] = array( - 'desktop' => $theme_options['footer-link-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['footer-link-h-color'] ) ) { - $theme_options['footer-widget-1-link-h-color'] = array( - 'desktop' => $theme_options['footer-link-h-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - - if ( isset( $theme_options['font-size-footer-content'] ) ) { - $theme_options['footer-widget-1-content-font-size'] = $theme_options['font-size-footer-content']; - } - - if ( isset( $theme_options['font-weight-footer-content'] ) ) { - $theme_options['footer-widget-1-content-font-weight'] = $theme_options['font-weight-footer-content']; - } - - if ( isset( $theme_options['line-height-footer-content'] ) ) { - $theme_options['footer-widget-1-content-line-height'] = $theme_options['line-height-footer-content']; - } - - if ( isset( $theme_options['font-family-footer-content'] ) ) { - $theme_options['footer-widget-1-content-font-family'] = $theme_options['font-family-footer-content']; - } - - if ( isset( $theme_options['text-transform-footer-content'] ) ) { - $theme_options['footer-widget-1-content-text-transform'] = $theme_options['text-transform-footer-content']; - } - - - break; - - case 'menu': - $theme_options['footer-menu-alignment'] = array( - 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'flex-start', - 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'flex-start', - 'mobile' => 'center', - ); - $new_section_1_item = 'menu'; - break; - } - - // Footer Section 2. - switch ( $footer_section_2 ) { - case 'custom': - $new_section_2_item = ( 'copyright' !== $new_section_1_item ) ? 'copyright' : 'html-1'; - if ( 'copyright' !== $new_section_1_item ) { - $theme_options['footer-copyright-alignment'] = array( - 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', - 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', - 'mobile' => 'center', - ); - if ( isset( $theme_options['footer-sml-section-2-credit'] ) ) { - $theme_options['footer-copyright-editor'] = $theme_options['footer-sml-section-2-credit']; - } - } else { - $theme_options['footer-html-1-alignment'] = array( - 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', - 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', - 'mobile' => 'center', - ); - if ( isset( $theme_options['footer-sml-section-2-credit'] ) ) { - $theme_options['footer-html-1'] = $theme_options['footer-sml-section-2-credit']; - } - } - - break; - - case 'widget': - $new_section_2_item = 'widget-2'; - $theme_options['footer-widget-alignment-2'] = array( - 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', - 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', - 'mobile' => 'center', - ); - if ( isset( $theme_options['footer-color'] ) ) { - $theme_options['footer-widget-2-color'] = array( - 'desktop' => $theme_options['footer-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['footer-link-color'] ) ) { - $theme_options['footer-widget-2-link-color'] = array( - 'desktop' => $theme_options['footer-link-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['footer-link-h-color'] ) ) { - $theme_options['footer-widget-2-link-h-color'] = array( - 'desktop' => $theme_options['footer-link-h-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - - if ( isset( $theme_options['font-size-footer-content'] ) ) { - $theme_options['footer-widget-2-content-font-size'] = $theme_options['font-size-footer-content']; - } - - if ( isset( $theme_options['font-weight-footer-content'] ) ) { - $theme_options['footer-widget-2-content-font-weight'] = $theme_options['font-weight-footer-content']; - } - - if ( isset( $theme_options['line-height-footer-content'] ) ) { - $theme_options['footer-widget-2-content-line-height'] = $theme_options['line-height-footer-content']; - } - - if ( isset( $theme_options['font-family-footer-content'] ) ) { - $theme_options['footer-widget-2-content-font-family'] = $theme_options['font-family-footer-content']; - } - - if ( isset( $theme_options['text-transform-footer-content'] ) ) { - $theme_options['footer-widget-2-content-text-transform'] = $theme_options['text-transform-footer-content']; - } - - - break; - - case 'menu': - $new_section_2_item = 'menu'; - $theme_options['footer-menu-alignment'] = array( - 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'flex-end', - 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'flex-end', - 'mobile' => 'center', - ); - break; - } - - if ( 'custom' === $footer_section_1 || 'custom' === $footer_section_2 ) { - - // Footer Content Color migrated to Copyright. - if ( isset( $theme_options['footer-sml-section-1-credit'] ) ) { - $theme_options['footer-copyright-editor'] = $theme_options['footer-sml-section-1-credit']; - } - if ( isset( $theme_options['footer-color'] ) ) { - $theme_options['footer-copyright-color'] = $theme_options['footer-color']; - } - if ( isset( $theme_options['footer-link-color'] ) ) { - $theme_options['footer-copyright-link-color'] = $theme_options['footer-link-color']; - } - if ( isset( $theme_options['footer-link-h-color'] ) ) { - $theme_options['footer-copyright-link-h-color'] = $theme_options['footer-link-h-color']; - } - - if ( isset( $theme_options['font-size-footer-content'] ) ) { - $theme_options['font-size-section-footer-copyright'] = $theme_options['font-size-footer-content']; - } - - if ( isset( $theme_options['font-weight-footer-content'] ) ) { - $theme_options['font-weight-section-footer-copyright'] = $theme_options['font-weight-footer-content']; - } - - if ( isset( $theme_options['line-height-footer-content'] ) ) { - $theme_options['line-height-section-footer-copyright'] = $theme_options['line-height-footer-content']; - } - - if ( isset( $theme_options['font-family-footer-content'] ) ) { - $theme_options['font-family-section-footer-copyright'] = $theme_options['font-family-footer-content']; - } - - if ( isset( $theme_options['text-transform-footer-content'] ) ) { - $theme_options['text-transform-section-footer-copyright'] = $theme_options['text-transform-footer-content']; - } - - if ( 'html-1' === $new_section_2_item ) { - // Footer Content Color migrated to HTML 1. - if ( isset( $theme_options['footer-color'] ) ) { - $theme_options['footer-html-1-color'] = array( - 'desktop' => $theme_options['footer-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['footer-link-color'] ) ) { - $theme_options['footer-html-1-link-color'] = array( - 'desktop' => $theme_options['footer-link-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['footer-link-h-color'] ) ) { - $theme_options['footer-html-1-link-h-color'] = array( - 'desktop' => $theme_options['footer-link-h-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - - if ( isset( $theme_options['font-size-footer-content'] ) ) { - $theme_options['font-size-section-fb-html-1'] = $theme_options['font-size-footer-content']; - } - - if ( isset( $theme_options['font-weight-footer-content'] ) ) { - $theme_options['font-weight-section-fb-html-1'] = $theme_options['font-weight-footer-content']; - } - - if ( isset( $theme_options['line-height-footer-content'] ) ) { - $theme_options['line-height-section-fb-html-1'] = $theme_options['line-height-footer-content']; - } - - if ( isset( $theme_options['font-family-footer-content'] ) ) { - $theme_options['font-family-section-fb-html-1'] = $theme_options['font-family-footer-content']; - } - - if ( isset( $theme_options['text-transform-footer-content'] ) ) { - $theme_options['text-transform-section-fb-html-1'] = $theme_options['text-transform-footer-content']; - } - } - } - - if ( 'menu' === $footer_section_1 || 'menu' === $footer_section_2 ) { - if ( isset( $theme_options['footer-link-color'] ) ) { - $theme_options['footer-menu-color-responsive'] = array( - 'desktop' => $theme_options['footer-link-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - if ( isset( $theme_options['footer-link-h-color'] ) ) { - $theme_options['footer-menu-h-color-responsive'] = array( - 'desktop' => $theme_options['footer-link-h-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - - $theme_options['footer-menu-layout'] = array( - 'desktop' => 'horizontal', - 'tablet' => 'horizontal', - 'mobile' => 'horizontal', - ); - - if ( isset( $theme_options['font-size-footer-content'] ) ) { - $theme_options['footer-menu-font-size'] = $theme_options['font-size-footer-content']; - } - - if ( isset( $theme_options['font-weight-footer-content'] ) ) { - $theme_options['footer-menu-font-weight'] = $theme_options['font-weight-footer-content']; - } - - if ( isset( $theme_options['line-height-footer-content'] ) ) { - $theme_options['footer-menu-line-height'] = $theme_options['line-height-footer-content']; - } - - if ( isset( $theme_options['font-family-footer-content'] ) ) { - $theme_options['footer-menu-font-family'] = $theme_options['font-family-footer-content']; - } - - if ( isset( $theme_options['text-transform-footer-content'] ) ) { - $theme_options['footer-menu-text-transform'] = $theme_options['text-transform-footer-content']; - } - - if ( isset( $theme_options['footer-menu-spacing'] ) ) { - $theme_options['footer-main-menu-spacing'] = $theme_options['footer-menu-spacing']; - } - } - - if ( '' !== $footer_layout ) { - - $theme_options['footer-desktop-items'] = array( - 'above' => - array( - 'above_1' => array(), - 'above_2' => array(), - 'above_3' => array(), - 'above_4' => array(), - 'above_5' => array(), - ), - 'primary' => - array( - 'primary_1' => array(), - 'primary_2' => array(), - 'primary_3' => array(), - 'primary_4' => array(), - 'primary_5' => array(), - ), - 'below' => - array( - 'below_1' => array(), - 'below_2' => array(), - 'below_3' => array(), - 'below_4' => array(), - 'below_5' => array(), - ), - ); - - switch ( $footer_layout ) { - case 'footer-sml-layout-1': - $theme_options['footer-desktop-items']['below'] = array( - 'below_1' => array( $new_section_1_item, $new_section_2_item ), - 'below_2' => array(), - 'below_3' => array(), - 'below_4' => array(), - 'below_5' => array(), - ); - $theme_options['hbb-footer-column'] = 1; - $theme_options['hbb-footer-layout'] = array( - 'desktop' => 'full', - 'tablet' => 'full', - 'mobile' => 'full', - ); - break; - - case 'footer-sml-layout-2': - $theme_options['footer-desktop-items']['below'] = array( - 'below_1' => array( $new_section_1_item ), - 'below_2' => array( $new_section_2_item ), - 'below_3' => array(), - 'below_4' => array(), - 'below_5' => array(), - ); - $theme_options['hbb-footer-column'] = 2; - $theme_options['hbb-footer-layout'] = array( - 'desktop' => '2-equal', - 'tablet' => '2-equal', - 'mobile' => 'full', - ); - break; - - default: - $theme_options['footer-desktop-items']['below'] = array( - 'below_1' => array( 'copyright' ), - 'below_2' => array(), - 'below_3' => array(), - 'below_4' => array(), - 'below_5' => array(), - ); - } - } - - return array( - 'theme_options' => $theme_options, - 'used_elements' => $used_elements, - 'widget_options' => $widget_options, - ); -} - -/** - * Header Footer builder - Migration of Footer Widgets. - * - * @since 3.0.0 - * @param array $theme_options Theme options. - * @param array $used_elements Used Elements array. - * @param array $widget_options Widget options. - * @return array - */ -function astra_footer_widgets_migration( $theme_options, $used_elements, $widget_options ) { - - $footer_widget_layouts = ( isset( $theme_options['footer-adv'] ) ) ? $theme_options['footer-adv'] : ''; - - if ( '' !== $footer_widget_layouts ) { - - $column = 2; - $layout = array( - 'desktop' => '2-equal', - 'tablet' => '2-equal', - 'mobile' => 'full', - ); - $items = array( - 'above_1' => array(), - 'above_2' => array(), - 'above_3' => array(), - 'above_4' => array(), - 'above_5' => array(), - ); - - switch ( $footer_widget_layouts ) { - case 'layout-1': - $column = '1'; - $layout = array( - 'desktop' => 'full', - 'tablet' => 'full', - 'mobile' => 'full', - ); - $items = array( - 'above_1' => array( 'widget-1' ), - 'above_2' => array(), - 'above_3' => array(), - 'above_4' => array(), - 'above_5' => array(), - ); - break; - - case 'layout-2': - $column = '2'; - $layout = array( - 'desktop' => '2-equal', - 'tablet' => '2-equal', - 'mobile' => '2-equal', - ); - $items = array( - 'above_1' => array( 'widget-1' ), - 'above_2' => array( 'widget-2' ), - 'above_3' => array(), - 'above_4' => array(), - 'above_5' => array(), - ); - break; - - case 'layout-3': - $column = '3'; - $layout = array( - 'desktop' => '3-equal', - 'tablet' => 'full', - 'mobile' => 'full', - ); - $items = array( - 'above_1' => array( 'widget-1' ), - 'above_2' => array( 'widget-2' ), - 'above_3' => array( 'widget-3' ), - 'above_4' => array(), - 'above_5' => array(), - ); - break; - - case 'layout-4': - $column = '4'; - $layout = array( - 'desktop' => '4-equal', - 'tablet' => 'full', - 'mobile' => 'full', - ); - $items = array( - 'above_1' => array( 'widget-1' ), - 'above_2' => array( 'widget-2' ), - 'above_3' => array( 'widget-3' ), - 'above_4' => array( 'widget-4' ), - 'above_5' => array(), - ); - break; - - case 'layout-5': - $column = '5'; - $layout = array( - 'desktop' => '5-equal', - 'tablet' => 'full', - 'mobile' => 'full', - ); - $items = array( - 'above_1' => array( 'widget-1' ), - 'above_2' => array( 'widget-2' ), - 'above_3' => array( 'widget-3' ), - 'above_4' => array( 'widget-4' ), - 'above_5' => array( 'widget-5' ), - ); - break; - - case 'layout-6': - case 'layout-7': - $column = '3'; - $layout = array( - 'desktop' => '3-lheavy', - 'tablet' => 'full', - 'mobile' => 'full', - ); - $items = array( - 'above_1' => array( 'widget-1' ), - 'above_2' => array( 'widget-2' ), - 'above_3' => array( 'widget-3' ), - 'above_4' => array(), - 'above_5' => array(), - ); - break; - } - - $theme_options['hba-footer-column'] = $column; - $theme_options['hba-footer-layout'] = $layout; - if ( isset( $theme_options['footer-desktop-items'] ) ) { - $theme_options['footer-desktop-items']['above'] = $items; - } - - for ( $i = 1; $i <= $column; $i++ ) { - - if ( isset( $theme_options['footer-adv-wgt-title-color'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-title-color' ] = array( - 'desktop' => $theme_options['footer-adv-wgt-title-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - - if ( isset( $theme_options['footer-adv-text-color'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-color' ] = array( - 'desktop' => $theme_options['footer-adv-text-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - - if ( isset( $theme_options['footer-adv-link-color'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-link-color' ] = array( - 'desktop' => $theme_options['footer-adv-link-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - - if ( isset( $theme_options['footer-adv-link-h-color'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-link-h-color' ] = array( - 'desktop' => $theme_options['footer-adv-link-h-color'], - 'tablet' => '', - 'mobile' => '', - ); - } - - - if ( isset( $theme_options['footer-adv-wgt-title-font-size'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-font-size' ] = $theme_options['footer-adv-wgt-title-font-size']; - } - - if ( isset( $theme_options['footer-adv-wgt-title-font-weight'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-font-weight' ] = $theme_options['footer-adv-wgt-title-font-weight']; - } - - if ( isset( $theme_options['footer-adv-wgt-title-line-height'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-line-height' ] = $theme_options['footer-adv-wgt-title-line-height']; - } - - if ( isset( $theme_options['footer-adv-wgt-title-font-family'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-font-family' ] = $theme_options['footer-adv-wgt-title-font-family']; - } - - if ( isset( $theme_options['footer-adv-wgt-title-text-transform'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-text-transform' ] = $theme_options['footer-adv-wgt-title-text-transform']; - } - - - if ( isset( $theme_options['footer-adv-wgt-content-font-size'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-content-font-size' ] = $theme_options['footer-adv-wgt-content-font-size']; - } - - if ( isset( $theme_options['footer-adv-wgt-content-font-weight'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-content-font-weight' ] = $theme_options['footer-adv-wgt-content-font-weight']; - } - - if ( isset( $theme_options['footer-adv-wgt-content-line-height'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-content-line-height' ] = $theme_options['footer-adv-wgt-content-line-height']; - } - - if ( isset( $theme_options['footer-adv-wgt-content-font-family'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-content-font-family' ] = $theme_options['footer-adv-wgt-content-font-family']; - } - - if ( isset( $theme_options['footer-adv-wgt-content-text-transform'] ) ) { - $theme_options[ 'footer-widget-' . $i . '-content-text-transform' ] = $theme_options['footer-adv-wgt-content-text-transform']; - } - - if ( isset( $widget_options[ 'advanced-footer-widget-' . $i ] ) ) { - $widget_options[ 'footer-widget-' . $i ] = $widget_options[ 'advanced-footer-widget-' . $i ]; - } - } - } - - if ( isset( $theme_options['footer-adv-border-width'] ) ) { - $theme_options['hba-footer-separator'] = $theme_options['footer-adv-border-width']; - } - - if ( isset( $theme_options['footer-adv-border-color'] ) ) { - $theme_options['hba-footer-top-border-color'] = $theme_options['footer-adv-border-color']; - } - - if ( isset( $theme_options['footer-adv-bg-obj'] ) ) { - $theme_options['hba-footer-bg-obj-responsive'] = array( - 'desktop' => $theme_options['footer-adv-bg-obj'], - 'tablet' => '', - 'mobile' => '', - ); - } - - if ( isset( $theme_options['footer-adv-area-padding'] ) ) { - $theme_options['section-above-footer-builder-padding'] = $theme_options['footer-adv-area-padding']; - } - - return array( - 'theme_options' => $theme_options, - 'used_elements' => $used_elements, - 'widget_options' => $widget_options, - ); -} - -/** - * Do not apply new Media & Text block padding CSS & not remove padding for #primary on mobile devices directly for existing users. - * - * @since 2.6.1 - * - * @return void - */ -function astra_gutenberg_media_text_block_css_compatibility() { - $theme_options = get_option( 'astra-settings', array() ); - - if ( ! isset( $theme_options['guntenberg-media-text-block-padding-css'] ) ) { - $theme_options['guntenberg-media-text-block-padding-css'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Gutenberg pattern compatibility changes. - * - * @since 3.3.0 - * - * @return void - */ -function astra_gutenberg_pattern_compatibility() { - $theme_options = get_option( 'astra-settings', array() ); - - if ( ! isset( $theme_options['guntenberg-button-pattern-compat-css'] ) ) { - $theme_options['guntenberg-button-pattern-compat-css'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Set flag to provide backward compatibility of float based CSS for existing users. - * - * @since 3.3.0 - * @return void. - */ -function astra_check_flex_based_css() { - $theme_options = get_option( 'astra-settings', array() ); - - if ( ! isset( $theme_options['is-flex-based-css'] ) ) { - $theme_options['is-flex-based-css'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Update the Cart Style, Icon color & Border radius if None style is selected. - * - * @since 3.4.0 - * @return void. - */ -function astra_update_cart_style() { - $theme_options = get_option( 'astra-settings', array() ); - if ( isset( $theme_options['woo-header-cart-icon-style'] ) && 'none' === $theme_options['woo-header-cart-icon-style'] ) { - $theme_options['woo-header-cart-icon-style'] = 'outline'; - $theme_options['header-woo-cart-icon-color'] = ''; - $theme_options['woo-header-cart-icon-color'] = ''; - $theme_options['woo-header-cart-icon-radius'] = ''; - } - - if ( isset( $theme_options['edd-header-cart-icon-style'] ) && 'none' === $theme_options['edd-header-cart-icon-style'] ) { - $theme_options['edd-header-cart-icon-style'] = 'outline'; - $theme_options['edd-header-cart-icon-color'] = ''; - $theme_options['edd-header-cart-icon-radius'] = ''; - } - - update_option( 'astra-settings', $theme_options ); -} - -/** - * Update existing 'Grid Column Layout' option in responsive way in Related Posts. - * Till this update 3.5.0 we have 'Grid Column Layout' only for singular option, but now we are improving it as responsive. - * - * @since 3.5.0 - * @return void. - */ -function astra_update_related_posts_grid_layout() { - - $theme_options = get_option( 'astra-settings', array() ); - - if ( ! isset( $theme_options['related-posts-grid-responsive'] ) && isset( $theme_options['related-posts-grid'] ) ) { - - /** - * Managed here switch case to reduce further conditions in dynamic-css to get CSS value based on grid-template-columns. Because there are following CSS props used. - * - * '1' = grid-template-columns: 1fr; - * '2' = grid-template-columns: repeat(2,1fr); - * '3' = grid-template-columns: repeat(3,1fr); - * '4' = grid-template-columns: repeat(4,1fr); - * - * And we already have Astra_Builder_Helper::$grid_size_mapping (used for footer layouts) for getting CSS values based on grid layouts. So migrating old value of grid here to new grid value. - */ - switch ( $theme_options['related-posts-grid'] ) { - case '1': - $grid_layout = 'full'; - break; - - case '2': - $grid_layout = '2-equal'; - break; - - case '3': - $grid_layout = '3-equal'; - break; - - case '4': - $grid_layout = '4-equal'; - break; - } - - $theme_options['related-posts-grid-responsive'] = array( - 'desktop' => $grid_layout, - 'tablet' => $grid_layout, - 'mobile' => 'full', - ); - - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Migrate Site Title & Site Tagline options to new responsive array. - * - * @since 3.5.0 - * - * @return void - */ -function astra_site_title_tagline_responsive_control_migration() { - - $theme_options = get_option( 'astra-settings', array() ); - - if ( false === get_option( 'display-site-title-responsive', false ) && isset( $theme_options['display-site-title'] ) ) { - $theme_options['display-site-title-responsive']['desktop'] = $theme_options['display-site-title']; - $theme_options['display-site-title-responsive']['tablet'] = $theme_options['display-site-title']; - $theme_options['display-site-title-responsive']['mobile'] = $theme_options['display-site-title']; - } - - if ( false === get_option( 'display-site-tagline-responsive', false ) && isset( $theme_options['display-site-tagline'] ) ) { - $theme_options['display-site-tagline-responsive']['desktop'] = $theme_options['display-site-tagline']; - $theme_options['display-site-tagline-responsive']['tablet'] = $theme_options['display-site-tagline']; - $theme_options['display-site-tagline-responsive']['mobile'] = $theme_options['display-site-tagline']; - } - - update_option( 'astra-settings', $theme_options ); -} - -/** - * Do not apply new font-weight heading support CSS in editor/frontend directly. - * - * 1. Adding Font-weight support to widget titles. - * 2. Customizer font CSS not supporting in editor. - * - * @since 3.6.0 - * - * @return void - */ -function astra_headings_font_support() { - $theme_options = get_option( 'astra-settings', array() ); - - if ( ! isset( $theme_options['can-support-widget-and-editor-fonts'] ) ) { - $theme_options['can-support-widget-and-editor-fonts'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Set flag to avoid direct reflections on live site & to maintain backward compatibility for existing users. - * - * @since 3.6.0 - * @return void. - */ -function astra_remove_logo_max_width() { - $theme_options = get_option( 'astra-settings', array() ); - - if ( ! isset( $theme_options['can-remove-logo-max-width-css'] ) ) { - $theme_options['can-remove-logo-max-width-css'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Set flag to maintain backward compatibility for existing users for Transparent Header border bottom default value i.e from '' to 0. - * - * @since 3.6.0 - * @return void. - */ -function astra_transparent_header_default_value() { - $theme_options = get_option( 'astra-settings', array() ); - - if ( ! isset( $theme_options['transparent-header-default-border'] ) ) { - $theme_options['transparent-header-default-border'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Clear Astra + Astra Pro assets cache. - * - * @since 3.6.1 - * @return void. - */ -function astra_clear_all_assets_cache() { - if ( class_exists( 'Astra_Cache_Base' ) ) { - // Clear Astra theme cache. - $astra_cache_base_instance = new Astra_Cache_Base( 'astra' ); - $astra_cache_base_instance->refresh_assets( 'astra' ); - - // Clear Astra Addon's cache. - $astra_addon_cache_base_instance = new Astra_Cache_Base( 'astra-addon' ); - $astra_addon_cache_base_instance->refresh_assets( 'astra-addon' ); - } -} - -/** - * Set flag for updated default values for buttons & add GB Buttons padding support. - * - * @since 3.6.3 - * @return void. - */ -function astra_button_default_values_updated() { - $theme_options = get_option( 'astra-settings', array() ); - - if ( ! isset( $theme_options['btn-default-padding-updated'] ) ) { - $theme_options['btn-default-padding-updated'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Set flag for old users, to not directly apply underline to content links. - * - * @since 3.6.4 - * @return void. - */ -function astra_update_underline_link_setting() { - $theme_options = get_option( 'astra-settings', array() ); - - if ( ! isset( $theme_options['underline-content-links'] ) ) { - $theme_options['underline-content-links'] = false; - update_option( 'astra-settings', $theme_options ); - } -} - -/** - * Add compatibility support for WP-5.8. as some of settings & blocks already their in WP-5.7 versions, that's why added backward here. - * - * @since 3.6.5 - * @return void - */ -function astra_support_block_editor() { - $theme_options = get_option( 'astra-settings' ); - - // Set flag on existing user's site to not reflect changes directly. - if ( ! isset( $theme_options['support-block-editor'] ) ) { - $theme_options['support-block-editor'] = false; - update_option( 'astra-settings', $theme_options ); - } -} + array( + 'top' => $btn_vertical_padding, + 'right' => $btn_horizontal_padding, + 'bottom' => $btn_vertical_padding, + 'left' => $btn_horizontal_padding, + ), + 'tablet' => array( + 'top' => '', + 'right' => '', + 'bottom' => '', + 'left' => '', + ), + 'mobile' => array( + 'top' => '', + 'right' => '', + 'bottom' => '', + 'left' => '', + ), + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ); + + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Migrate option data from button url to the new link param. + * + * @since 2.3.0 + * + * @return void + */ +function astra_header_button_new_options() { + + $theme_options = get_option( 'astra-settings', array() ); + + $btn_url = isset( $theme_options['header-main-rt-section-button-link'] ) ? $theme_options['header-main-rt-section-button-link'] : 'https://www.adelielinux.org/'; + $theme_options['header-main-rt-section-button-link-option'] = array( + 'url' => $btn_url, + 'new_tab' => false, + 'link_rel' => '', + ); + + update_option( 'astra-settings', $theme_options ); +} + +/** + * For existing users, do not provide Elementor Default Color Typo settings compatibility by default. + * + * @since 2.3.3 + * + * @return void + */ +function astra_elementor_default_color_typo_comp() { + + $theme_options = get_option( 'astra-settings', array() ); + + // Set flag to not load button specific CSS. + if ( ! isset( $theme_options['ele-default-color-typo-setting-comp'] ) ) { + $theme_options['ele-default-color-typo-setting-comp'] = false; + update_option( 'astra-settings', $theme_options ); + } + +} + +/** + * For existing users, change the separator from html entity to css entity. + * + * @since 2.3.4 + * + * @return void + */ +function astra_breadcrumb_separator_fix() { + + $theme_options = get_option( 'astra-settings', array() ); + + // Check if the saved database value for Breadcrumb Separator is "»", then change it to '\00bb'. + if ( isset( $theme_options['breadcrumb-separator'] ) && '»' === $theme_options['breadcrumb-separator'] ) { + $theme_options['breadcrumb-separator'] = '\00bb'; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Check if we need to change the default value for tablet breakpoint. + * + * @since 2.4.0 + * @return void + */ +function astra_update_theme_tablet_breakpoint() { + + $theme_options = get_option( 'astra-settings' ); + + if ( ! isset( $theme_options['can-update-theme-tablet-breakpoint'] ) ) { + // Set a flag to check if we need to change the theme tablet breakpoint value. + $theme_options['can-update-theme-tablet-breakpoint'] = false; + } + + update_option( 'astra-settings', $theme_options ); +} + +/** + * Migrate option data from site layout background option to its desktop counterpart. + * + * @since 2.4.0 + * + * @return void + */ +function astra_responsive_base_background_option() { + + $theme_options = get_option( 'astra-settings', array() ); + + if ( false === get_option( 'site-layout-outside-bg-obj-responsive', false ) && isset( $theme_options['site-layout-outside-bg-obj'] ) ) { + + $theme_options['site-layout-outside-bg-obj-responsive']['desktop'] = $theme_options['site-layout-outside-bg-obj']; + $theme_options['site-layout-outside-bg-obj-responsive']['tablet'] = array( + 'background-color' => '', + 'background-image' => '', + 'background-repeat' => 'repeat', + 'background-position' => 'center center', + 'background-size' => 'auto', + 'background-attachment' => 'scroll', + ); + $theme_options['site-layout-outside-bg-obj-responsive']['mobile'] = array( + 'background-color' => '', + 'background-image' => '', + 'background-repeat' => 'repeat', + 'background-position' => 'center center', + 'background-size' => 'auto', + 'background-attachment' => 'scroll', + ); + } + + update_option( 'astra-settings', $theme_options ); +} + +/** + * Do not apply new wide/full image CSS for existing users. + * + * @since 2.4.4 + * + * @return void + */ +function astra_gtn_full_wide_image_group_css() { + + $theme_options = get_option( 'astra-settings', array() ); + + // Set flag to not load button specific CSS. + if ( ! isset( $theme_options['gtn-full-wide-image-grp-css'] ) ) { + $theme_options['gtn-full-wide-image-grp-css'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Do not apply new wide/full Group and Cover block CSS for existing users. + * + * @since 2.5.0 + * + * @return void + */ +function astra_gtn_full_wide_group_cover_css() { + $theme_options = get_option( 'astra-settings', array() ); + + if ( ! isset( $theme_options['gtn-full-wide-grp-cover-css'] ) ) { + $theme_options['gtn-full-wide-grp-cover-css'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + + +/** + * Do not apply the global border width and border color setting for the existng users. + * + * @since 2.5.0 + * + * @return void + */ +function astra_global_button_woo_css() { + $theme_options = get_option( 'astra-settings', array() ); + + // Set flag to not load button specific CSS. + if ( ! isset( $theme_options['global-btn-woo-css'] ) ) { + $theme_options['global-btn-woo-css'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Migrate Footer Widget param to array. + * + * @since 2.5.2 + * + * @return void + */ +function astra_footer_widget_bg() { + $theme_options = get_option( 'astra-settings', array() ); + + // Check if Footer Backgound array is already set or not. If not then set it as array. + if ( isset( $theme_options['footer-adv-bg-obj'] ) && ! is_array( $theme_options['footer-adv-bg-obj'] ) ) { + $theme_options['footer-adv-bg-obj'] = array( + 'background-color' => '', + 'background-image' => '', + 'background-repeat' => 'repeat', + 'background-position' => 'center center', + 'background-size' => 'auto', + 'background-attachment' => 'scroll', + ); + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Check if we need to load icons as font or SVG. + * + * @since 3.3.0 + * @return void + */ +function astra_icons_svg_compatibility() { + + $theme_options = get_option( 'astra-settings' ); + + if ( ! isset( $theme_options['can-update-astra-icons-svg'] ) ) { + // Set a flag to check if we need to add icons as SVG. + $theme_options['can-update-astra-icons-svg'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Migrate Background control options to new array. + * + * @since 3.0.0 + * + * @return void + */ +function astra_bg_control_migration() { + + $db_options = array( + 'footer-adv-bg-obj', + 'footer-bg-obj', + 'sidebar-bg-obj', + ); + + $theme_options = get_option( 'astra-settings', array() ); + + foreach ( $db_options as $option_name ) { + + if ( ! ( isset( $theme_options[ $option_name ]['background-type'] ) && isset( $theme_options[ $option_name ]['background-media'] ) ) && isset( $theme_options[ $option_name ] ) ) { + + if ( ! empty( $theme_options[ $option_name ]['background-image'] ) ) { + $theme_options[ $option_name ]['background-type'] = 'image'; + $theme_options[ $option_name ]['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['background-image'] ); + } else { + $theme_options[ $option_name ]['background-type'] = ''; + $theme_options[ $option_name ]['background-media'] = ''; + } + + error_log( sprintf( 'Astra: Migrating Background Option - %s', $option_name ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log + update_option( 'astra-settings', $theme_options ); + } + } +} + +/** + * Migrate Background Responsive options to new array. + * + * @since 3.0.0 + * + * @return void + */ +function astra_bg_responsive_control_migration() { + + $db_options = array( + 'site-layout-outside-bg-obj-responsive', + 'content-bg-obj-responsive', + 'header-bg-obj-responsive', + 'primary-menu-bg-obj-responsive', + 'above-header-bg-obj-responsive', + 'above-header-menu-bg-obj-responsive', + 'below-header-bg-obj-responsive', + 'below-header-menu-bg-obj-responsive', + ); + + $theme_options = get_option( 'astra-settings', array() ); + + foreach ( $db_options as $option_name ) { + + if ( ! ( isset( $theme_options[ $option_name ]['desktop']['background-type'] ) && isset( $theme_options[ $option_name ]['desktop']['background-media'] ) ) && isset( $theme_options[ $option_name ] ) ) { + + if ( ! empty( $theme_options[ $option_name ]['desktop']['background-image'] ) ) { + $theme_options[ $option_name ]['desktop']['background-type'] = 'image'; + $theme_options[ $option_name ]['desktop']['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['desktop']['background-image'] ); + } else { + $theme_options[ $option_name ]['desktop']['background-type'] = ''; + $theme_options[ $option_name ]['desktop']['background-media'] = ''; + } + + if ( ! empty( $theme_options[ $option_name ]['tablet']['background-image'] ) ) { + $theme_options[ $option_name ]['tablet']['background-type'] = 'image'; + $theme_options[ $option_name ]['tablet']['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['tablet']['background-image'] ); + } else { + $theme_options[ $option_name ]['tablet']['background-type'] = ''; + $theme_options[ $option_name ]['tablet']['background-media'] = ''; + } + + if ( ! empty( $theme_options[ $option_name ]['mobile']['background-image'] ) ) { + $theme_options[ $option_name ]['mobile']['background-type'] = 'image'; + $theme_options[ $option_name ]['mobile']['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['mobile']['background-image'] ); + } else { + $theme_options[ $option_name ]['mobile']['background-type'] = ''; + $theme_options[ $option_name ]['mobile']['background-media'] = ''; + } + + error_log( sprintf( 'Astra: Migrating Background Response Option - %s', $option_name ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log + update_option( 'astra-settings', $theme_options ); + } + } +} + +/** + * Do not apply new Group, Column and Media & Text block CSS for existing users. + * + * @since 3.0.0 + * + * @return void + */ +function astra_gutenberg_core_blocks_design_compatibility() { + $theme_options = get_option( 'astra-settings', array() ); + + if ( ! isset( $theme_options['guntenberg-core-blocks-comp-css'] ) ) { + $theme_options['guntenberg-core-blocks-comp-css'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Header Footer builder - Migration compatibility. + * + * @since 3.0.0 + * + * @return void + */ +function astra_header_builder_compatibility() { + $theme_options = get_option( 'astra-settings', array() ); + + // Set flag to not load button specific CSS. + if ( ! isset( $theme_options['is-header-footer-builder'] ) ) { + $theme_options['is-header-footer-builder'] = false; + update_option( 'astra-settings', $theme_options ); + } + if ( ! isset( $theme_options['header-footer-builder-notice'] ) ) { + $theme_options['header-footer-builder-notice'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Clears assets cache and regenerates new assets files. + * + * @since 3.0.1 + * + * @return void + */ +function astra_clear_assets_cache() { + if ( is_callable( 'Astra_Minify::refresh_assets' ) ) { + Astra_Minify::refresh_assets(); + } +} + +/** + * Header Footer builder - Migration of options. + * + * @since 3.0.0 + * + * @return void + */ +function astra_header_builder_migration() { + + /** + * All theme options. + */ + $theme_options = get_option( 'astra-settings', array() ); + + // WordPress sidebar_widgets option. + $widget_options = get_option( 'sidebars_widgets', array() ); + + $used_elements = array(); + + $options = array( + 'theme_options' => $theme_options, + 'used_elements' => $used_elements, + 'widget_options' => $widget_options, + ); + + $options = astra_primary_header_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); + + $options = astra_below_header_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); + + $options = astra_above_header_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); + + $options = astra_footer_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); + + $options = astra_footer_widgets_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); + + $options = astra_primary_menu_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); + + $options = astra_sticky_header_builder_migration( $options['theme_options'], $options['used_elements'], $options['widget_options'] ); + + $theme_options = $options['theme_options']; + $widget_options = $options['widget_options']; + + $theme_options['v3-option-migration'] = true; + + update_option( 'astra-settings', $theme_options ); + update_option( 'sidebars_widgets', $widget_options ); + +} + +/** + * Header Footer builder - Migration of Sticky Header. + * + * @since 3.0.0 + * @param array $theme_options Theme options. + * @param array $used_elements Used Elements array. + * @param array $widget_options Widget options. + * @return array + */ +function astra_sticky_header_builder_migration( $theme_options, $used_elements, $widget_options ) { + + // Menu. + $is_menu_in_primary = false; + $is_menu_in_above = false; + $is_menu_in_below = false; + + if ( isset( $theme_options['header-desktop-items']['primary'] ) ) { + foreach ( $theme_options['header-desktop-items']['primary'] as $zone ) { + if ( false !== array_search( 'menu-1', $zone ) ) { + $is_menu_in_primary = true; + } + } + } + + if ( isset( $theme_options['header-desktop-items']['above'] ) ) { + foreach ( $theme_options['header-desktop-items']['above'] as $zone ) { + if ( false !== array_search( 'menu-1', $zone ) ) { + $is_menu_in_above = true; + } + } + } + + if ( isset( $theme_options['header-desktop-items']['below'] ) ) { + foreach ( $theme_options['header-desktop-items']['below'] as $zone ) { + if ( false !== array_search( 'menu-1', $zone ) ) { + $is_menu_in_below = true; + } + } + } + + if ( $is_menu_in_primary ) { + + // Menu. + // Normal. + if ( isset( $theme_options['sticky-header-menu-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-color-responsive'] = $theme_options['sticky-header-menu-color-responsive']; + } + + if ( isset( $theme_options['sticky-header-menu-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-bg-obj-responsive'] = $theme_options['sticky-header-menu-bg-color-responsive']; + } + + + // Hover. + if ( isset( $theme_options['sticky-header-menu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-h-color-responsive'] = $theme_options['sticky-header-menu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-header-menu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-h-bg-color-responsive'] = $theme_options['sticky-header-menu-h-a-bg-color-responsive']; + } + + + // Active. + if ( isset( $theme_options['sticky-header-menu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-a-color-responsive'] = $theme_options['sticky-header-menu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-header-menu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-a-bg-color-responsive'] = $theme_options['sticky-header-menu-h-a-bg-color-responsive']; + } + + + // Submenu. + + // Normal. + if ( isset( $theme_options['sticky-header-submenu-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-submenu-color-responsive'] = $theme_options['sticky-header-submenu-color-responsive']; + } + + if ( isset( $theme_options['sticky-header-submenu-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-submenu-bg-color-responsive'] = $theme_options['sticky-header-submenu-bg-color-responsive']; + } + + + // Hover. + if ( isset( $theme_options['sticky-header-submenu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-submenu-h-color-responsive'] = $theme_options['sticky-header-submenu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-header-submenu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-submenu-h-bg-color-responsive'] = $theme_options['sticky-header-submenu-h-a-bg-color-responsive']; + } + + + // Active. + if ( isset( $theme_options['sticky-header-submenu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-submenu-a-color-responsive'] = $theme_options['sticky-header-submenu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-header-submenu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu1-submenu-a-bg-color-responsive'] = $theme_options['sticky-header-submenu-h-a-bg-color-responsive']; + } + + + // Mega menu. + + // Normal. + if ( isset( $theme_options['sticky-primary-header-megamenu-heading-color'] ) ) { + $theme_options['sticky-header-menu1-header-megamenu-heading-color'] = $theme_options['sticky-primary-header-megamenu-heading-color']; + } + + + // Hover. + if ( isset( $theme_options['sticky-primary-header-megamenu-heading-h-color'] ) ) { + $theme_options['sticky-header-menu1-header-megamenu-heading-h-color'] = $theme_options['sticky-primary-header-megamenu-heading-h-color']; + } + } + + if ( $is_menu_in_above ) { + + // Menu. + + // Normal. + if ( isset( $theme_options['sticky-above-header-menu-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-color-responsive'] = $theme_options['sticky-above-header-menu-color-responsive']; + } + + if ( isset( $theme_options['sticky-above-header-menu-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-bg-obj-responsive'] = $theme_options['sticky-above-header-menu-bg-color-responsive']; + } + + + // Hover. + if ( isset( $theme_options['sticky-above-header-menu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-h-color-responsive'] = $theme_options['sticky-above-header-menu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-above-header-menu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-h-bg-color-responsive'] = $theme_options['sticky-above-header-menu-h-a-bg-color-responsive']; + } + + + // Active. + if ( isset( $theme_options['sticky-above-header-menu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-a-color-responsive'] = $theme_options['sticky-above-header-menu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-above-header-menu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-a-bg-color-responsive'] = $theme_options['sticky-above-header-menu-h-a-bg-color-responsive']; + } + + + // Submenu. + + // Normal. + if ( isset( $theme_options['sticky-above-header-submenu-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-submenu-color-responsive'] = $theme_options['sticky-above-header-submenu-color-responsive']; + } + + if ( isset( $theme_options['sticky-above-header-submenu-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-submenu-bg-obj-responsive'] = $theme_options['sticky-above-header-submenu-bg-color-responsive']; + } + + + // Hover. + if ( isset( $theme_options['sticky-above-header-submenu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-submenu-h-color-responsive'] = $theme_options['sticky-above-header-submenu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-above-header-submenu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-submenu-h-bg-color-responsive'] = $theme_options['sticky-above-header-submenu-h-a-bg-color-responsive']; + } + + + // Active. + if ( isset( $theme_options['sticky-above-header-submenu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-submenu-a-color-responsive'] = $theme_options['sticky-above-header-submenu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-above-header-submenu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu3-submenu-a-bg-color-responsive'] = $theme_options['sticky-above-header-submenu-h-a-bg-color-responsive']; + } + + + // Mega menu. + + // Normal. + if ( isset( $theme_options['sticky-above-header-megamenu-heading-color'] ) ) { + $theme_options['sticky-header-menu3-header-megamenu-heading-color'] = $theme_options['sticky-above-header-megamenu-heading-color']; + } + + + // Hover. + if ( isset( $theme_options['sticky-above-header-megamenu-heading-h-color'] ) ) { + $theme_options['sticky-header-menu3-header-megamenu-heading-h-color'] = $theme_options['sticky-above-header-megamenu-heading-h-color']; + } + } + + if ( $is_menu_in_below ) { + + // Menu. + + // Normal. + if ( isset( $theme_options['sticky-below-header-menu-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-color-responsive'] = $theme_options['sticky-below-header-menu-color-responsive']; + } + + if ( isset( $theme_options['sticky-below-header-menu-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-bg-obj-responsive'] = $theme_options['sticky-below-header-menu-bg-color-responsive']; + } + + + // Hover. + if ( isset( $theme_options['sticky-below-header-menu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-h-color-responsive'] = $theme_options['sticky-below-header-menu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-below-header-menu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-h-bg-color-responsive'] = $theme_options['sticky-below-header-menu-h-a-bg-color-responsive']; + } + + + // Active. + if ( isset( $theme_options['sticky-below-header-menu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-a-color-responsive'] = $theme_options['sticky-below-header-menu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-below-header-menu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-a-bg-color-responsive'] = $theme_options['sticky-below-header-menu-h-a-bg-color-responsive']; + } + + + // Submenu. + + // Normal. + if ( isset( $theme_options['sticky-below-header-submenu-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-submenu-color-responsive'] = $theme_options['sticky-below-header-submenu-color-responsive']; + } + + if ( isset( $theme_options['sticky-below-header-submenu-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-submenu-bg-obj-responsive'] = $theme_options['sticky-below-header-submenu-bg-color-responsive']; + } + + + // Hover. + if ( isset( $theme_options['sticky-below-header-submenu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-submenu-h-color-responsive'] = $theme_options['sticky-below-header-submenu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-below-header-submenu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-submenu-h-bg-color-responsive'] = $theme_options['sticky-below-header-submenu-h-a-bg-color-responsive']; + } + + + // Active. + if ( isset( $theme_options['sticky-below-header-submenu-h-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-submenu-a-color-responsive'] = $theme_options['sticky-below-header-submenu-h-color-responsive']; + } + + if ( isset( $theme_options['sticky-below-header-submenu-h-a-bg-color-responsive'] ) ) { + $theme_options['sticky-header-menu2-submenu-a-bg-color-responsive'] = $theme_options['sticky-below-header-submenu-h-a-bg-color-responsive']; + } + + + // Mega menu. + + // Normal. + if ( isset( $theme_options['sticky-below-header-megamenu-heading-color'] ) ) { + $theme_options['sticky-header-menu2-header-megamenu-heading-color'] = $theme_options['sticky-below-header-megamenu-heading-color']; + } + + + // Hover. + if ( isset( $theme_options['sticky-below-header-megamenu-heading-h-color'] ) ) { + $theme_options['sticky-header-menu2-header-megamenu-heading-h-color'] = $theme_options['sticky-below-header-megamenu-heading-h-color']; + } + } + + // Sticky Site Title. + + // Normal. + if ( isset( $theme_options['sticky-header-color-site-title-responsive']['desktop'] ) ) { + $theme_options['sticky-header-builder-site-title-color'] = $theme_options['sticky-header-color-site-title-responsive']['desktop']; + } + + + // Hover. + if ( isset( $theme_options['sticky-header-color-h-site-title-responsive']['desktop'] ) ) { + $theme_options['sticky-header-builder-site-title-h-color'] = $theme_options['sticky-header-color-h-site-title-responsive']['desktop']; + } + + + // Sticky Site Tagline. + if ( isset( $theme_options['sticky-header-color-site-tagline-responsive']['desktop'] ) ) { + $theme_options['sticky-header-builder-site-tagline-color'] = $theme_options['sticky-header-color-site-tagline-responsive']['desktop']; + } + + + // Sticky Above/Below Header HTML. + $is_html_in_above = false; + $is_html_in_below = false; + + foreach ( $theme_options['header-desktop-items']['above'] as $zone ) { + if ( false !== array_search( 'html-3', $zone ) ) { + $is_html_in_above = true; + } + } + foreach ( $theme_options['header-desktop-items']['below'] as $zone ) { + if ( false !== array_search( 'html-2', $zone ) ) { + $is_html_in_below = true; + } + } + + if ( $is_html_in_above ) { + + if ( isset( $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-html-3color'] = $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop']; + } + } + if ( $is_html_in_below ) { + + if ( isset( $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-html-2color'] = $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop']; + } + } + + // Sticky Above/Below Header Search. + $is_search_in_above = false; + $is_search_in_below = false; + + foreach ( $theme_options['header-desktop-items']['above'] as $zone ) { + if ( false !== array_search( 'search', $zone ) ) { + $is_search_in_above = true; + } + } + foreach ( $theme_options['header-desktop-items']['below'] as $zone ) { + if ( false !== array_search( 'search', $zone ) ) { + $is_search_in_below = true; + } + } + + if ( $is_search_in_above ) { + + if ( isset( $theme_options['sticky-above-header-content-section-link-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-search-icon-color'] = $theme_options['sticky-above-header-content-section-link-color-responsive']['desktop']; + } + } + if ( $is_search_in_below ) { + + if ( isset( $theme_options['sticky-below-header-content-section-link-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-search-icon-color'] = $theme_options['sticky-below-header-content-section-link-color-responsive']['desktop']; + } + } + + // Sticky Above/Below Header Widget. + $is_widget_in_above = false; + $is_widget_in_below = false; + + foreach ( $theme_options['header-desktop-items']['above'] as $zone ) { + if ( false !== array_search( 'widget-3', $zone ) ) { + $is_widget_in_above = true; + } + } + foreach ( $theme_options['header-desktop-items']['below'] as $zone ) { + if ( false !== array_search( 'widget-2', $zone ) ) { + $is_widget_in_below = true; + } + } + + if ( $is_widget_in_above ) { + + if ( isset( $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-widget-3-title-color'] = $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop']; + } + + if ( isset( $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-widget-3-color'] = $theme_options['sticky-above-header-content-section-text-color-responsive']['desktop']; + } + + if ( isset( $theme_options['sticky-above-header-content-section-link-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-widget-3-link-color'] = $theme_options['sticky-above-header-content-section-link-color-responsive']['desktop']; + } + + if ( isset( $theme_options['sticky-above-header-content-section-link-h-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-widget-3-link-h-color'] = $theme_options['sticky-above-header-content-section-link-h-color-responsive']['desktop']; + } + } + if ( $is_widget_in_below ) { + + if ( isset( $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-widget-2-title-color'] = $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop']; + } + + if ( isset( $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-widget-2-color'] = $theme_options['sticky-below-header-content-section-text-color-responsive']['desktop']; + } + + if ( isset( $theme_options['sticky-below-header-content-section-link-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-widget-2-link-color'] = $theme_options['sticky-below-header-content-section-link-color-responsive']['desktop']; + } + + if ( isset( $theme_options['sticky-below-header-content-section-link-h-color-responsive']['desktop'] ) ) { + $theme_options['sticky-header-widget-2-link-h-color'] = $theme_options['sticky-below-header-content-section-link-h-color-responsive']['desktop']; + } + } + + return array( + 'theme_options' => $theme_options, + 'used_elements' => $used_elements, + 'widget_options' => $widget_options, + ); +} + +/** + * Header Footer builder - Migration of Primary Menu. + * + * @since 3.0.0 + * @param array $theme_options Theme options. + * @param array $used_elements Used Elements array. + * @param array $widget_options Widget options. + * @return array + */ +function astra_primary_menu_builder_migration( $theme_options, $used_elements, $widget_options ) { + + /** + * Primary Menu. + */ + if ( isset( $theme_options['header-main-submenu-container-animation'] ) ) { + $theme_options['header-menu1-submenu-container-animation'] = $theme_options['header-main-submenu-container-animation']; + } + if ( isset( $theme_options['primary-submenu-border'] ) ) { + $theme_options['header-menu1-submenu-border'] = $theme_options['primary-submenu-border']; + } + if ( isset( $theme_options['primary-submenu-b-color'] ) ) { + $theme_options['header-menu1-submenu-b-color'] = $theme_options['primary-submenu-b-color']; + } + if ( isset( $theme_options['primary-submenu-item-border'] ) ) { + $theme_options['header-menu1-submenu-item-border'] = $theme_options['primary-submenu-item-border']; + } + if ( isset( $theme_options['primary-submenu-item-b-color'] ) ) { + $theme_options['header-menu1-submenu-item-b-color'] = $theme_options['primary-submenu-item-b-color']; + } + + /** + * Primary Menu. + */ + + if ( isset( $theme_options['primary-menu-color-responsive'] ) ) { + $theme_options['header-menu1-color-responsive'] = $theme_options['primary-menu-color-responsive']; + } + + if ( isset( $theme_options['primary-menu-bg-obj-responsive'] ) ) { + $theme_options['header-menu1-bg-obj-responsive'] = $theme_options['primary-menu-bg-obj-responsive']; + } + + + if ( isset( $theme_options['primary-menu-text-h-color-responsive'] ) ) { + $theme_options['header-menu1-h-color-responsive'] = $theme_options['primary-menu-text-h-color-responsive']; + } + + if ( isset( $theme_options['primary-menu-h-bg-color-responsive'] ) ) { + $theme_options['header-menu1-h-bg-color-responsive'] = $theme_options['primary-menu-h-bg-color-responsive']; + } + + + if ( isset( $theme_options['primary-menu-a-color-responsive'] ) ) { + $theme_options['header-menu1-a-color-responsive'] = $theme_options['primary-menu-a-color-responsive']; + } + + if ( isset( $theme_options['primary-menu-a-bg-color-responsive'] ) ) { + $theme_options['header-menu1-a-bg-color-responsive'] = $theme_options['primary-menu-a-bg-color-responsive']; + } + + + if ( isset( $theme_options['font-size-primary-menu'] ) ) { + $theme_options['header-menu1-font-size'] = $theme_options['font-size-primary-menu']; + } + + if ( isset( $theme_options['font-weight-primary-menu'] ) ) { + $theme_options['header-menu1-font-weight'] = $theme_options['font-weight-primary-menu']; + } + + if ( isset( $theme_options['line-height-primary-menu'] ) ) { + $theme_options['header-menu1-line-height'] = $theme_options['line-height-primary-menu']; + } + + if ( isset( $theme_options['font-family-primary-menu'] ) ) { + $theme_options['header-menu1-font-family'] = $theme_options['font-family-primary-menu']; + } + + if ( isset( $theme_options['text-transform-primary-menu'] ) ) { + $theme_options['header-menu1-text-transform'] = $theme_options['text-transform-primary-menu']; + } + + if ( isset( $theme_options['primary-menu-spacing'] ) ) { + $theme_options['header-menu1-menu-spacing'] = $theme_options['primary-menu-spacing']; + } + + // Primary Menu - Submenu. + if ( isset( $theme_options['primary-submenu-color-responsive'] ) ) { + $theme_options['header-menu1-submenu-color-responsive'] = $theme_options['primary-submenu-color-responsive']; + } + + if ( isset( $theme_options['primary-submenu-bg-color-responsive'] ) ) { + $theme_options['header-menu1-submenu-bg-color-responsive'] = $theme_options['primary-submenu-bg-color-responsive']; + } + + if ( isset( $theme_options['primary-submenu-h-color-responsive'] ) ) { + $theme_options['header-menu1-submenu-h-color-responsive'] = $theme_options['primary-submenu-h-color-responsive']; + } + + if ( isset( $theme_options['primary-submenu-h-bg-color-responsive'] ) ) { + $theme_options['header-menu1-submenu-h-bg-color-responsive'] = $theme_options['primary-submenu-h-bg-color-responsive']; + } + + if ( isset( $theme_options['primary-submenu-a-color-responsive'] ) ) { + $theme_options['header-menu1-submenu-a-color-responsive'] = $theme_options['primary-submenu-a-color-responsive']; + } + + if ( isset( $theme_options['primary-submenu-a-bg-color-responsive'] ) ) { + $theme_options['header-menu1-submenu-a-bg-color-responsive'] = $theme_options['primary-submenu-a-bg-color-responsive']; + } + + if ( isset( $theme_options['font-size-primary-dropdown-menu'] ) ) { + $theme_options['header-font-size-menu1-sub-menu'] = $theme_options['font-size-primary-dropdown-menu']; + } + + if ( isset( $theme_options['font-weight-primary-dropdown-menu'] ) ) { + $theme_options['header-font-weight-menu1-sub-menu'] = $theme_options['font-weight-primary-dropdown-menu']; + } + + if ( isset( $theme_options['line-height-primary-dropdown-menu'] ) ) { + $theme_options['header-line-height-menu1-sub-menu'] = $theme_options['line-height-primary-dropdown-menu']; + } + + if ( isset( $theme_options['font-family-primary-dropdown-menu'] ) ) { + $theme_options['header-font-family-menu1-sub-menu'] = $theme_options['font-family-primary-dropdown-menu']; + } + + if ( isset( $theme_options['text-transform-primary-dropdown-menu'] ) ) { + $theme_options['header-text-transform-menu1-sub-menu'] = $theme_options['text-transform-primary-dropdown-menu']; + } + + if ( isset( $theme_options['primary-submenu-spacing'] ) ) { + $theme_options['header-menu1-submenu-spacing'] = $theme_options['primary-submenu-spacing']; + } + + // Primary Menu - Mega Menu. + if ( isset( $theme_options['primary-header-megamenu-heading-color'] ) ) { + $theme_options['header-menu1-header-megamenu-heading-color'] = $theme_options['primary-header-megamenu-heading-color']; + } + + if ( isset( $theme_options['primary-header-megamenu-heading-h-color'] ) ) { + $theme_options['header-menu1-header-megamenu-heading-h-color'] = $theme_options['primary-header-megamenu-heading-h-color']; + } + + if ( isset( $theme_options['primary-header-megamenu-heading-font-size'] ) ) { + $theme_options['header-menu1-megamenu-heading-font-size'] = $theme_options['primary-header-megamenu-heading-font-size']; + } + + if ( isset( $theme_options['primary-header-megamenu-heading-font-weight'] ) ) { + $theme_options['header-menu1-megamenu-heading-font-weight'] = $theme_options['primary-header-megamenu-heading-font-weight']; + } + + if ( isset( $theme_options['primary-header-megamenu-heading-line-height'] ) ) { + $theme_options['header-menu1-megamenu-heading-line-height'] = $theme_options['primary-header-megamenu-heading-line-height']; + } + + if ( isset( $theme_options['primary-header-megamenu-heading-font-family'] ) ) { + $theme_options['header-menu1-megamenu-heading-font-family'] = $theme_options['primary-header-megamenu-heading-font-family']; + } + + if ( isset( $theme_options['primary-header-megamenu-heading-text-transform'] ) ) { + $theme_options['header-menu1-megamenu-heading-text-transform'] = $theme_options['primary-header-megamenu-heading-text-transform']; + } + + if ( isset( $theme_options['primary-header-megamenu-heading-space'] ) ) { + $theme_options['header-menu1-megamenu-heading-space'] = $theme_options['primary-header-megamenu-heading-space']; + } + + + /** + * Primary Menu - Mobile. + */ + if ( isset( $theme_options['header-main-menu-label'] ) ) { + $theme_options['mobile-header-menu-label'] = $theme_options['header-main-menu-label']; + } + + if ( isset( $theme_options['mobile-header-toggle-btn-style-color'] ) ) { + $theme_options['mobile-header-toggle-btn-color'] = $theme_options['mobile-header-toggle-btn-style-color']; + $theme_options['mobile-header-toggle-border-color'] = $theme_options['mobile-header-toggle-btn-style-color']; + } + + if ( isset( $theme_options['mobile-header-toggle-btn-border-radius'] ) ) { + $theme_options['mobile-header-toggle-border-radius'] = $theme_options['mobile-header-toggle-btn-border-radius']; + } + + return array( + 'theme_options' => $theme_options, + 'used_elements' => $used_elements, + 'widget_options' => $widget_options, + ); +} + +/** + * Header Footer builder - Migration of Primary Header. + * + * @since 3.0.0 + * @param array $theme_options Theme options. + * @param array $used_elements Used Elements array. + * @param array $widget_options Widget options. + * @return array + */ +function astra_primary_header_builder_migration( $theme_options, $used_elements, $widget_options ) { + + /** + * Primary Header. + */ + + // Header : Primary Header - Layout. + $primary_header_layout = ( isset( $theme_options['header-layouts'] ) ) ? $theme_options['header-layouts'] : ''; + + // Header : Primary Header - Last Menu Item. + $last_menu_item = ( isset( $theme_options['header-main-rt-section'] ) ) ? $theme_options['header-main-rt-section'] : ''; + $last_menu_item_mobile_flag = ( isset( $theme_options['hide-custom-menu-mobile'] ) ) ? $theme_options['hide-custom-menu-mobile'] : ''; + $last_menu_item_mobile_outside = ( isset( $theme_options['header-display-outside-menu'] ) ) ? $theme_options['header-display-outside-menu'] : ''; + $new_menu_item = ''; + + $theme_options['mobile-header-type'] = 'dropdown'; + + if ( isset( $theme_options['mobile-menu-style'] ) ) { + switch ( $theme_options['mobile-menu-style'] ) { + case 'flyout': + $theme_options['mobile-header-type'] = 'off-canvas'; + if ( isset( $theme_options['flyout-mobile-menu-alignment'] ) ) { + $theme_options['off-canvas-slide'] = $theme_options['flyout-mobile-menu-alignment']; + } + break; + case 'fullscreen': + $theme_options['mobile-header-type'] = 'full-width'; + break; + + case 'default': + default: + $theme_options['mobile-header-type'] = 'dropdown'; + break; + } + } + + switch ( $last_menu_item ) { + case 'search': + $new_menu_item = 'search'; + if ( isset( $theme_options['header-main-rt-section-search-box-type'] ) ) { + $theme_options['header-search-box-type'] = $theme_options['header-main-rt-section-search-box-type']; + } + break; + + case 'button': + $new_menu_item = 'button-1'; + if ( isset( $theme_options['header-main-rt-section-button-text'] ) ) { + $theme_options['header-button1-text'] = $theme_options['header-main-rt-section-button-text']; + } + if ( isset( $theme_options['header-main-rt-section-button-link-option'] ) ) { + $theme_options['header-button1-link-option'] = $theme_options['header-main-rt-section-button-link-option']; + } + if ( isset( $theme_options['header-main-rt-section-button-text-color'] ) ) { + $theme_options['header-button1-text-color'] = array( + 'desktop' => $theme_options['header-main-rt-section-button-text-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['header-main-rt-section-button-back-color'] ) ) { + $theme_options['header-button1-back-color'] = array( + 'desktop' => $theme_options['header-main-rt-section-button-back-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['header-main-rt-section-button-text-h-color'] ) ) { + $theme_options['header-button1-text-h-color'] = array( + 'desktop' => $theme_options['header-main-rt-section-button-text-h-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['header-main-rt-section-button-back-h-color'] ) ) { + $theme_options['header-button1-back-h-color'] = array( + 'desktop' => $theme_options['header-main-rt-section-button-back-h-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['header-main-rt-section-button-border-size'] ) ) { + $theme_options['header-button1-border-size'] = $theme_options['header-main-rt-section-button-border-size']; + } + if ( isset( $theme_options['header-main-rt-section-button-border-color'] ) ) { + $theme_options['header-button1-border-color'] = array( + 'desktop' => $theme_options['header-main-rt-section-button-border-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['header-main-rt-section-button-border-h-color'] ) ) { + $theme_options['header-button1-border-h-color'] = array( + 'desktop' => $theme_options['header-main-rt-section-button-border-h-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['header-main-rt-section-button-border-radius'] ) ) { + $theme_options['header-button1-border-radius'] = $theme_options['header-main-rt-section-button-border-radius']; + } + if ( isset( $theme_options['primary-header-button-font-family'] ) ) { + $theme_options['header-button1-font-family'] = $theme_options['primary-header-button-font-family']; + } + if ( isset( $theme_options['primary-header-button-font-size'] ) ) { + $theme_options['header-button1-font-size'] = $theme_options['primary-header-button-font-size']; + } + if ( isset( $theme_options['primary-header-button-font-weight'] ) ) { + $theme_options['header-button1-font-weight'] = $theme_options['primary-header-button-font-weight']; + } + if ( isset( $theme_options['primary-header-button-text-transform'] ) ) { + $theme_options['header-button1-text-transform'] = $theme_options['primary-header-button-text-transform']; + } + if ( isset( $theme_options['primary-header-button-line-height'] ) ) { + $theme_options['header-button1-line-height'] = $theme_options['primary-header-button-line-height']; + } + if ( isset( $theme_options['primary-header-button-letter-spacing'] ) ) { + $theme_options['header-button1-letter-spacing'] = $theme_options['primary-header-button-letter-spacing']; + } + if ( isset( $theme_options['header-main-rt-section-button-padding'] ) ) { + $theme_options['section-hb-button-1-padding'] = $theme_options['header-main-rt-section-button-padding']; + } + // Sticky Header Button options. + + // Text Color. + if ( isset( $theme_options['header-main-rt-sticky-section-button-text-color'] ) ) { + + $theme_options['sticky-header-button1-text-color'] = array( + 'desktop' => $theme_options['header-main-rt-sticky-section-button-text-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + // BG Color. + if ( isset( $theme_options['header-main-rt-sticky-section-button-back-color'] ) ) { + $theme_options['sticky-header-button1-back-color'] = array( + 'desktop' => $theme_options['header-main-rt-sticky-section-button-back-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + // Text Hover Color. + if ( isset( $theme_options['header-main-rt-sticky-section-button-text-h-color'] ) ) { + $theme_options['sticky-header-button1-text-h-color'] = array( + 'desktop' => $theme_options['header-main-rt-sticky-section-button-text-h-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + // BG Hover Color. + if ( isset( $theme_options['header-main-rt-sticky-section-button-back-h-color'] ) ) { + $theme_options['sticky-header-button1-back-h-color'] = array( + 'desktop' => $theme_options['header-main-rt-sticky-section-button-back-h-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + // Border Width. + if ( isset( $theme_options['header-main-rt-sticky-section-button-border-size'] ) ) { + $theme_options['sticky-header-button1-border-size'] = $theme_options['header-main-rt-sticky-section-button-border-size']; + } + // Border Color. + if ( isset( $theme_options['header-main-rt-sticky-section-button-border-color'] ) ) { + $theme_options['sticky-header-button1-border-color'] = array( + 'desktop' => $theme_options['header-main-rt-sticky-section-button-border-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + // Border Hover Color. + if ( isset( $theme_options['header-main-rt-sticky-section-button-border-h-color'] ) ) { + $theme_options['sticky-header-button1-border-h-color'] = array( + 'desktop' => $theme_options['header-main-rt-sticky-section-button-border-h-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + // Border Radius. + if ( isset( $theme_options['header-main-rt-sticky-section-button-border-radius'] ) ) { + $theme_options['sticky-header-button1-border-radius'] = $theme_options['header-main-rt-sticky-section-button-border-radius']; + } + // Padding. + if ( isset( $theme_options['header-main-rt-sticky-section-button-padding'] ) ) { + $theme_options['sticky-header-button1-padding'] = $theme_options['header-main-rt-sticky-section-button-padding']; + } + + break; + + case 'text-html': + $new_menu_item = 'html-1'; + if ( isset( $theme_options['header-main-rt-section-html'] ) ) { + $theme_options['header-html-1'] = $theme_options['header-main-rt-section-html']; + } + break; + + case 'widget': + $new_menu_item = 'widget-1'; + if ( isset( $widget_options['header-widget'] ) ) { + $widget_options['header-widget-1'] = $widget_options['header-widget']; + } + break; + + case 'woocommerce': + $new_menu_item = 'woo-cart'; + if ( ! empty( $theme_options['woo-header-cart-icon-color'] ) ) { + $theme_options['header-woo-cart-icon-color'] = $theme_options['woo-header-cart-icon-color']; + } + break; + + case 'edd': + $new_menu_item = 'edd-cart'; + break; + } + + $used_elements[] = $new_menu_item; + + $new_menu_item_mobile = ( ! $last_menu_item_mobile_flag ) ? $new_menu_item : ''; + + $new_menu_item_mobile_outside = ''; + if ( ! $last_menu_item_mobile_flag && $last_menu_item_mobile_outside ) { + $new_menu_item_mobile_outside = $new_menu_item; + $new_menu_item_mobile = ''; + } + + $theme_options['header-desktop-items']['above'] = array( + 'above_left' => array(), + 'above_left_center' => array(), + 'above_center' => array(), + 'above_right_center' => array(), + 'above_right' => array(), + ); + $theme_options['header-mobile-items']['above'] = array( + 'above_left' => array(), + 'above_center' => array(), + 'above_right' => array(), + ); + + + $theme_options['header-desktop-items']['below'] = array( + 'below_left' => array(), + 'below_left_center' => array(), + 'below_center' => array(), + 'below_right_center' => array(), + 'below_right' => array(), + ); + + $theme_options['header-mobile-items']['below'] = array( + 'below_left' => array(), + 'below_center' => array(), + 'below_right' => array(), + ); + + /** + * Assign the new locations. + */ + switch ( $primary_header_layout ) { + case 'header-main-layout-1': + $theme_options['header-desktop-items']['primary'] = array( + 'primary_left' => array( 'logo' ), + 'primary_left_center' => array(), + 'primary_center' => array(), + 'primary_right_center' => array(), + 'primary_right' => ( '' !== $new_menu_item ) ? array( 'menu-1', $new_menu_item ) : array( 'menu-1' ), + ); + break; + + case 'header-main-layout-2': + $theme_options['header-desktop-items']['primary'] = array( + 'primary_left' => array(), + 'primary_left_center' => array(), + 'primary_center' => array( 'logo' ), + 'primary_right_center' => array(), + 'primary_right' => array(), + ); + $theme_options['header-desktop-items']['below'] = array( + 'below_left' => array(), + 'below_left_center' => array(), + 'below_center' => ( '' !== $new_menu_item ) ? array( 'menu-1', $new_menu_item ) : array( 'menu-1' ), + 'below_right_center' => array(), + 'below_right' => array(), + ); + break; + + case 'header-main-layout-3': + $theme_options['header-desktop-items']['primary'] = array( + 'primary_left' => ( '' !== $new_menu_item ) ? array( 'menu-1', $new_menu_item ) : array( 'menu-1' ), + 'primary_left_center' => array(), + 'primary_center' => array(), + 'primary_right_center' => array(), + 'primary_right' => array( 'logo' ), + ); + break; + + default: + $theme_options['header-desktop-items']['primary'] = array( + 'primary_left' => array( 'logo' ), + 'primary_left_center' => array(), + 'primary_center' => array(), + 'primary_right_center' => array(), + 'primary_right' => array( 'menu-1' ), + ); + } + + // Header : Primary Header - Mobile Layout. + $mobile_layout = astra_get_option( 'header-main-menu-align' ); + + if ( 'stack' === $mobile_layout ) { + $theme_options['header-mobile-items']['popup'] = array( 'popup_content' => ( '' !== $new_menu_item_mobile && '' !== $new_menu_item_mobile_outside ) ? array( 'menu-1', $new_menu_item_mobile ) : array( 'menu-1' ) ); + + $theme_options['header-mobile-items']['primary'] = array( + 'primary_left' => array(), + 'primary_center' => array( 'logo' ), + 'primary_right' => array(), + ); + + $theme_options['header-mobile-items']['below'] = array( + 'below_left' => array(), + 'below_center' => ( '' !== $new_menu_item_mobile_outside ) ? array( $new_menu_item_mobile_outside, 'mobile-trigger' ) : array( 'mobile-trigger' ), + 'below_right' => array(), + ); + } else { + + $theme_options['header-mobile-items']['popup'] = array( 'popup_content' => ( '' !== $new_menu_item_mobile ) ? array( 'menu-1', $new_menu_item_mobile ) : array( 'menu-1' ) ); + + if ( 'header-main-layout-3' === $primary_header_layout ) { + $theme_options['header-mobile-items']['primary'] = array( + 'primary_left' => ( '' !== $new_menu_item_mobile_outside ) ? array( $new_menu_item_mobile_outside, 'mobile-trigger' ) : array( 'mobile-trigger' ), + 'primary_center' => array(), + 'primary_right' => array( 'logo' ), + ); + } else { + $theme_options['header-mobile-items']['primary'] = array( + 'primary_left' => array( 'logo' ), + 'primary_center' => array(), + 'primary_right' => ( '' !== $new_menu_item_mobile_outside ) ? array( $new_menu_item_mobile_outside, 'mobile-trigger' ) : array( 'mobile-trigger' ), + ); + } + } + + // Header - Primary Header - Content Width. + if ( isset( $theme_options['header-main-layout-width'] ) ) { + $theme_options['hb-header-main-layout-width'] = $theme_options['header-main-layout-width']; + } + + // Header - Primary Header - Border Bottom. + if ( isset( $theme_options['header-main-sep'] ) ) { + $theme_options['hb-header-main-sep'] = $theme_options['header-main-sep']; + } + + if ( isset( $theme_options['header-main-sep-color'] ) ) { + $theme_options['hb-header-main-sep-color'] = $theme_options['header-main-sep-color']; + } + + if ( isset( $theme_options['header-bg-obj-responsive'] ) ) { + $theme_options['hb-header-bg-obj-responsive'] = $theme_options['header-bg-obj-responsive']; + } + + if ( isset( $theme_options['header-spacing'] ) ) { + $theme_options['section-primary-header-builder-padding'] = $theme_options['header-spacing']; + } + + return array( + 'theme_options' => $theme_options, + 'used_elements' => $used_elements, + 'widget_options' => $widget_options, + ); +} + +/** + * Header Footer builder - Migration of Above Header. + * + * @since 3.0.0 + * @param array $theme_options Theme options. + * @param array $used_elements Used Elements array. + * @param array $widget_options Widget options. + * @return array + */ +function astra_above_header_builder_migration( $theme_options, $used_elements, $widget_options ) { + /** + * Above Header. + */ + + $above_header_layout = ( isset( $theme_options['above-header-layout'] ) ) ? $theme_options['above-header-layout'] : ''; + $above_header_on_mobile = ( isset( $theme_options['above-header-on-mobile'] ) ) ? $theme_options['above-header-on-mobile'] : ''; + $above_header_merge_menu = ( isset( $theme_options['above-header-merge-menu'] ) ) ? $theme_options['above-header-merge-menu'] : ''; + $above_header_swap_mobile = ( isset( $theme_options['above-header-swap-mobile'] ) ) ? $theme_options['above-header-swap-mobile'] : ''; + + if ( isset( $theme_options['above-header-height'] ) ) { + $theme_options['hba-header-height'] = array( + 'desktop' => $theme_options['above-header-height'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['above-header-divider'] ) ) { + $theme_options['hba-header-separator'] = $theme_options['above-header-divider']; + } + if ( isset( $theme_options['above-header-divider-color'] ) ) { + $theme_options['hba-header-bottom-border-color'] = $theme_options['above-header-divider-color']; + } + if ( isset( $theme_options['above-header-bg-obj-responsive'] ) ) { + $theme_options['hba-header-bg-obj-responsive'] = $theme_options['above-header-bg-obj-responsive']; + } + if ( isset( $theme_options['above-header-spacing'] ) ) { + $theme_options['section-above-header-builder-padding'] = $theme_options['above-header-spacing']; + } + // Above Header Section 1. + $above_header_section_1 = ( isset( $theme_options['above-header-section-1'] ) ) ? $theme_options['above-header-section-1'] : ''; + $new_above_header_section_1_item = ''; + + switch ( $above_header_section_1 ) { + case 'menu': + $new_above_header_section_1_item = 'menu-3'; + break; + + case 'search': + if ( ! in_array( 'search', $used_elements ) ) { + $new_above_header_section_1_item = 'search'; + if ( isset( $theme_options['above-header-section-1-search-box-type'] ) ) { + $theme_options['header-search-box-type'] = $theme_options['above-header-section-1-search-box-type']; + } + } + break; + + case 'text-html': + if ( ! in_array( 'html-3', $used_elements ) ) { + $new_above_header_section_1_item = 'html-3'; + if ( isset( $theme_options['above-header-section-1-html'] ) ) { + $theme_options['header-html-3'] = $theme_options['above-header-section-1-html']; + } + } + + break; + + case 'widget': + if ( ! in_array( 'widget-3', $used_elements ) ) { + $new_above_header_section_1_item = 'widget-3'; + if ( isset( $widget_options['above-header-widget-1'] ) ) { + $widget_options['header-widget-3'] = $widget_options['above-header-widget-1']; + } + } + break; + + case 'woocommerce': + if ( ! in_array( 'woo-cart', $used_elements ) ) { + $new_above_header_section_1_item = 'woo-cart'; + } + break; + + case 'edd': + if ( ! in_array( 'edd-cart', $used_elements ) ) { + $new_above_header_section_1_item = 'edd-cart'; + } + break; + } + + // Above Header Section 2. + $above_header_section_2 = ( isset( $theme_options['above-header-section-2'] ) ) ? $theme_options['above-header-section-2'] : ''; + $new_above_header_section_2_item = ''; + switch ( $above_header_section_2 ) { + case 'menu': + $new_above_header_section_2_item = 'menu-3'; + break; + + case 'search': + if ( ! in_array( 'search', $used_elements ) ) { + $new_above_header_section_2_item = 'search'; + if ( isset( $theme_options['above-header-section-2-search-box-type'] ) ) { + $theme_options['header-search-box-type'] = $theme_options['above-header-section-2-search-box-type']; + } + } + break; + + case 'text-html': + if ( ! in_array( 'html-3', $used_elements ) ) { + $new_above_header_section_2_item = 'html-3'; + if ( isset( $theme_options['above-header-section-2-html'] ) ) { + $theme_options['header-html-3'] = $theme_options['above-header-section-2-html']; + } + } + + break; + + case 'widget': + if ( ! in_array( 'widget-3', $used_elements ) ) { + $new_above_header_section_2_item = 'widget-3'; + if ( isset( $widget_options['above-header-widget-2'] ) ) { + $widget_options['header-widget-3'] = $widget_options['above-header-widget-2']; + } + } + break; + + case 'woocommerce': + if ( ! in_array( 'woo-cart', $used_elements ) ) { + $new_above_header_section_2_item = 'woo-cart'; + } + break; + + case 'edd': + if ( ! in_array( 'edd-cart', $used_elements ) ) { + $new_above_header_section_2_item = 'edd-cart'; + } + break; + } + + if ( 'menu' === $above_header_section_1 || 'menu' === $above_header_section_2 ) { + $theme_options['header-menu3-menu-stack-on-mobile'] = false; + /** + * Menu - 3 + */ + if ( isset( $theme_options['above-header-submenu-container-animation'] ) ) { + $theme_options['header-menu3-submenu-container-animation'] = $theme_options['above-header-submenu-container-animation']; + } + if ( isset( $theme_options['above-header-submenu-border'] ) ) { + $theme_options['header-menu3-submenu-border'] = $theme_options['above-header-submenu-border']; + } + if ( isset( $theme_options['above-header-submenu-b-color'] ) ) { + $theme_options['header-menu3-submenu-b-color'] = $theme_options['above-header-submenu-b-color']; + } + if ( isset( $theme_options['above-header-submenu-item-border'] ) ) { + $theme_options['header-menu3-submenu-item-border'] = $theme_options['above-header-submenu-item-border']; + } + if ( isset( $theme_options['above-header-submenu-item-b-color'] ) ) { + $theme_options['header-menu3-submenu-item-b-color'] = $theme_options['above-header-submenu-item-b-color']; + } + + if ( isset( $theme_options['above-header-menu-text-color-responsive'] ) ) { + $theme_options['header-menu3-color-responsive'] = $theme_options['above-header-menu-text-color-responsive']; + } + if ( isset( $theme_options['above-header-menu-bg-obj-responsive'] ) ) { + $theme_options['header-menu3-bg-obj-responsive'] = $theme_options['above-header-menu-bg-obj-responsive']; + } + + if ( isset( $theme_options['above-header-menu-text-hover-color-responsive'] ) ) { + $theme_options['header-menu3-h-color-responsive'] = $theme_options['above-header-menu-text-hover-color-responsive']; + } + if ( isset( $theme_options['above-header-menu-bg-hover-color-responsive'] ) ) { + $theme_options['header-menu3-h-bg-color-responsive'] = $theme_options['above-header-menu-bg-hover-color-responsive']; + } + + if ( isset( $theme_options['above-header-current-menu-text-color-responsive'] ) ) { + $theme_options['header-menu3-a-color-responsive'] = $theme_options['above-header-current-menu-text-color-responsive']; + } + if ( isset( $theme_options['above-header-current-menu-bg-color-responsive'] ) ) { + $theme_options['header-menu3-a-bg-color-responsive'] = $theme_options['above-header-current-menu-bg-color-responsive']; + } + + if ( isset( $theme_options['above-header-font-size'] ) ) { + $theme_options['header-menu3-font-size'] = $theme_options['above-header-font-size']; + } + if ( isset( $theme_options['above-header-font-weight'] ) ) { + $theme_options['header-menu3-font-weight'] = $theme_options['above-header-font-weight']; + } + if ( isset( $theme_options['above-header-line-height'] ) ) { + $theme_options['header-menu3-line-height'] = $theme_options['above-header-line-height']; + } + if ( isset( $theme_options['above-header-font-family'] ) ) { + $theme_options['header-menu3-font-family'] = $theme_options['above-header-font-family']; + } + if ( isset( $theme_options['above-header-text-transform'] ) ) { + $theme_options['header-menu3-text-transform'] = $theme_options['above-header-text-transform']; + } + + if ( isset( $theme_options['above-header-menu-spacing'] ) ) { + $theme_options['header-menu3-menu-spacing'] = $theme_options['above-header-menu-spacing']; + } + + // Menu 3 - Submenu. + if ( isset( $theme_options['above-header-submenu-text-color-responsive'] ) ) { + $theme_options['header-menu3-submenu-color-responsive'] = $theme_options['above-header-submenu-text-color-responsive']; + } + if ( isset( $theme_options['above-header-submenu-bg-color-responsive'] ) ) { + $theme_options['header-menu3-submenu-bg-color-responsive'] = $theme_options['above-header-submenu-bg-color-responsive']; + } + + if ( isset( $theme_options['above-header-submenu-hover-color-responsive'] ) ) { + $theme_options['header-menu3-submenu-h-color-responsive'] = $theme_options['above-header-submenu-hover-color-responsive']; + } + if ( isset( $theme_options['above-header-submenu-bg-hover-color-responsive'] ) ) { + $theme_options['header-menu3-submenu-h-bg-color-responsive'] = $theme_options['above-header-submenu-bg-hover-color-responsive']; + } + + if ( isset( $theme_options['above-header-submenu-active-color-responsive'] ) ) { + $theme_options['header-menu3-submenu-a-color-responsive'] = $theme_options['above-header-submenu-active-color-responsive']; + } + if ( isset( $theme_options['above-header-submenu-active-bg-color-responsive'] ) ) { + $theme_options['header-menu3-submenu-a-bg-color-responsive'] = $theme_options['above-header-submenu-active-bg-color-responsive']; + } + + if ( isset( $theme_options['font-size-above-header-dropdown-menu'] ) ) { + $theme_options['header-font-size-menu3-sub-menu'] = $theme_options['font-size-above-header-dropdown-menu']; + } + if ( isset( $theme_options['font-weight-above-header-dropdown-menu'] ) ) { + $theme_options['header-font-weight-menu3-sub-menu'] = $theme_options['font-weight-above-header-dropdown-menu']; + } + if ( isset( $theme_options['line-height-above-header-dropdown-menu'] ) ) { + $theme_options['header-line-height-menu3-sub-menu'] = $theme_options['line-height-above-header-dropdown-menu']; + } + if ( isset( $theme_options['font-family-above-header-dropdown-menu'] ) ) { + $theme_options['header-font-family-menu3-sub-menu'] = $theme_options['font-family-above-header-dropdown-menu']; + } + if ( isset( $theme_options['text-transform-above-header-dropdown-menu'] ) ) { + $theme_options['header-text-transform-menu3-sub-menu'] = $theme_options['text-transform-above-header-dropdown-menu']; + } + + if ( isset( $theme_options['above-header-submenu-spacing'] ) ) { + $theme_options['header-menu3-submenu-spacing'] = $theme_options['above-header-submenu-spacing']; + } + } + + if ( 'search' === $above_header_section_1 || 'search' === $above_header_section_2 ) { + if ( isset( $theme_options['above-header-text-color-responsive'] ) ) { + $theme_options['header-search-icon-color'] = $theme_options['above-header-text-color-responsive']; + } + } + + if ( 'text-html' === $above_header_section_1 || 'text-html' === $above_header_section_2 ) { + if ( isset( $theme_options['above-header-text-color-responsive'] ) ) { + $theme_options['header-html-3color'] = $theme_options['above-header-text-color-responsive']; + } + if ( isset( $theme_options['above-header-link-color-responsive'] ) ) { + $theme_options['header-html-3link-color'] = $theme_options['above-header-link-color-responsive']; + } + if ( isset( $theme_options['above-header-link-hover-color-responsive'] ) ) { + $theme_options['header-html-3link-h-color'] = $theme_options['above-header-link-hover-color-responsive']; + } + if ( isset( $theme_options['font-size-above-header-content'] ) ) { + $theme_options['font-size-section-hb-html-3'] = $theme_options['font-size-above-header-content']; + } + if ( isset( $theme_options['font-weight-above-header-content'] ) ) { + $theme_options['font-weight-section-hb-html-3'] = $theme_options['font-weight-above-header-content']; + } + if ( isset( $theme_options['line-height-above-header-content'] ) ) { + $theme_options['line-height-section-hb-html-3'] = $theme_options['line-height-above-header-content']; + } + if ( isset( $theme_options['font-family-above-header-content'] ) ) { + $theme_options['font-family-section-hb-html-3'] = $theme_options['font-family-above-header-content']; + } + if ( isset( $theme_options['text-transform-above-header-content'] ) ) { + $theme_options['text-transform-section-hb-html-3'] = $theme_options['text-transform-above-header-content']; + } + } + + if ( 'widget' === $above_header_section_1 || 'widget' === $above_header_section_2 ) { + if ( isset( $theme_options['above-header-text-color-responsive'] ) ) { + $theme_options['header-widget-3-color'] = $theme_options['above-header-text-color-responsive']; + $theme_options['header-widget-3-title-color'] = $theme_options['above-header-text-color-responsive']; + } + if ( isset( $theme_options['above-header-link-color-responsive'] ) ) { + $theme_options['header-widget-3-link-color'] = $theme_options['above-header-link-color-responsive']; + } + if ( isset( $theme_options['above-header-link-hover-color-responsive'] ) ) { + $theme_options['header-widget-3-link-h-color'] = $theme_options['above-header-link-hover-color-responsive']; + } + if ( isset( $theme_options['font-size-above-header-content'] ) ) { + $theme_options['header-widget-3-content-font-size'] = $theme_options['font-size-above-header-content']; + } + if ( isset( $theme_options['font-weight-above-header-content'] ) ) { + $theme_options['header-widget-3-content-font-weight'] = $theme_options['font-weight-above-header-content']; + } + if ( isset( $theme_options['line-height-above-header-content'] ) ) { + $theme_options['header-widget-3-content-line-height'] = $theme_options['line-height-above-header-content']; + } + if ( isset( $theme_options['font-family-above-header-content'] ) ) { + $theme_options['header-widget-3-content-font-family'] = $theme_options['font-family-above-header-content']; + } + if ( isset( $theme_options['text-transform-above-header-content'] ) ) { + $theme_options['header-widget-3-content-text-transform'] = $theme_options['text-transform-above-header-content']; + } + } + + switch ( $above_header_layout ) { + + case 'above-header-layout-1': + $theme_options['header-desktop-items']['above'] = array( + 'above_left' => ( '' !== $new_above_header_section_1_item ) ? array( $new_above_header_section_1_item ) : array(), + 'above_left_center' => array(), + 'above_center' => array(), + 'above_right_center' => array(), + 'above_right' => ( '' !== $new_above_header_section_2_item ) ? array( $new_above_header_section_2_item ) : array(), + ); + break; + + case 'above-header-layout-2': + $theme_options['header-desktop-items']['above'] = array( + 'above_left' => array(), + 'above_left_center' => array(), + 'above_center' => ( '' !== $new_above_header_section_1_item ) ? array( $new_above_header_section_1_item ) : array(), + 'above_right_center' => array(), + 'above_right' => array(), + ); + break; + } + + if ( $above_header_on_mobile ) { + + if ( $above_header_swap_mobile && ( 'menu' === $above_header_section_1 || 'menu' === $above_header_section_2 ) ) { + $temp = $new_above_header_section_1_item; + $new_above_header_section_1_item = $new_above_header_section_2_item; + $new_above_header_section_2_item = $temp; + } + + if ( $above_header_merge_menu && ( 'menu' === $above_header_section_1 || 'menu' === $above_header_section_2 ) ) { + if ( '' !== $new_above_header_section_1_item ) { + $theme_options['header-mobile-items']['popup']['popup_content'][] = $new_above_header_section_1_item; + } + if ( '' !== $new_above_header_section_2_item ) { + $theme_options['header-mobile-items']['popup']['popup_content'][] = $new_above_header_section_2_item; + } + $theme_options['header-menu3-menu-stack-on-mobile'] = true; + $theme_options['header-mobile-items']['above'] = array( + 'above_left' => array(), + 'above_center' => array(), + 'above_right' => array(), + ); + } else { + switch ( $above_header_layout ) { + + case 'above-header-layout-1': + $theme_options['header-mobile-items']['above'] = array( + 'above_left' => ( '' !== $new_above_header_section_1_item ) ? array( $new_above_header_section_1_item ) : array(), + 'above_center' => array(), + 'above_right' => ( '' !== $new_above_header_section_2_item ) ? array( $new_above_header_section_2_item ) : array(), + ); + break; + + case 'above-header-layout-2': + $theme_options['header-mobile-items']['above'] = array( + 'above_left' => array(), + 'above_center' => ( '' !== $new_above_header_section_1_item ) ? array( $new_above_header_section_1_item ) : array(), + 'above_right' => array(), + ); + break; + } + } + } + + return array( + 'theme_options' => $theme_options, + 'used_elements' => $used_elements, + 'widget_options' => $widget_options, + ); + +} + +/** + * Header Footer builder - Migration of Below Header. + * + * @since 3.0.0 + * @param array $theme_options Theme options. + * @param array $used_elements Used Elements array. + * @param array $widget_options Widget options. + * @return array + */ +function astra_below_header_builder_migration( $theme_options, $used_elements, $widget_options ) { + /** + * Below Header + */ + + $below_header_layout = ( isset( $theme_options['below-header-layout'] ) ) ? $theme_options['below-header-layout'] : ''; + $below_header_on_mobile = ( isset( $theme_options['below-header-on-mobile'] ) ) ? $theme_options['below-header-on-mobile'] : ''; + $below_header_merge_menu = ( isset( $theme_options['below-header-merge-menu'] ) ) ? $theme_options['below-header-merge-menu'] : ''; + $below_header_swap_mobile = ( isset( $theme_options['below-header-swap-mobile'] ) ) ? $theme_options['below-header-swap-mobile'] : ''; + + if ( isset( $theme_options['below-header-height'] ) ) { + $theme_options['hbb-header-height'] = array( + 'desktop' => $theme_options['below-header-height'], + 'tablet' => '', + 'mobile' => '', + ); + } + + if ( isset( $theme_options['below-header-divider'] ) ) { + $theme_options['hbb-header-separator'] = $theme_options['below-header-divider']; + } + if ( isset( $theme_options['below-header-divider-color'] ) ) { + $theme_options['hbb-header-bottom-border-color'] = $theme_options['below-header-divider-color']; + } + if ( isset( $theme_options['below-header-bg-obj-responsive'] ) ) { + $theme_options['hbb-header-bg-obj-responsive'] = $theme_options['below-header-bg-obj-responsive']; + } + if ( isset( $theme_options['below-header-spacing'] ) ) { + $theme_options['section-below-header-builder-padding'] = $theme_options['below-header-spacing']; + } + // Below Header Section 1. + $below_header_section_1 = ( isset( $theme_options['below-header-section-1'] ) ) ? $theme_options['below-header-section-1'] : ''; + $new_below_header_section_1_item = ''; + switch ( $below_header_section_1 ) { + case 'menu': + $new_below_header_section_1_item = 'menu-2'; + break; + + case 'search': + if ( ! in_array( 'search', $used_elements ) ) { + $new_below_header_section_1_item = 'search'; + if ( isset( $theme_options['below-header-section-1-search-box-type'] ) ) { + $theme_options['header-search-box-type'] = $theme_options['below-header-section-1-search-box-type']; + } + } + break; + + case 'text-html': + if ( ! in_array( 'html-2', $used_elements ) ) { + $new_below_header_section_1_item = 'html-2'; + if ( isset( $theme_options['below-header-section-1-html'] ) ) { + $theme_options['header-html-2'] = $theme_options['below-header-section-1-html']; + } + } + + break; + + case 'widget': + if ( ! in_array( 'widget-2', $used_elements ) ) { + $new_below_header_section_1_item = 'widget-2'; + if ( isset( $widget_options['below-header-widget-1'] ) ) { + $widget_options['header-widget-2'] = $widget_options['below-header-widget-1']; + } + } + break; + + case 'woocommerce': + if ( ! in_array( 'woo-cart', $used_elements ) ) { + $new_below_header_section_1_item = 'woo-cart'; + } + break; + + case 'edd': + if ( ! in_array( 'edd-cart', $used_elements ) ) { + $new_below_header_section_1_item = 'edd-cart'; + } + break; + } + + // Below Header Section 2. + $below_header_section_2 = ( isset( $theme_options['below-header-section-2'] ) ) ? $theme_options['below-header-section-2'] : ''; + $new_below_header_section_2_item = ''; + switch ( $below_header_section_2 ) { + case 'menu': + $new_below_header_section_2_item = 'menu-2'; + break; + + case 'search': + if ( ! in_array( 'search', $used_elements ) ) { + $new_below_header_section_2_item = 'search'; + if ( isset( $theme_options['below-header-section-2-search-box-type'] ) ) { + $theme_options['header-search-box-type'] = $theme_options['below-header-section-2-search-box-type']; + } + } + break; + + case 'text-html': + if ( ! in_array( 'html-2', $used_elements ) ) { + $new_below_header_section_2_item = 'html-2'; + if ( isset( $theme_options['below-header-section-2-html'] ) ) { + $theme_options['header-html-2'] = $theme_options['below-header-section-2-html']; + } + } + break; + + case 'widget': + if ( ! in_array( 'widget-2', $used_elements ) ) { + $new_below_header_section_2_item = 'widget-2'; + if ( isset( $widget_options['below-header-widget-2'] ) ) { + $widget_options['header-widget-2'] = $widget_options['below-header-widget-2']; + } + } + break; + + case 'woocommerce': + if ( ! in_array( 'woo-cart', $used_elements ) ) { + $new_below_header_section_2_item = 'woo-cart'; + } + break; + + case 'edd': + if ( ! in_array( 'edd-cart', $used_elements ) ) { + $new_below_header_section_2_item = 'edd-cart'; + } + break; + } + + if ( 'menu' === $below_header_section_1 || 'menu' === $below_header_section_2 ) { + $theme_options['header-menu2-menu-stack-on-mobile'] = false; + /** + * Menu - 2 + */ + if ( isset( $theme_options['below-header-submenu-container-animation'] ) ) { + $theme_options['header-menu2-submenu-container-animation'] = $theme_options['below-header-submenu-container-animation']; + } + if ( isset( $theme_options['below-header-submenu-border'] ) ) { + $theme_options['header-menu2-submenu-border'] = $theme_options['below-header-submenu-border']; + } + if ( isset( $theme_options['below-header-submenu-b-color'] ) ) { + $theme_options['header-menu2-submenu-b-color'] = $theme_options['below-header-submenu-b-color']; + } + if ( isset( $theme_options['below-header-submenu-item-border'] ) ) { + $theme_options['header-menu2-submenu-item-border'] = $theme_options['below-header-submenu-item-border']; + } + if ( isset( $theme_options['below-header-submenu-item-b-color'] ) ) { + $theme_options['header-menu2-submenu-item-b-color'] = $theme_options['below-header-submenu-item-b-color']; + } + + if ( isset( $theme_options['below-header-menu-text-color-responsive'] ) ) { + $theme_options['header-menu2-color-responsive'] = $theme_options['below-header-menu-text-color-responsive']; + } + if ( isset( $theme_options['below-header-menu-bg-obj-responsive'] ) ) { + $theme_options['header-menu2-bg-obj-responsive'] = $theme_options['below-header-menu-bg-obj-responsive']; + } + + if ( isset( $theme_options['below-header-menu-text-hover-color-responsive'] ) ) { + $theme_options['header-menu2-h-color-responsive'] = $theme_options['below-header-menu-text-hover-color-responsive']; + } + if ( isset( $theme_options['below-header-menu-bg-hover-color-responsive'] ) ) { + $theme_options['header-menu2-h-bg-color-responsive'] = $theme_options['below-header-menu-bg-hover-color-responsive']; + } + + if ( isset( $theme_options['below-header-current-menu-text-color-responsive'] ) ) { + $theme_options['header-menu2-a-color-responsive'] = $theme_options['below-header-current-menu-text-color-responsive']; + } + if ( isset( $theme_options['below-header-current-menu-bg-color-responsive'] ) ) { + $theme_options['header-menu2-a-bg-color-responsive'] = $theme_options['below-header-current-menu-bg-color-responsive']; + } + + if ( isset( $theme_options['below-header-font-size'] ) ) { + $theme_options['header-menu2-font-size'] = $theme_options['below-header-font-size']; + } + if ( isset( $theme_options['below-header-font-weight'] ) ) { + $theme_options['header-menu2-font-weight'] = $theme_options['below-header-font-weight']; + } + if ( isset( $theme_options['below-header-line-height'] ) ) { + $theme_options['header-menu2-line-height'] = $theme_options['below-header-line-height']; + } + if ( isset( $theme_options['below-header-font-family'] ) ) { + $theme_options['header-menu2-font-family'] = $theme_options['below-header-font-family']; + } + if ( isset( $theme_options['below-header-text-transform'] ) ) { + $theme_options['header-menu2-text-transform'] = $theme_options['below-header-text-transform']; + } + + if ( isset( $theme_options['below-header-menu-spacing'] ) ) { + $theme_options['header-menu2-menu-spacing'] = $theme_options['below-header-menu-spacing']; + } + + // Menu 2 - Submenu. + if ( isset( $theme_options['below-header-submenu-text-color-responsive'] ) ) { + $theme_options['header-menu2-submenu-color-responsive'] = $theme_options['below-header-submenu-text-color-responsive']; + } + if ( isset( $theme_options['below-header-submenu-bg-color-responsive'] ) ) { + $theme_options['header-menu2-submenu-bg-color-responsive'] = $theme_options['below-header-submenu-bg-color-responsive']; + } + + if ( isset( $theme_options['below-header-submenu-hover-color-responsive'] ) ) { + $theme_options['header-menu2-submenu-h-color-responsive'] = $theme_options['below-header-submenu-hover-color-responsive']; + } + if ( isset( $theme_options['below-header-submenu-bg-hover-color-responsive'] ) ) { + $theme_options['header-menu2-submenu-h-bg-color-responsive'] = $theme_options['below-header-submenu-bg-hover-color-responsive']; + } + + if ( isset( $theme_options['below-header-submenu-active-color-responsive'] ) ) { + $theme_options['header-menu2-submenu-a-color-responsive'] = $theme_options['below-header-submenu-active-color-responsive']; + } + if ( isset( $theme_options['below-header-submenu-active-bg-color-responsive'] ) ) { + $theme_options['header-menu2-submenu-a-bg-color-responsive'] = $theme_options['below-header-submenu-active-bg-color-responsive']; + } + + if ( isset( $theme_options['font-size-below-header-dropdown-menu'] ) ) { + $theme_options['header-font-size-menu2-sub-menu'] = $theme_options['font-size-below-header-dropdown-menu']; + } + if ( isset( $theme_options['font-weight-below-header-dropdown-menu'] ) ) { + $theme_options['header-font-weight-menu2-sub-menu'] = $theme_options['font-weight-below-header-dropdown-menu']; + } + if ( isset( $theme_options['line-height-below-header-dropdown-menu'] ) ) { + $theme_options['header-line-height-menu2-sub-menu'] = $theme_options['line-height-below-header-dropdown-menu']; + } + if ( isset( $theme_options['font-family-below-header-dropdown-menu'] ) ) { + $theme_options['header-font-family-menu2-sub-menu'] = $theme_options['font-family-below-header-dropdown-menu']; + } + if ( isset( $theme_options['text-transform-below-header-dropdown-menu'] ) ) { + $theme_options['header-text-transform-menu2-sub-menu'] = $theme_options['text-transform-below-header-dropdown-menu']; + } + + if ( isset( $theme_options['below-header-submenu-spacing'] ) ) { + $theme_options['header-menu2-submenu-spacing'] = $theme_options['below-header-submenu-spacing']; + } + } + + if ( 'search' === $below_header_section_1 || 'search' === $below_header_section_2 ) { + if ( isset( $theme_options['below-header-text-color-responsive'] ) ) { + $theme_options['header-search-icon-color'] = $theme_options['below-header-text-color-responsive']; + } + } + + if ( 'text-html' === $below_header_section_1 || 'text-html' === $below_header_section_2 ) { + if ( isset( $theme_options['below-header-text-color-responsive'] ) ) { + $theme_options['header-html-2color'] = $theme_options['below-header-text-color-responsive']; + } + if ( isset( $theme_options['below-header-link-color-responsive'] ) ) { + $theme_options['header-html-2link-color'] = $theme_options['below-header-link-color-responsive']; + } + if ( isset( $theme_options['below-header-link-hover-color-responsive'] ) ) { + $theme_options['header-html-2link-h-color'] = $theme_options['below-header-link-hover-color-responsive']; + } + if ( isset( $theme_options['font-size-below-header-content'] ) ) { + $theme_options['font-size-section-hb-html-2'] = $theme_options['font-size-below-header-content']; + } + if ( isset( $theme_options['font-weight-below-header-content'] ) ) { + $theme_options['font-weight-section-hb-html-2'] = $theme_options['font-weight-below-header-content']; + } + if ( isset( $theme_options['line-height-below-header-content'] ) ) { + $theme_options['line-height-section-hb-html-2'] = $theme_options['line-height-below-header-content']; + } + if ( isset( $theme_options['font-family-below-header-content'] ) ) { + $theme_options['font-family-section-hb-html-2'] = $theme_options['font-family-below-header-content']; + } + if ( isset( $theme_options['text-transform-below-header-content'] ) ) { + $theme_options['text-transform-section-hb-html-2'] = $theme_options['text-transform-below-header-content']; + } + } + + if ( 'widget' === $below_header_section_1 || 'widget' === $below_header_section_2 ) { + if ( isset( $theme_options['below-header-text-color-responsive'] ) ) { + $theme_options['header-widget-2-color'] = $theme_options['below-header-text-color-responsive']; + $theme_options['header-widget-2-title-color'] = $theme_options['below-header-text-color-responsive']; + } + if ( isset( $theme_options['below-header-link-color-responsive'] ) ) { + $theme_options['header-widget-2-link-color'] = $theme_options['below-header-link-color-responsive']; + } + if ( isset( $theme_options['below-header-link-hover-color-responsive'] ) ) { + $theme_options['header-widget-2-link-h-color'] = $theme_options['below-header-link-hover-color-responsive']; + } + if ( isset( $theme_options['font-size-below-header-content'] ) ) { + $theme_options['header-widget-2-content-font-size'] = $theme_options['font-size-below-header-content']; + } + if ( isset( $theme_options['font-weight-below-header-content'] ) ) { + $theme_options['header-widget-2-content-font-weight'] = $theme_options['font-weight-below-header-content']; + } + if ( isset( $theme_options['line-height-below-header-content'] ) ) { + $theme_options['header-widget-2-content-line-height'] = $theme_options['line-height-below-header-content']; + } + if ( isset( $theme_options['font-family-below-header-content'] ) ) { + $theme_options['header-widget-2-content-font-family'] = $theme_options['font-family-below-header-content']; + } + if ( isset( $theme_options['text-transform-below-header-content'] ) ) { + $theme_options['header-widget-2-content-text-transform'] = $theme_options['text-transform-below-header-content']; + } + } + + switch ( $below_header_layout ) { + + case 'below-header-layout-1': + $theme_options['header-desktop-items']['below'] = array( + 'below_left' => ( '' !== $new_below_header_section_1_item ) ? array( $new_below_header_section_1_item ) : array(), + 'below_left_center' => array(), + 'below_center' => array(), + 'below_right_center' => array(), + 'below_right' => ( '' !== $new_below_header_section_2_item ) ? array( $new_below_header_section_2_item ) : array(), + ); + break; + + case 'below-header-layout-2': + $theme_options['header-desktop-items']['below'] = array( + 'below_left' => array(), + 'below_left_center' => array(), + 'below_center' => ( '' !== $new_below_header_section_1_item ) ? array( $new_below_header_section_1_item ) : array(), + 'below_right_center' => array(), + 'below_right' => array(), + ); + break; + } + + if ( $below_header_on_mobile ) { + + if ( $below_header_swap_mobile && ( 'menu' === $below_header_section_1 || 'menu' === $below_header_section_2 ) ) { + $temp = $new_below_header_section_1_item; + $new_below_header_section_1_item = $new_below_header_section_2_item; + $new_below_header_section_2_item = $temp; + } + + if ( $below_header_merge_menu && ( 'menu' === $below_header_section_1 || 'menu' === $below_header_section_2 ) ) { + if ( '' !== $new_below_header_section_1_item ) { + $theme_options['header-mobile-items']['popup']['popup_content'][] = $new_below_header_section_1_item; + } + if ( '' !== $new_below_header_section_2_item ) { + $theme_options['header-mobile-items']['popup']['popup_content'][] = $new_below_header_section_2_item; + } + $theme_options['header-menu2-menu-stack-on-mobile'] = true; + $theme_options['header-mobile-items']['below'] = array( + 'below_left' => array(), + 'below_center' => array(), + 'below_right' => array(), + ); + } else { + switch ( $below_header_layout ) { + + case 'below-header-layout-1': + $theme_options['header-mobile-items']['below'] = array( + 'below_left' => ( '' !== $new_below_header_section_1_item ) ? array( $new_below_header_section_1_item ) : array(), + 'below_center' => array(), + 'below_right' => ( '' !== $new_below_header_section_2_item ) ? array( $new_below_header_section_2_item ) : array(), + ); + break; + + case 'below-header-layout-2': + $theme_options['header-mobile-items']['below'] = array( + 'below_left' => array(), + 'below_center' => ( '' !== $new_below_header_section_1_item ) ? array( $new_below_header_section_1_item ) : array(), + 'below_right' => array(), + ); + break; + } + } + } + + return array( + 'theme_options' => $theme_options, + 'used_elements' => $used_elements, + 'widget_options' => $widget_options, + ); +} + +/** + * Header Footer builder - Migration of Footer. + * + * @since 3.0.0 + * @param array $theme_options Theme options. + * @param array $used_elements Used Elements array. + * @param array $widget_options Widget options. + * @return array + */ +function astra_footer_builder_migration( $theme_options, $used_elements, $widget_options ) { + /** + * Footer + */ + $footer_layout = ( isset( $theme_options['footer-sml-layout'] ) ) ? $theme_options['footer-sml-layout'] : ''; + + if ( isset( $theme_options['footer-layout-width'] ) ) { + $theme_options['hb-footer-layout-width'] = $theme_options['footer-layout-width']; + } + if ( isset( $theme_options['footer-sml-divider'] ) ) { + $theme_options['hbb-footer-separator'] = $theme_options['footer-sml-divider']; + } + if ( isset( $theme_options['footer-sml-divider-color'] ) ) { + $theme_options['hbb-footer-top-border-color'] = $theme_options['footer-sml-divider-color']; + } + if ( isset( $theme_options['footer-bg-obj'] ) ) { + $theme_options['hbb-footer-bg-obj-responsive'] = array( + 'desktop' => $theme_options['footer-bg-obj'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['footer-sml-spacing'] ) ) { + $theme_options['section-below-footer-builder-padding'] = $theme_options['footer-sml-spacing']; + } + + // Footer Section 1. + $footer_section_1 = ( isset( $theme_options['footer-sml-section-1'] ) ) ? $theme_options['footer-sml-section-1'] : ''; + $new_section_1_item = ''; + $used_elements[] = $new_section_1_item; + + $footer_section_2 = ( isset( $theme_options['footer-sml-section-2'] ) ) ? $theme_options['footer-sml-section-2'] : ''; + $new_section_2_item = ''; + $used_elements[] = $new_section_2_item; + + switch ( $footer_section_1 ) { + case 'custom': + $new_section_1_item = 'copyright'; + $theme_options['footer-copyright-alignment'] = array( + 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'left', + 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'left', + 'mobile' => 'center', + ); + break; + + case 'widget': + $new_section_1_item = 'widget-1'; + $theme_options['footer-widget-alignment-1'] = array( + 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'left', + 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'left', + 'mobile' => 'center', + ); + if ( isset( $theme_options['footer-color'] ) ) { + $theme_options['footer-widget-1-color'] = array( + 'desktop' => $theme_options['footer-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['footer-link-color'] ) ) { + $theme_options['footer-widget-1-link-color'] = array( + 'desktop' => $theme_options['footer-link-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['footer-link-h-color'] ) ) { + $theme_options['footer-widget-1-link-h-color'] = array( + 'desktop' => $theme_options['footer-link-h-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + + if ( isset( $theme_options['font-size-footer-content'] ) ) { + $theme_options['footer-widget-1-content-font-size'] = $theme_options['font-size-footer-content']; + } + + if ( isset( $theme_options['font-weight-footer-content'] ) ) { + $theme_options['footer-widget-1-content-font-weight'] = $theme_options['font-weight-footer-content']; + } + + if ( isset( $theme_options['line-height-footer-content'] ) ) { + $theme_options['footer-widget-1-content-line-height'] = $theme_options['line-height-footer-content']; + } + + if ( isset( $theme_options['font-family-footer-content'] ) ) { + $theme_options['footer-widget-1-content-font-family'] = $theme_options['font-family-footer-content']; + } + + if ( isset( $theme_options['text-transform-footer-content'] ) ) { + $theme_options['footer-widget-1-content-text-transform'] = $theme_options['text-transform-footer-content']; + } + + + break; + + case 'menu': + $theme_options['footer-menu-alignment'] = array( + 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'flex-start', + 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'flex-start', + 'mobile' => 'center', + ); + $new_section_1_item = 'menu'; + break; + } + + // Footer Section 2. + switch ( $footer_section_2 ) { + case 'custom': + $new_section_2_item = ( 'copyright' !== $new_section_1_item ) ? 'copyright' : 'html-1'; + if ( 'copyright' !== $new_section_1_item ) { + $theme_options['footer-copyright-alignment'] = array( + 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', + 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', + 'mobile' => 'center', + ); + if ( isset( $theme_options['footer-sml-section-2-credit'] ) ) { + $theme_options['footer-copyright-editor'] = $theme_options['footer-sml-section-2-credit']; + } + } else { + $theme_options['footer-html-1-alignment'] = array( + 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', + 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', + 'mobile' => 'center', + ); + if ( isset( $theme_options['footer-sml-section-2-credit'] ) ) { + $theme_options['footer-html-1'] = $theme_options['footer-sml-section-2-credit']; + } + } + + break; + + case 'widget': + $new_section_2_item = 'widget-2'; + $theme_options['footer-widget-alignment-2'] = array( + 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', + 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'right', + 'mobile' => 'center', + ); + if ( isset( $theme_options['footer-color'] ) ) { + $theme_options['footer-widget-2-color'] = array( + 'desktop' => $theme_options['footer-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['footer-link-color'] ) ) { + $theme_options['footer-widget-2-link-color'] = array( + 'desktop' => $theme_options['footer-link-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['footer-link-h-color'] ) ) { + $theme_options['footer-widget-2-link-h-color'] = array( + 'desktop' => $theme_options['footer-link-h-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + + if ( isset( $theme_options['font-size-footer-content'] ) ) { + $theme_options['footer-widget-2-content-font-size'] = $theme_options['font-size-footer-content']; + } + + if ( isset( $theme_options['font-weight-footer-content'] ) ) { + $theme_options['footer-widget-2-content-font-weight'] = $theme_options['font-weight-footer-content']; + } + + if ( isset( $theme_options['line-height-footer-content'] ) ) { + $theme_options['footer-widget-2-content-line-height'] = $theme_options['line-height-footer-content']; + } + + if ( isset( $theme_options['font-family-footer-content'] ) ) { + $theme_options['footer-widget-2-content-font-family'] = $theme_options['font-family-footer-content']; + } + + if ( isset( $theme_options['text-transform-footer-content'] ) ) { + $theme_options['footer-widget-2-content-text-transform'] = $theme_options['text-transform-footer-content']; + } + + + break; + + case 'menu': + $new_section_2_item = 'menu'; + $theme_options['footer-menu-alignment'] = array( + 'desktop' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'flex-end', + 'tablet' => ( 'footer-sml-layout-1' === $footer_layout ) ? 'center' : 'flex-end', + 'mobile' => 'center', + ); + break; + } + + if ( 'custom' === $footer_section_1 || 'custom' === $footer_section_2 ) { + + // Footer Content Color migrated to Copyright. + if ( isset( $theme_options['footer-sml-section-1-credit'] ) ) { + $theme_options['footer-copyright-editor'] = $theme_options['footer-sml-section-1-credit']; + } + if ( isset( $theme_options['footer-color'] ) ) { + $theme_options['footer-copyright-color'] = $theme_options['footer-color']; + } + if ( isset( $theme_options['footer-link-color'] ) ) { + $theme_options['footer-copyright-link-color'] = $theme_options['footer-link-color']; + } + if ( isset( $theme_options['footer-link-h-color'] ) ) { + $theme_options['footer-copyright-link-h-color'] = $theme_options['footer-link-h-color']; + } + + if ( isset( $theme_options['font-size-footer-content'] ) ) { + $theme_options['font-size-section-footer-copyright'] = $theme_options['font-size-footer-content']; + } + + if ( isset( $theme_options['font-weight-footer-content'] ) ) { + $theme_options['font-weight-section-footer-copyright'] = $theme_options['font-weight-footer-content']; + } + + if ( isset( $theme_options['line-height-footer-content'] ) ) { + $theme_options['line-height-section-footer-copyright'] = $theme_options['line-height-footer-content']; + } + + if ( isset( $theme_options['font-family-footer-content'] ) ) { + $theme_options['font-family-section-footer-copyright'] = $theme_options['font-family-footer-content']; + } + + if ( isset( $theme_options['text-transform-footer-content'] ) ) { + $theme_options['text-transform-section-footer-copyright'] = $theme_options['text-transform-footer-content']; + } + + if ( 'html-1' === $new_section_2_item ) { + // Footer Content Color migrated to HTML 1. + if ( isset( $theme_options['footer-color'] ) ) { + $theme_options['footer-html-1-color'] = array( + 'desktop' => $theme_options['footer-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['footer-link-color'] ) ) { + $theme_options['footer-html-1-link-color'] = array( + 'desktop' => $theme_options['footer-link-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['footer-link-h-color'] ) ) { + $theme_options['footer-html-1-link-h-color'] = array( + 'desktop' => $theme_options['footer-link-h-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + + if ( isset( $theme_options['font-size-footer-content'] ) ) { + $theme_options['font-size-section-fb-html-1'] = $theme_options['font-size-footer-content']; + } + + if ( isset( $theme_options['font-weight-footer-content'] ) ) { + $theme_options['font-weight-section-fb-html-1'] = $theme_options['font-weight-footer-content']; + } + + if ( isset( $theme_options['line-height-footer-content'] ) ) { + $theme_options['line-height-section-fb-html-1'] = $theme_options['line-height-footer-content']; + } + + if ( isset( $theme_options['font-family-footer-content'] ) ) { + $theme_options['font-family-section-fb-html-1'] = $theme_options['font-family-footer-content']; + } + + if ( isset( $theme_options['text-transform-footer-content'] ) ) { + $theme_options['text-transform-section-fb-html-1'] = $theme_options['text-transform-footer-content']; + } + } + } + + if ( 'menu' === $footer_section_1 || 'menu' === $footer_section_2 ) { + if ( isset( $theme_options['footer-link-color'] ) ) { + $theme_options['footer-menu-color-responsive'] = array( + 'desktop' => $theme_options['footer-link-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + if ( isset( $theme_options['footer-link-h-color'] ) ) { + $theme_options['footer-menu-h-color-responsive'] = array( + 'desktop' => $theme_options['footer-link-h-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + + $theme_options['footer-menu-layout'] = array( + 'desktop' => 'horizontal', + 'tablet' => 'horizontal', + 'mobile' => 'horizontal', + ); + + if ( isset( $theme_options['font-size-footer-content'] ) ) { + $theme_options['footer-menu-font-size'] = $theme_options['font-size-footer-content']; + } + + if ( isset( $theme_options['font-weight-footer-content'] ) ) { + $theme_options['footer-menu-font-weight'] = $theme_options['font-weight-footer-content']; + } + + if ( isset( $theme_options['line-height-footer-content'] ) ) { + $theme_options['footer-menu-line-height'] = $theme_options['line-height-footer-content']; + } + + if ( isset( $theme_options['font-family-footer-content'] ) ) { + $theme_options['footer-menu-font-family'] = $theme_options['font-family-footer-content']; + } + + if ( isset( $theme_options['text-transform-footer-content'] ) ) { + $theme_options['footer-menu-text-transform'] = $theme_options['text-transform-footer-content']; + } + + if ( isset( $theme_options['footer-menu-spacing'] ) ) { + $theme_options['footer-main-menu-spacing'] = $theme_options['footer-menu-spacing']; + } + } + + if ( '' !== $footer_layout ) { + + $theme_options['footer-desktop-items'] = array( + 'above' => + array( + 'above_1' => array(), + 'above_2' => array(), + 'above_3' => array(), + 'above_4' => array(), + 'above_5' => array(), + ), + 'primary' => + array( + 'primary_1' => array(), + 'primary_2' => array(), + 'primary_3' => array(), + 'primary_4' => array(), + 'primary_5' => array(), + ), + 'below' => + array( + 'below_1' => array(), + 'below_2' => array(), + 'below_3' => array(), + 'below_4' => array(), + 'below_5' => array(), + ), + ); + + switch ( $footer_layout ) { + case 'footer-sml-layout-1': + $theme_options['footer-desktop-items']['below'] = array( + 'below_1' => array( $new_section_1_item, $new_section_2_item ), + 'below_2' => array(), + 'below_3' => array(), + 'below_4' => array(), + 'below_5' => array(), + ); + $theme_options['hbb-footer-column'] = 1; + $theme_options['hbb-footer-layout'] = array( + 'desktop' => 'full', + 'tablet' => 'full', + 'mobile' => 'full', + ); + break; + + case 'footer-sml-layout-2': + $theme_options['footer-desktop-items']['below'] = array( + 'below_1' => array( $new_section_1_item ), + 'below_2' => array( $new_section_2_item ), + 'below_3' => array(), + 'below_4' => array(), + 'below_5' => array(), + ); + $theme_options['hbb-footer-column'] = 2; + $theme_options['hbb-footer-layout'] = array( + 'desktop' => '2-equal', + 'tablet' => '2-equal', + 'mobile' => 'full', + ); + break; + + default: + $theme_options['footer-desktop-items']['below'] = array( + 'below_1' => array( 'copyright' ), + 'below_2' => array(), + 'below_3' => array(), + 'below_4' => array(), + 'below_5' => array(), + ); + } + } + + return array( + 'theme_options' => $theme_options, + 'used_elements' => $used_elements, + 'widget_options' => $widget_options, + ); +} + +/** + * Header Footer builder - Migration of Footer Widgets. + * + * @since 3.0.0 + * @param array $theme_options Theme options. + * @param array $used_elements Used Elements array. + * @param array $widget_options Widget options. + * @return array + */ +function astra_footer_widgets_migration( $theme_options, $used_elements, $widget_options ) { + + $footer_widget_layouts = ( isset( $theme_options['footer-adv'] ) ) ? $theme_options['footer-adv'] : ''; + + if ( '' !== $footer_widget_layouts ) { + + $column = 2; + $layout = array( + 'desktop' => '2-equal', + 'tablet' => '2-equal', + 'mobile' => 'full', + ); + $items = array( + 'above_1' => array(), + 'above_2' => array(), + 'above_3' => array(), + 'above_4' => array(), + 'above_5' => array(), + ); + + switch ( $footer_widget_layouts ) { + case 'layout-1': + $column = '1'; + $layout = array( + 'desktop' => 'full', + 'tablet' => 'full', + 'mobile' => 'full', + ); + $items = array( + 'above_1' => array( 'widget-1' ), + 'above_2' => array(), + 'above_3' => array(), + 'above_4' => array(), + 'above_5' => array(), + ); + break; + + case 'layout-2': + $column = '2'; + $layout = array( + 'desktop' => '2-equal', + 'tablet' => '2-equal', + 'mobile' => '2-equal', + ); + $items = array( + 'above_1' => array( 'widget-1' ), + 'above_2' => array( 'widget-2' ), + 'above_3' => array(), + 'above_4' => array(), + 'above_5' => array(), + ); + break; + + case 'layout-3': + $column = '3'; + $layout = array( + 'desktop' => '3-equal', + 'tablet' => 'full', + 'mobile' => 'full', + ); + $items = array( + 'above_1' => array( 'widget-1' ), + 'above_2' => array( 'widget-2' ), + 'above_3' => array( 'widget-3' ), + 'above_4' => array(), + 'above_5' => array(), + ); + break; + + case 'layout-4': + $column = '4'; + $layout = array( + 'desktop' => '4-equal', + 'tablet' => 'full', + 'mobile' => 'full', + ); + $items = array( + 'above_1' => array( 'widget-1' ), + 'above_2' => array( 'widget-2' ), + 'above_3' => array( 'widget-3' ), + 'above_4' => array( 'widget-4' ), + 'above_5' => array(), + ); + break; + + case 'layout-5': + $column = '5'; + $layout = array( + 'desktop' => '5-equal', + 'tablet' => 'full', + 'mobile' => 'full', + ); + $items = array( + 'above_1' => array( 'widget-1' ), + 'above_2' => array( 'widget-2' ), + 'above_3' => array( 'widget-3' ), + 'above_4' => array( 'widget-4' ), + 'above_5' => array( 'widget-5' ), + ); + break; + + case 'layout-6': + case 'layout-7': + $column = '3'; + $layout = array( + 'desktop' => '3-lheavy', + 'tablet' => 'full', + 'mobile' => 'full', + ); + $items = array( + 'above_1' => array( 'widget-1' ), + 'above_2' => array( 'widget-2' ), + 'above_3' => array( 'widget-3' ), + 'above_4' => array(), + 'above_5' => array(), + ); + break; + } + + $theme_options['hba-footer-column'] = $column; + $theme_options['hba-footer-layout'] = $layout; + if ( isset( $theme_options['footer-desktop-items'] ) ) { + $theme_options['footer-desktop-items']['above'] = $items; + } + + for ( $i = 1; $i <= $column; $i++ ) { + + if ( isset( $theme_options['footer-adv-wgt-title-color'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-title-color' ] = array( + 'desktop' => $theme_options['footer-adv-wgt-title-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + + if ( isset( $theme_options['footer-adv-text-color'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-color' ] = array( + 'desktop' => $theme_options['footer-adv-text-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + + if ( isset( $theme_options['footer-adv-link-color'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-link-color' ] = array( + 'desktop' => $theme_options['footer-adv-link-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + + if ( isset( $theme_options['footer-adv-link-h-color'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-link-h-color' ] = array( + 'desktop' => $theme_options['footer-adv-link-h-color'], + 'tablet' => '', + 'mobile' => '', + ); + } + + + if ( isset( $theme_options['footer-adv-wgt-title-font-size'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-font-size' ] = $theme_options['footer-adv-wgt-title-font-size']; + } + + if ( isset( $theme_options['footer-adv-wgt-title-font-weight'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-font-weight' ] = $theme_options['footer-adv-wgt-title-font-weight']; + } + + if ( isset( $theme_options['footer-adv-wgt-title-line-height'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-line-height' ] = $theme_options['footer-adv-wgt-title-line-height']; + } + + if ( isset( $theme_options['footer-adv-wgt-title-font-family'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-font-family' ] = $theme_options['footer-adv-wgt-title-font-family']; + } + + if ( isset( $theme_options['footer-adv-wgt-title-text-transform'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-text-transform' ] = $theme_options['footer-adv-wgt-title-text-transform']; + } + + + if ( isset( $theme_options['footer-adv-wgt-content-font-size'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-content-font-size' ] = $theme_options['footer-adv-wgt-content-font-size']; + } + + if ( isset( $theme_options['footer-adv-wgt-content-font-weight'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-content-font-weight' ] = $theme_options['footer-adv-wgt-content-font-weight']; + } + + if ( isset( $theme_options['footer-adv-wgt-content-line-height'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-content-line-height' ] = $theme_options['footer-adv-wgt-content-line-height']; + } + + if ( isset( $theme_options['footer-adv-wgt-content-font-family'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-content-font-family' ] = $theme_options['footer-adv-wgt-content-font-family']; + } + + if ( isset( $theme_options['footer-adv-wgt-content-text-transform'] ) ) { + $theme_options[ 'footer-widget-' . $i . '-content-text-transform' ] = $theme_options['footer-adv-wgt-content-text-transform']; + } + + if ( isset( $widget_options[ 'advanced-footer-widget-' . $i ] ) ) { + $widget_options[ 'footer-widget-' . $i ] = $widget_options[ 'advanced-footer-widget-' . $i ]; + } + } + } + + if ( isset( $theme_options['footer-adv-border-width'] ) ) { + $theme_options['hba-footer-separator'] = $theme_options['footer-adv-border-width']; + } + + if ( isset( $theme_options['footer-adv-border-color'] ) ) { + $theme_options['hba-footer-top-border-color'] = $theme_options['footer-adv-border-color']; + } + + if ( isset( $theme_options['footer-adv-bg-obj'] ) ) { + $theme_options['hba-footer-bg-obj-responsive'] = array( + 'desktop' => $theme_options['footer-adv-bg-obj'], + 'tablet' => '', + 'mobile' => '', + ); + } + + if ( isset( $theme_options['footer-adv-area-padding'] ) ) { + $theme_options['section-above-footer-builder-padding'] = $theme_options['footer-adv-area-padding']; + } + + return array( + 'theme_options' => $theme_options, + 'used_elements' => $used_elements, + 'widget_options' => $widget_options, + ); +} + +/** + * Do not apply new Media & Text block padding CSS & not remove padding for #primary on mobile devices directly for existing users. + * + * @since 2.6.1 + * + * @return void + */ +function astra_gutenberg_media_text_block_css_compatibility() { + $theme_options = get_option( 'astra-settings', array() ); + + if ( ! isset( $theme_options['guntenberg-media-text-block-padding-css'] ) ) { + $theme_options['guntenberg-media-text-block-padding-css'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Gutenberg pattern compatibility changes. + * + * @since 3.3.0 + * + * @return void + */ +function astra_gutenberg_pattern_compatibility() { + $theme_options = get_option( 'astra-settings', array() ); + + if ( ! isset( $theme_options['guntenberg-button-pattern-compat-css'] ) ) { + $theme_options['guntenberg-button-pattern-compat-css'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Set flag to provide backward compatibility of float based CSS for existing users. + * + * @since 3.3.0 + * @return void. + */ +function astra_check_flex_based_css() { + $theme_options = get_option( 'astra-settings', array() ); + + if ( ! isset( $theme_options['is-flex-based-css'] ) ) { + $theme_options['is-flex-based-css'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Update the Cart Style, Icon color & Border radius if None style is selected. + * + * @since 3.4.0 + * @return void. + */ +function astra_update_cart_style() { + $theme_options = get_option( 'astra-settings', array() ); + if ( isset( $theme_options['woo-header-cart-icon-style'] ) && 'none' === $theme_options['woo-header-cart-icon-style'] ) { + $theme_options['woo-header-cart-icon-style'] = 'outline'; + $theme_options['header-woo-cart-icon-color'] = ''; + $theme_options['woo-header-cart-icon-color'] = ''; + $theme_options['woo-header-cart-icon-radius'] = ''; + } + + if ( isset( $theme_options['edd-header-cart-icon-style'] ) && 'none' === $theme_options['edd-header-cart-icon-style'] ) { + $theme_options['edd-header-cart-icon-style'] = 'outline'; + $theme_options['edd-header-cart-icon-color'] = ''; + $theme_options['edd-header-cart-icon-radius'] = ''; + } + + update_option( 'astra-settings', $theme_options ); +} + +/** + * Update existing 'Grid Column Layout' option in responsive way in Related Posts. + * Till this update 3.5.0 we have 'Grid Column Layout' only for singular option, but now we are improving it as responsive. + * + * @since 3.5.0 + * @return void. + */ +function astra_update_related_posts_grid_layout() { + + $theme_options = get_option( 'astra-settings', array() ); + + if ( ! isset( $theme_options['related-posts-grid-responsive'] ) && isset( $theme_options['related-posts-grid'] ) ) { + + /** + * Managed here switch case to reduce further conditions in dynamic-css to get CSS value based on grid-template-columns. Because there are following CSS props used. + * + * '1' = grid-template-columns: 1fr; + * '2' = grid-template-columns: repeat(2,1fr); + * '3' = grid-template-columns: repeat(3,1fr); + * '4' = grid-template-columns: repeat(4,1fr); + * + * And we already have Astra_Builder_Helper::$grid_size_mapping (used for footer layouts) for getting CSS values based on grid layouts. So migrating old value of grid here to new grid value. + */ + switch ( $theme_options['related-posts-grid'] ) { + case '1': + $grid_layout = 'full'; + break; + + case '2': + $grid_layout = '2-equal'; + break; + + case '3': + $grid_layout = '3-equal'; + break; + + case '4': + $grid_layout = '4-equal'; + break; + } + + $theme_options['related-posts-grid-responsive'] = array( + 'desktop' => $grid_layout, + 'tablet' => $grid_layout, + 'mobile' => 'full', + ); + + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Migrate Site Title & Site Tagline options to new responsive array. + * + * @since 3.5.0 + * + * @return void + */ +function astra_site_title_tagline_responsive_control_migration() { + + $theme_options = get_option( 'astra-settings', array() ); + + if ( false === get_option( 'display-site-title-responsive', false ) && isset( $theme_options['display-site-title'] ) ) { + $theme_options['display-site-title-responsive']['desktop'] = $theme_options['display-site-title']; + $theme_options['display-site-title-responsive']['tablet'] = $theme_options['display-site-title']; + $theme_options['display-site-title-responsive']['mobile'] = $theme_options['display-site-title']; + } + + if ( false === get_option( 'display-site-tagline-responsive', false ) && isset( $theme_options['display-site-tagline'] ) ) { + $theme_options['display-site-tagline-responsive']['desktop'] = $theme_options['display-site-tagline']; + $theme_options['display-site-tagline-responsive']['tablet'] = $theme_options['display-site-tagline']; + $theme_options['display-site-tagline-responsive']['mobile'] = $theme_options['display-site-tagline']; + } + + update_option( 'astra-settings', $theme_options ); +} + +/** + * Do not apply new font-weight heading support CSS in editor/frontend directly. + * + * 1. Adding Font-weight support to widget titles. + * 2. Customizer font CSS not supporting in editor. + * + * @since 3.6.0 + * + * @return void + */ +function astra_headings_font_support() { + $theme_options = get_option( 'astra-settings', array() ); + + if ( ! isset( $theme_options['can-support-widget-and-editor-fonts'] ) ) { + $theme_options['can-support-widget-and-editor-fonts'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Set flag to avoid direct reflections on live site & to maintain backward compatibility for existing users. + * + * @since 3.6.0 + * @return void. + */ +function astra_remove_logo_max_width() { + $theme_options = get_option( 'astra-settings', array() ); + + if ( ! isset( $theme_options['can-remove-logo-max-width-css'] ) ) { + $theme_options['can-remove-logo-max-width-css'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Set flag to maintain backward compatibility for existing users for Transparent Header border bottom default value i.e from '' to 0. + * + * @since 3.6.0 + * @return void. + */ +function astra_transparent_header_default_value() { + $theme_options = get_option( 'astra-settings', array() ); + + if ( ! isset( $theme_options['transparent-header-default-border'] ) ) { + $theme_options['transparent-header-default-border'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Clear Astra + Astra Pro assets cache. + * + * @since 3.6.1 + * @return void. + */ +function astra_clear_all_assets_cache() { + if ( class_exists( 'Astra_Cache_Base' ) ) { + // Clear Astra theme cache. + $astra_cache_base_instance = new Astra_Cache_Base( 'astra' ); + $astra_cache_base_instance->refresh_assets( 'astra' ); + + // Clear Astra Addon's cache. + $astra_addon_cache_base_instance = new Astra_Cache_Base( 'astra-addon' ); + $astra_addon_cache_base_instance->refresh_assets( 'astra-addon' ); + } +} + +/** + * Set flag for updated default values for buttons & add GB Buttons padding support. + * + * @since 3.6.3 + * @return void. + */ +function astra_button_default_values_updated() { + $theme_options = get_option( 'astra-settings', array() ); + + if ( ! isset( $theme_options['btn-default-padding-updated'] ) ) { + $theme_options['btn-default-padding-updated'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Set flag for old users, to not directly apply underline to content links. + * + * @since 3.6.4 + * @return void. + */ +function astra_update_underline_link_setting() { + $theme_options = get_option( 'astra-settings', array() ); + + if ( ! isset( $theme_options['underline-content-links'] ) ) { + $theme_options['underline-content-links'] = false; + update_option( 'astra-settings', $theme_options ); + } +} + +/** + * Add compatibility support for WP-5.8. as some of settings & blocks already their in WP-5.7 versions, that's why added backward here. + * + * @since 3.6.5 + * @return void + */ +function astra_support_block_editor() { + $theme_options = get_option( 'astra-settings' ); + + // Set flag on existing user's site to not reflect changes directly. + if ( ! isset( $theme_options['support-block-editor'] ) ) { + $theme_options['support-block-editor'] = false; + update_option( 'astra-settings', $theme_options ); + } +} diff --git a/inc/theme-update/class-astra-pb-compatibility.php b/inc/theme-update/class-astra-pb-compatibility.php index 1b707d5..b2df80f 100644 --- a/inc/theme-update/class-astra-pb-compatibility.php +++ b/inc/theme-update/class-astra-pb-compatibility.php @@ -1,186 +1,186 @@ -update_meta_values( $current_post_id ); - } - } - - // get all post types. - $all_post_type = get_post_types( - array( - 'public' => true, - ) - ); - unset( $all_post_type['attachment'] ); - - // wp_query array. - $query = array( - 'post_type' => $all_post_type, - 'posts_per_page' => '30', - 'no_found_rows' => true, - 'post_status' => 'any', - 'offset' => $offset_comp, - 'date_query' => array( - array( - 'before' => $comp_time, - 'inclusive' => true, - ), - ), - 'fields' => 'ids', - ); - - // exicute wp_query. - $posts = new WP_Query( $query ); - - $continue = false; - foreach ( $posts->posts as $id ) { - $this->update_meta_values( $id ); - $continue = true; - } - - if ( $continue ) { - $offset_comp += 30; - update_option( '_astra_pb_compatibility_offset', $offset_comp ); - } else { - delete_option( '_astra_pb_compatibility_offset' ); - delete_option( '_astra_pb_compatibility_time' ); - astra_update_option( '_astra_pb_compatibility_completed', true ); - } - } - - /** - * Update meta values - * - * @since 1.0.13 - * @param int $id Post id. - * @return void - */ - public function update_meta_values( $id ) { - - $layout_flag = get_post_meta( $id, '_astra_content_layout_flag', true ); - if ( empty( $layout_flag ) ) { - $site_content = get_post_meta( $id, 'site-content-layout', true ); - - if ( 'default' == $site_content ) { - $post_type = get_post_type( $id ); - if ( 'page' == $post_type ) { - $site_content = astra_get_option( 'single-page-content-layout', '' ); - } elseif ( 'post' == $post_type ) { - $site_content = astra_get_option( 'single-post-content-layout', '' ); - } - - if ( 'default' == $site_content ) { - $site_content = astra_get_option( 'site-content-layout', '' ); - } - } - - $elementor = get_post_meta( $id, '_elementor_edit_mode', true ); - $vc = get_post_meta( $id, '_wpb_vc_js_status', true ); - if ( 'page-builder' === $site_content ) { - update_post_meta( $id, '_astra_content_layout_flag', 'disabled' ); - update_post_meta( $id, 'site-post-title', 'disabled' ); - update_post_meta( $id, 'ast-title-bar-display', 'disabled' ); - update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' ); - } elseif ( 'builder' === $elementor || true === $vc || 'true' === $vc ) { - update_post_meta( $id, '_astra_content_layout_flag', 'disabled' ); - } - } - } - } -} - - - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_PB_Compatibility::get_instance(); +update_meta_values( $current_post_id ); + } + } + + // get all post types. + $all_post_type = get_post_types( + array( + 'public' => true, + ) + ); + unset( $all_post_type['attachment'] ); + + // wp_query array. + $query = array( + 'post_type' => $all_post_type, + 'posts_per_page' => '30', + 'no_found_rows' => true, + 'post_status' => 'any', + 'offset' => $offset_comp, + 'date_query' => array( + array( + 'before' => $comp_time, + 'inclusive' => true, + ), + ), + 'fields' => 'ids', + ); + + // exicute wp_query. + $posts = new WP_Query( $query ); + + $continue = false; + foreach ( $posts->posts as $id ) { + $this->update_meta_values( $id ); + $continue = true; + } + + if ( $continue ) { + $offset_comp += 30; + update_option( '_astra_pb_compatibility_offset', $offset_comp ); + } else { + delete_option( '_astra_pb_compatibility_offset' ); + delete_option( '_astra_pb_compatibility_time' ); + astra_update_option( '_astra_pb_compatibility_completed', true ); + } + } + + /** + * Update meta values + * + * @since 1.0.13 + * @param int $id Post id. + * @return void + */ + public function update_meta_values( $id ) { + + $layout_flag = get_post_meta( $id, '_astra_content_layout_flag', true ); + if ( empty( $layout_flag ) ) { + $site_content = get_post_meta( $id, 'site-content-layout', true ); + + if ( 'default' == $site_content ) { + $post_type = get_post_type( $id ); + if ( 'page' == $post_type ) { + $site_content = astra_get_option( 'single-page-content-layout', '' ); + } elseif ( 'post' == $post_type ) { + $site_content = astra_get_option( 'single-post-content-layout', '' ); + } + + if ( 'default' == $site_content ) { + $site_content = astra_get_option( 'site-content-layout', '' ); + } + } + + $elementor = get_post_meta( $id, '_elementor_edit_mode', true ); + $vc = get_post_meta( $id, '_wpb_vc_js_status', true ); + if ( 'page-builder' === $site_content ) { + update_post_meta( $id, '_astra_content_layout_flag', 'disabled' ); + update_post_meta( $id, 'site-post-title', 'disabled' ); + update_post_meta( $id, 'ast-title-bar-display', 'disabled' ); + update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' ); + } elseif ( 'builder' === $elementor || true === $vc || 'true' === $vc ) { + update_post_meta( $id, '_astra_content_layout_flag', 'disabled' ); + } + } + } + } +} + + + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_PB_Compatibility::get_instance(); diff --git a/inc/theme-update/class-astra-theme-background-updater.php b/inc/theme-update/class-astra-theme-background-updater.php index 82f69e2..a9d1792 100644 --- a/inc/theme-update/class-astra-theme-background-updater.php +++ b/inc/theme-update/class-astra-theme-background-updater.php @@ -1,400 +1,400 @@ - array( - 'astra_submenu_below_header', - ), - '2.2.0' => array( - 'astra_page_builder_button_color_compatibility', - 'astra_vertical_horizontal_padding_migration', - ), - '2.3.0' => array( - 'astra_header_button_new_options', - ), - '2.3.3' => array( - 'astra_elementor_default_color_typo_comp', - ), - '2.3.4' => array( - 'astra_breadcrumb_separator_fix', - ), - '2.4.0' => array( - 'astra_responsive_base_background_option', - 'astra_update_theme_tablet_breakpoint', - ), - '2.4.4' => array( - 'astra_gtn_full_wide_image_group_css', - ), - '2.5.0' => array( - 'astra_global_button_woo_css', - 'astra_gtn_full_wide_group_cover_css', - ), - '2.5.2' => array( - 'astra_footer_widget_bg', - ), - '2.6.0' => array( - 'astra_bg_control_migration', - 'astra_bg_responsive_control_migration', - 'astra_gutenberg_core_blocks_design_compatibility', - ), - '2.6.1' => array( - 'astra_gutenberg_media_text_block_css_compatibility', - ), - '3.0.0' => array( - 'astra_header_builder_compatibility', - ), - '3.0.1' => array( - 'astra_clear_assets_cache', - ), - '3.3.0' => array( - 'astra_gutenberg_pattern_compatibility', - 'astra_icons_svg_compatibility', - 'astra_check_flex_based_css', - ), - '3.4.0' => array( - 'astra_update_cart_style', - ), - '3.5.0' => array( - 'astra_update_related_posts_grid_layout', - 'astra_site_title_tagline_responsive_control_migration', - ), - '3.6.0' => array( - 'astra_headings_font_support', - 'astra_remove_logo_max_width', - 'astra_transparent_header_default_value', - ), - '3.6.1' => array( - 'astra_clear_all_assets_cache', - ), - '3.6.3' => array( - 'astra_button_default_values_updated', - 'astra_clear_all_assets_cache', - ), - '3.6.4' => array( - 'astra_update_underline_link_setting', - ), - '3.6.5' => array( - 'astra_support_block_editor', - ), - ); - - /** - * Constructor - */ - public function __construct() { - - // Theme Updates. - if ( is_admin() ) { - add_action( 'admin_init', array( $this, 'install_actions' ) ); - } else { - add_action( 'wp', array( $this, 'install_actions' ) ); - } - - // Core Helpers - Batch Processing. - require_once ASTRA_THEME_DIR . 'inc/lib/batch-processing/class-astra-wp-async-request.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - require_once ASTRA_THEME_DIR . 'inc/lib/batch-processing/class-astra-wp-background-process.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - require_once ASTRA_THEME_DIR . 'inc/theme-update/class-astra-theme-wp-background-process.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound - - self::$background_updater = new Astra_Theme_WP_Background_Process(); - - } - - /** - * Check Cron Status - * - * Gets the current cron status by performing a test spawn. Cached for one hour when all is well. - * - * @since 2.3.0 - * - * @return true if there is a problem spawning a call to Wp-Cron system. - */ - public function test_cron() { - - global $wp_version; - - if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) { - return true; - } - - if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) { - return true; - } - - $cached_status = get_transient( 'astra-theme-cron-test-ok' ); - - if ( $cached_status ) { - return false; - } - - $sslverify = version_compare( $wp_version, 4.0, '<' ); - $doing_wp_cron = sprintf( '%.22F', microtime( true ) ); - - $cron_request = apply_filters( - 'cron_request', - array( - 'url' => site_url( 'wp-cron.php?doing_wp_cron=' . $doing_wp_cron ), - 'args' => array( - 'timeout' => 3, - 'blocking' => true, - 'sslverify' => apply_filters( 'https_local_ssl_verify', $sslverify ), - ), - ) - ); - - $result = wp_remote_post( $cron_request['url'], $cron_request['args'] ); - - if ( wp_remote_retrieve_response_code( $result ) >= 300 ) { - return true; - } else { - set_transient( 'astra-theme-cron-test-ok', 1, 3600 ); - return false; - } - - return $migration_fallback; - } - - /** - * Install actions when a update button is clicked within the admin area. - * - * This function is hooked into admin_init to affect admin and wp to affect the frontend. - */ - public function install_actions() { - - do_action( 'astra_update_initiated', self::$background_updater ); - - if ( true === $this->is_new_install() ) { - self::update_db_version(); - return; - } - - $fallback = $this->test_cron(); - $db_migrated = $this->check_if_data_migrated(); - - $is_queue_running = astra_get_option( 'is_theme_queue_running', false ); - - $fallback = ( $db_migrated ) ? $db_migrated : $fallback; - - if ( $this->needs_db_update() && ! $is_queue_running ) { - $this->update( $fallback ); - } else { - if ( ! $is_queue_running ) { - self::update_db_version(); - } - } - } - - /** - * Is this a brand new theme install? - * - * @since 2.1.3 - * @return boolean - */ - public function is_new_install() { - - // Get auto saved version number. - $saved_version = astra_get_option( 'theme-auto-version', false ); - - if ( false === $saved_version ) { - return true; - } - - return false; - } - - /** - * Is a DB update needed? - * - * @since 2.1.3 - * @return boolean - */ - private function needs_db_update() { - $current_theme_version = astra_get_option( 'theme-auto-version', null ); - $updates = $this->get_db_update_callbacks(); - - if ( empty( $updates ) ) { - return false; - } - - return ! is_null( $current_theme_version ) && version_compare( $current_theme_version, max( array_keys( $updates ) ), '<' ); - } - - /** - * Get list of DB update callbacks. - * - * @since 2.1.3 - * @return array - */ - public function get_db_update_callbacks() { - return self::$db_updates; - } - - /** - * Check if database is migrated - * - * @since 2.3.1 - * - * @return true If the database migration should not be run through CRON. - */ - public function check_if_data_migrated() { - - $fallback = false; - - $is_db_version_updated = $this->is_db_version_updated(); - if ( ! $is_db_version_updated ) { - - $db_migrated = get_transient( 'astra-theme-db-migrated' ); - - if ( ! $db_migrated ) { - $db_migrated = array(); - } - - array_push( $db_migrated, $is_db_version_updated ); - set_transient( 'astra-theme-db-migrated', $db_migrated, 3600 ); - - $db_migrate_count = count( $db_migrated ); - if ( $db_migrate_count >= 5 ) { - astra_delete_option( 'is_theme_queue_running' ); - $fallback = true; - } - } - return $fallback; - } - - /** - * Checks if astra addon version is updated in the database - * - * @since 2.3.1 - * - * @return true if astra addon version is updated. - */ - public function is_db_version_updated() { - // Get auto saved version number. - $saved_version = astra_get_option( 'theme-auto-version', false ); - - return version_compare( $saved_version, ASTRA_THEME_VERSION, '=' ); - } - - - /** - * Push all needed DB updates to the queue for processing. - * - * @param bool $fallback Fallback migration. - * - * @return void - */ - private function update( $fallback ) { - $current_db_version = astra_get_option( 'theme-auto-version' ); - - if ( count( $this->get_db_update_callbacks() ) > 0 ) { - foreach ( $this->get_db_update_callbacks() as $version => $update_callbacks ) { - if ( version_compare( $current_db_version, $version, '<' ) ) { - foreach ( $update_callbacks as $update_callback ) { - if ( $fallback ) { - call_user_func( $update_callback ); - } else { - self::$background_updater->push_to_queue( $update_callback ); - } - } - } - } - if ( $fallback ) { - self::update_db_version(); - } else { - astra_update_option( 'is_theme_queue_running', true ); - self::$background_updater->push_to_queue( 'update_db_version' ); - } - } else { - self::$background_updater->push_to_queue( 'update_db_version' ); - } - self::$background_updater->save()->dispatch(); - } - - /** - * Update DB version to current. - * - * @param string|null $version New Astra theme version or null. - */ - public static function update_db_version( $version = null ) { - - do_action( 'astra_theme_update_before' ); - - // Get auto saved version number. - $saved_version = astra_get_option( 'theme-auto-version', false ); - - if ( false === $saved_version ) { - - $saved_version = ASTRA_THEME_VERSION; - - // Update auto saved version number. - astra_update_option( 'theme-auto-version', ASTRA_THEME_VERSION ); - } - - // If equals then return. - if ( version_compare( $saved_version, ASTRA_THEME_VERSION, '=' ) ) { - do_action( 'astra_theme_update_after' ); - astra_update_option( 'is_theme_queue_running', false ); - return; - } - - // Not have stored? - if ( empty( $saved_version ) ) { - - // Get old version. - $theme_version = get_option( '_astra_auto_version', ASTRA_THEME_VERSION ); - - // Remove option. - delete_option( '_astra_auto_version' ); - - } else { - - // Get latest version. - $theme_version = ASTRA_THEME_VERSION; - } - - // Update auto saved version number. - astra_update_option( 'theme-auto-version', $theme_version ); - - astra_update_option( 'is_theme_queue_running', false ); - - // Update variables. - Astra_Theme_Options::refresh(); - - delete_transient( 'astra-addon-db-migrated' ); - - do_action( 'astra_theme_update_after' ); - } - } -} - - -/** - * Kicking this off by creating a new instance - */ -new Astra_Theme_Background_Updater(); + array( + 'astra_submenu_below_header', + ), + '2.2.0' => array( + 'astra_page_builder_button_color_compatibility', + 'astra_vertical_horizontal_padding_migration', + ), + '2.3.0' => array( + 'astra_header_button_new_options', + ), + '2.3.3' => array( + 'astra_elementor_default_color_typo_comp', + ), + '2.3.4' => array( + 'astra_breadcrumb_separator_fix', + ), + '2.4.0' => array( + 'astra_responsive_base_background_option', + 'astra_update_theme_tablet_breakpoint', + ), + '2.4.4' => array( + 'astra_gtn_full_wide_image_group_css', + ), + '2.5.0' => array( + 'astra_global_button_woo_css', + 'astra_gtn_full_wide_group_cover_css', + ), + '2.5.2' => array( + 'astra_footer_widget_bg', + ), + '2.6.0' => array( + 'astra_bg_control_migration', + 'astra_bg_responsive_control_migration', + 'astra_gutenberg_core_blocks_design_compatibility', + ), + '2.6.1' => array( + 'astra_gutenberg_media_text_block_css_compatibility', + ), + '3.0.0' => array( + 'astra_header_builder_compatibility', + ), + '3.0.1' => array( + 'astra_clear_assets_cache', + ), + '3.3.0' => array( + 'astra_gutenberg_pattern_compatibility', + 'astra_icons_svg_compatibility', + 'astra_check_flex_based_css', + ), + '3.4.0' => array( + 'astra_update_cart_style', + ), + '3.5.0' => array( + 'astra_update_related_posts_grid_layout', + 'astra_site_title_tagline_responsive_control_migration', + ), + '3.6.0' => array( + 'astra_headings_font_support', + 'astra_remove_logo_max_width', + 'astra_transparent_header_default_value', + ), + '3.6.1' => array( + 'astra_clear_all_assets_cache', + ), + '3.6.3' => array( + 'astra_button_default_values_updated', + 'astra_clear_all_assets_cache', + ), + '3.6.4' => array( + 'astra_update_underline_link_setting', + ), + '3.6.5' => array( + 'astra_support_block_editor', + ), + ); + + /** + * Constructor + */ + public function __construct() { + + // Theme Updates. + if ( is_admin() ) { + add_action( 'admin_init', array( $this, 'install_actions' ) ); + } else { + add_action( 'wp', array( $this, 'install_actions' ) ); + } + + // Core Helpers - Batch Processing. + require_once ASTRA_THEME_DIR . 'inc/lib/batch-processing/class-astra-wp-async-request.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + require_once ASTRA_THEME_DIR . 'inc/lib/batch-processing/class-astra-wp-background-process.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + require_once ASTRA_THEME_DIR . 'inc/theme-update/class-astra-theme-wp-background-process.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + + self::$background_updater = new Astra_Theme_WP_Background_Process(); + + } + + /** + * Check Cron Status + * + * Gets the current cron status by performing a test spawn. Cached for one hour when all is well. + * + * @since 2.3.0 + * + * @return true if there is a problem spawning a call to Wp-Cron system. + */ + public function test_cron() { + + global $wp_version; + + if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) { + return true; + } + + if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) { + return true; + } + + $cached_status = get_transient( 'astra-theme-cron-test-ok' ); + + if ( $cached_status ) { + return false; + } + + $sslverify = version_compare( $wp_version, 4.0, '<' ); + $doing_wp_cron = sprintf( '%.22F', microtime( true ) ); + + $cron_request = apply_filters( + 'cron_request', + array( + 'url' => site_url( 'wp-cron.php?doing_wp_cron=' . $doing_wp_cron ), + 'args' => array( + 'timeout' => 3, + 'blocking' => true, + 'sslverify' => apply_filters( 'https_local_ssl_verify', $sslverify ), + ), + ) + ); + + $result = wp_remote_post( $cron_request['url'], $cron_request['args'] ); + + if ( wp_remote_retrieve_response_code( $result ) >= 300 ) { + return true; + } else { + set_transient( 'astra-theme-cron-test-ok', 1, 3600 ); + return false; + } + + return $migration_fallback; + } + + /** + * Install actions when a update button is clicked within the admin area. + * + * This function is hooked into admin_init to affect admin and wp to affect the frontend. + */ + public function install_actions() { + + do_action( 'astra_update_initiated', self::$background_updater ); + + if ( true === $this->is_new_install() ) { + self::update_db_version(); + return; + } + + $fallback = $this->test_cron(); + $db_migrated = $this->check_if_data_migrated(); + + $is_queue_running = astra_get_option( 'is_theme_queue_running', false ); + + $fallback = ( $db_migrated ) ? $db_migrated : $fallback; + + if ( $this->needs_db_update() && ! $is_queue_running ) { + $this->update( $fallback ); + } else { + if ( ! $is_queue_running ) { + self::update_db_version(); + } + } + } + + /** + * Is this a brand new theme install? + * + * @since 2.1.3 + * @return boolean + */ + public function is_new_install() { + + // Get auto saved version number. + $saved_version = astra_get_option( 'theme-auto-version', false ); + + if ( false === $saved_version ) { + return true; + } + + return false; + } + + /** + * Is a DB update needed? + * + * @since 2.1.3 + * @return boolean + */ + private function needs_db_update() { + $current_theme_version = astra_get_option( 'theme-auto-version', null ); + $updates = $this->get_db_update_callbacks(); + + if ( empty( $updates ) ) { + return false; + } + + return ! is_null( $current_theme_version ) && version_compare( $current_theme_version, max( array_keys( $updates ) ), '<' ); + } + + /** + * Get list of DB update callbacks. + * + * @since 2.1.3 + * @return array + */ + public function get_db_update_callbacks() { + return self::$db_updates; + } + + /** + * Check if database is migrated + * + * @since 2.3.1 + * + * @return true If the database migration should not be run through CRON. + */ + public function check_if_data_migrated() { + + $fallback = false; + + $is_db_version_updated = $this->is_db_version_updated(); + if ( ! $is_db_version_updated ) { + + $db_migrated = get_transient( 'astra-theme-db-migrated' ); + + if ( ! $db_migrated ) { + $db_migrated = array(); + } + + array_push( $db_migrated, $is_db_version_updated ); + set_transient( 'astra-theme-db-migrated', $db_migrated, 3600 ); + + $db_migrate_count = count( $db_migrated ); + if ( $db_migrate_count >= 5 ) { + astra_delete_option( 'is_theme_queue_running' ); + $fallback = true; + } + } + return $fallback; + } + + /** + * Checks if astra addon version is updated in the database + * + * @since 2.3.1 + * + * @return true if astra addon version is updated. + */ + public function is_db_version_updated() { + // Get auto saved version number. + $saved_version = astra_get_option( 'theme-auto-version', false ); + + return version_compare( $saved_version, ASTRA_THEME_VERSION, '=' ); + } + + + /** + * Push all needed DB updates to the queue for processing. + * + * @param bool $fallback Fallback migration. + * + * @return void + */ + private function update( $fallback ) { + $current_db_version = astra_get_option( 'theme-auto-version' ); + + if ( count( $this->get_db_update_callbacks() ) > 0 ) { + foreach ( $this->get_db_update_callbacks() as $version => $update_callbacks ) { + if ( version_compare( $current_db_version, $version, '<' ) ) { + foreach ( $update_callbacks as $update_callback ) { + if ( $fallback ) { + call_user_func( $update_callback ); + } else { + self::$background_updater->push_to_queue( $update_callback ); + } + } + } + } + if ( $fallback ) { + self::update_db_version(); + } else { + astra_update_option( 'is_theme_queue_running', true ); + self::$background_updater->push_to_queue( 'update_db_version' ); + } + } else { + self::$background_updater->push_to_queue( 'update_db_version' ); + } + self::$background_updater->save()->dispatch(); + } + + /** + * Update DB version to current. + * + * @param string|null $version New Astra theme version or null. + */ + public static function update_db_version( $version = null ) { + + do_action( 'astra_theme_update_before' ); + + // Get auto saved version number. + $saved_version = astra_get_option( 'theme-auto-version', false ); + + if ( false === $saved_version ) { + + $saved_version = ASTRA_THEME_VERSION; + + // Update auto saved version number. + astra_update_option( 'theme-auto-version', ASTRA_THEME_VERSION ); + } + + // If equals then return. + if ( version_compare( $saved_version, ASTRA_THEME_VERSION, '=' ) ) { + do_action( 'astra_theme_update_after' ); + astra_update_option( 'is_theme_queue_running', false ); + return; + } + + // Not have stored? + if ( empty( $saved_version ) ) { + + // Get old version. + $theme_version = get_option( '_astra_auto_version', ASTRA_THEME_VERSION ); + + // Remove option. + delete_option( '_astra_auto_version' ); + + } else { + + // Get latest version. + $theme_version = ASTRA_THEME_VERSION; + } + + // Update auto saved version number. + astra_update_option( 'theme-auto-version', $theme_version ); + + astra_update_option( 'is_theme_queue_running', false ); + + // Update variables. + Astra_Theme_Options::refresh(); + + delete_transient( 'astra-addon-db-migrated' ); + + do_action( 'astra_theme_update_after' ); + } + } +} + + +/** + * Kicking this off by creating a new instance + */ +new Astra_Theme_Background_Updater(); diff --git a/inc/theme-update/class-astra-theme-update.php b/inc/theme-update/class-astra-theme-update.php index 88919b1..6369dbb 100644 --- a/inc/theme-update/class-astra-theme-update.php +++ b/inc/theme-update/class-astra-theme-update.php @@ -1,984 +1,984 @@ -' ) ) { - self::v_1_0_8(); - } - - // Update to older version than 1.0.12 version. - if ( version_compare( $saved_version, '1.0.12', '<' ) ) { - self::v_1_0_12(); - } - - // Update to older version than 1.0.14 version. - if ( version_compare( $saved_version, '1.0.14', '<' ) ) { - self::v_1_0_14(); - } - - // Update astra meta settings for Beaver Themer Backwards Compatibility. - if ( version_compare( $saved_version, '1.0.28', '<' ) ) { - self::v_1_0_28(); - } - - // Update astra meta settings for Beaver Themer Backwards Compatibility. - if ( version_compare( $saved_version, '1.1.0-beta.3', '<' ) ) { - self::v_1_1_0_beta_3(); - } - - // Update astra meta settings for Beaver Themer Backwards Compatibility. - if ( version_compare( $saved_version, '1.1.0-beta.4', '<' ) ) { - self::v_1_1_0_beta_4(); - } - - // Update astra meta settings for Beaver Themer Backwards Compatibility. - if ( version_compare( $saved_version, '1.2.2', '<' ) ) { - self::v_1_2_2(); - } - - // Update astra Theme colors values same as Link color. - if ( version_compare( $saved_version, '1.2.4', '<' ) ) { - self::v_1_2_4(); - } - - // Update astra Google Fonts values with fallback font. - if ( version_compare( $saved_version, '1.2.7', '<' ) ) { - self::v_1_2_7(); - } - - // Update astra background image data. - if ( version_compare( $saved_version, '1.3.0', '<' ) ) { - self::v_1_3_0(); - } - - // Update astra setting for inherit site logo compatibility. - if ( version_compare( $saved_version, '1.4.0-beta.3', '<' ) ) { - self::v_1_4_0_beta_3(); - } - - if ( version_compare( $saved_version, '1.4.0-beta.4', '<' ) ) { - self::v_1_4_0_beta_4(); - } - - if ( version_compare( $saved_version, '1.4.0-beta.5', '<' ) ) { - self::v_1_4_0_beta_5(); - } - - if ( version_compare( $saved_version, '1.4.3-alpha.1', '<' ) ) { - self::v_1_4_3_alpha_1(); - } - - if ( version_compare( $saved_version, '1.4.9', '<' ) ) { - self::v_1_4_9(); - } - - if ( version_compare( $saved_version, '1.5.0-beta.4', '<' ) ) { - self::v_1_5_0_beta_4(); - } - - if ( version_compare( $saved_version, '1.5.0-rc.1', '<' ) ) { - self::v_1_5_0_rc_1(); - } - - if ( version_compare( $saved_version, '1.5.0', '<' ) ) { - self::v_1_5_0_rc_3(); - } - - if ( version_compare( $saved_version, '1.5.1', '<' ) ) { - self::v_1_5_1(); - } - - if ( version_compare( $saved_version, '1.5.2', '<' ) ) { - self::v_1_5_2(); - } - - if ( version_compare( $saved_version, '1.6.0', '<' ) ) { - self::v_1_6_0(); - } - - if ( version_compare( $saved_version, '1.6.1-alpha.3', '<' ) ) { - self::v_1_6_1(); - } - if ( version_compare( $saved_version, '2.0.0', '<' ) ) { - self::v_2_0_0(); - } - } - - /** - * Footer Widgets compatibilty for astra pro. - */ - public static function astra_pro_compatibility() { - - if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '1.0.0-beta.6', '<' ) ) { - remove_action( 'astra_footer_content', 'astra_advanced_footer_markup', 1 ); - } - } - - /** - * Update options of older version than 1.0.4. - * - * @since 1.0.4 - */ - public static function v_1_0_4() { - - $options = array( - 'font-size-body', - 'body-line-height', - 'font-size-site-title', - 'font-size-site-tagline', - 'font-size-entry-title', - 'font-size-page-title', - 'font-size-h1', - 'font-size-h2', - 'font-size-h3', - 'font-size-h4', - 'font-size-h5', - 'font-size-h6', - - // Addon Options. - 'footer-adv-wgt-title-font-size', - 'footer-adv-wgt-title-line-height', - 'footer-adv-wgt-content-font-size', - 'footer-adv-wgt-content-line-height', - 'above-header-font-size', - 'font-size-below-header-primary-menu', - 'font-size-below-header-dropdown-menu', - 'font-size-below-header-content', - 'font-size-related-post', - 'line-height-related-post', - 'title-bar-title-font-size', - 'title-bar-title-line-height', - 'title-bar-breadcrumb-font-size', - 'title-bar-breadcrumb-line-height', - 'line-height-page-title', - 'font-size-post-meta', - 'line-height-post-meta', - 'font-size-post-pagination', - 'line-height-h1', - 'line-height-h2', - 'line-height-h3', - 'line-height-h4', - 'line-height-h5', - 'line-height-h6', - 'font-size-footer-content', - 'line-height-footer-content', - 'line-height-site-title', - 'line-height-site-tagline', - 'font-size-primary-menu', - 'line-height-primary-menu', - 'font-size-primary-dropdown-menu', - 'line-height-primary-dropdown-menu', - 'font-size-widget-title', - 'line-height-widget-title', - 'font-size-widget-content', - 'line-height-widget-content', - 'line-height-entry-title', - ); - - $astra_options = get_option( 'ast-settings', array() ); - - if ( 0 < count( $astra_options ) ) { - foreach ( $options as $key ) { - - if ( array_key_exists( $key, $astra_options ) && ! is_array( $astra_options[ $key ] ) ) { - - $astra_options[ $key ] = array( - 'desktop' => $astra_options[ $key ], - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ); - } - } - } - - update_option( 'ast-settings', $astra_options ); - } - - /** - * Update options of older version than 1.0.5. - * - * @since 1.0.5 - */ - public static function v_1_0_5() { - - $astra_old_options = get_option( 'ast-settings', array() ); - $astra_new_options = get_option( ASTRA_THEME_SETTINGS, array() ); - - // Merge old customizer options in new option. - $astra_options = wp_parse_args( $astra_new_options, $astra_old_options ); - - // Update option. - update_option( ASTRA_THEME_SETTINGS, $astra_options ); - - // Delete old option. - delete_option( 'ast-settings' ); - } - - /** - * Update options of older version than 1.0.8. - * - * @since 1.0.8 - */ - public static function v_1_0_8() { - - $options = array( - 'body-line-height', - - // Addon Options. - 'footer-adv-wgt-title-line-height', - 'footer-adv-wgt-content-line-height', - 'line-height-related-post', - 'title-bar-title-line-height', - 'title-bar-breadcrumb-line-height', - 'line-height-page-title', - 'line-height-post-meta', - 'line-height-h1', - 'line-height-h2', - 'line-height-h3', - 'line-height-h4', - 'line-height-h5', - 'line-height-h6', - 'line-height-footer-content', - 'line-height-site-title', - 'line-height-site-tagline', - 'line-height-primary-menu', - 'line-height-primary-dropdown-menu', - 'line-height-widget-title', - 'line-height-widget-content', - 'line-height-entry-title', - ); - - $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); - - if ( 0 < count( $astra_options ) ) { - foreach ( $options as $key ) { - - if ( array_key_exists( $key, $astra_options ) && is_array( $astra_options[ $key ] ) ) { - - if ( in_array( $astra_options[ $key ]['desktop-unit'], array( '', 'em' ) ) ) { - $astra_options[ $key ] = $astra_options[ $key ]['desktop']; - } else { - $astra_options[ $key ] = ''; - } - } - } - } - - update_option( ASTRA_THEME_SETTINGS, $astra_options ); - } - - /** - * Update options of older version than 1.0.12. - * - * @since 1.0.12 - */ - public static function v_1_0_12() { - - $options = array( - 'site-content-layout' => 'plain-container', - 'single-page-content-layout' => 'plain-container', - 'single-post-content-layout' => 'content-boxed-container', - 'archive-post-content-layout' => 'content-boxed-container', - ); - - $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); - - foreach ( $options as $key => $value ) { - if ( ! isset( $astra_options[ $key ] ) ) { - $astra_options[ $key ] = $value; - } - } - - update_option( ASTRA_THEME_SETTINGS, $astra_options ); - } - - /** - * Update options of older version than 1.0.14. - * - * @since 1.0.14 - * @return void - */ - public static function v_1_0_14() { - - $options = array( - 'footer-sml-divider' => '4', - 'footer-sml-divider-color' => '#fff', - 'footer-adv' => 'layout-4', - 'single-page-sidebar-layout' => 'no-sidebar', - 'single-post-sidebar-layout' => 'right-sidebar', - 'archive-post-sidebar-layout' => 'right-sidebar', - ); - - $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); - - foreach ( $options as $key => $value ) { - if ( ! isset( $astra_options[ $key ] ) ) { - $astra_options[ $key ] = $value; - } - } - - update_option( ASTRA_THEME_SETTINGS, $astra_options ); - - update_option( '_astra_pb_compatibility_offset', 1 ); - update_option( '_astra_pb_compatibility_time', gmdate( 'Y-m-d H:i:s' ) ); - } - - /** - * Update page meta settings for all the themer layouts which are not already set. - * Default settings to previous versions was `no-sidebar` and `page-builder` through filters. - * - * @since 1.0.28 - * @return void - */ - public static function v_1_0_28() { - - $query = array( - 'post_type' => 'fl-theme-layout', - 'no_found_rows' => true, - 'post_status' => 'any', - 'fields' => 'ids', - ); - - // Execute the query. - $posts = new WP_Query( $query ); - - foreach ( $posts->posts as $id ) { - - $sidebar = get_post_meta( $id, 'site-sidebar-layout', true ); - - if ( '' == $sidebar ) { - update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' ); - } - - $content_layout = get_post_meta( $id, 'site-content-layout', true ); - - if ( '' == $content_layout ) { - update_post_meta( $id, 'site-content-layout', 'page-builder' ); - } - } - - } - - /** - * Update options of older version than 1.1.0-beta.3. - * - * @since 1.1.0-beta.3 - */ - public static function v_1_1_0_beta_3() { - - $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); - - if ( isset( $astra_options['shop-grid'] ) ) { - - $astra_options['shop-grids'] = array( - 'desktop' => $astra_options['shop-grid'], - 'tablet' => 2, - 'mobile' => 1, - ); - - unset( $astra_options['shop-grid'] ); - } - - update_option( ASTRA_THEME_SETTINGS, $astra_options ); - } - - /** - * Update options of older version than 1.1.0-beta.3. - * - * Container Style - * Sidebar - * Grid - * - * @since 1.1.0-beta.3 - */ - public static function v_1_1_0_beta_4() { - - $options = array( - 'woocommerce-content-layout' => 'default', - 'woocommerce-sidebar-layout' => 'default', - /* Shop */ - 'shop-grids' => array( - 'desktop' => 3, - 'tablet' => 2, - 'mobile' => 1, - ), - 'shop-no-of-products' => '9', - ); - - $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); - - foreach ( $options as $key => $value ) { - if ( ! isset( $astra_options[ $key ] ) ) { - $astra_options[ $key ] = $value; - } - } - - update_option( ASTRA_THEME_SETTINGS, $astra_options ); - } - - /** - * Update options of older version than 1.2.2. - * - * Logo Width - * - * @since 1.2.2 - */ - public static function v_1_2_2() { - - $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); - - if ( isset( $astra_options['ast-header-logo-width'] ) && ! is_array( $astra_options['ast-header-logo-width'] ) ) { - $astra_options['ast-header-responsive-logo-width'] = array( - 'desktop' => $astra_options['ast-header-logo-width'], - 'tablet' => '', - 'mobile' => '', - ); - } - - if ( isset( $astra_options['blog-width'] ) ) { - $astra_options['shop-archive-width'] = $astra_options['blog-width']; - } - - if ( isset( $astra_options['blog-max-width'] ) ) { - $astra_options['shop-archive-max-width'] = $astra_options['blog-max-width']; - } - - update_option( ASTRA_THEME_SETTINGS, $astra_options ); - } - - /** - * Update Theme Color value same as Link Color for older version than 1.2.4. - * - * Theme Color update - * - * @since 1.2.4 - */ - public static function v_1_2_4() { - - $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); - - if ( isset( $astra_options['link-color'] ) ) { - $astra_options['theme-color'] = $astra_options['link-color']; - } - - update_option( ASTRA_THEME_SETTINGS, $astra_options ); - } - - /** - * Update Google Fonts value with font categories - * - * Google Font Update - * - * @since 1.2.7 - */ - public static function v_1_2_7() { - - $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); - $google_fonts = Astra_Font_Families::get_google_fonts(); - - foreach ( $astra_options as $key => $value ) { - - if ( ! is_array( $value ) && ! empty( $value ) && ! is_bool( $value ) ) { - - if ( array_key_exists( $value, $google_fonts ) ) { - $astra_options[ $key ] = "'" . $value . "', " . $google_fonts[ $value ][1]; - } - } - } - - update_option( ASTRA_THEME_SETTINGS, $astra_options ); - } - - /** - * Update options of older version than 1.3.0. - * - * Background options - * - * @since 1.3.0 - */ - public static function v_1_3_0() { - $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); - - $astra_options['header-bg-obj'] = array( - 'background-color' => isset( $astra_options['header-bg-color'] ) ? $astra_options['header-bg-color'] : '', - ); - - $astra_options['content-bg-obj'] = array( - 'background-color' => isset( $astra_options['content-bg-color'] ) ? $astra_options['content-bg-color'] : '#ffffff', - ); - - $astra_options['footer-adv-bg-obj'] = array( - 'background-color' => isset( $astra_options['footer-adv-bg-color'] ) ? $astra_options['footer-adv-bg-color'] : '', - 'background-image' => isset( $astra_options['footer-adv-bg-img'] ) ? $astra_options['footer-adv-bg-img'] : '', - 'background-repeat' => isset( $astra_options['footer-adv-bg-repeat'] ) ? $astra_options['footer-adv-bg-repeat'] : 'no-repeat', - 'background-position' => isset( $astra_options['footer-adv-bg-pos'] ) ? $astra_options['footer-adv-bg-pos'] : 'center center', - 'background-size' => isset( $astra_options['footer-adv-bg-size'] ) ? $astra_options['footer-adv-bg-size'] : 'cover', - 'background-attachment' => isset( $astra_options['footer-adv-bg-attac'] ) ? $astra_options['footer-adv-bg-attac'] : 'scroll', - ); - - $astra_options['footer-bg-obj'] = array( - 'background-color' => isset( $astra_options['footer-bg-color'] ) ? $astra_options['footer-bg-color'] : '', - 'background-image' => isset( $astra_options['footer-bg-img'] ) ? $astra_options['footer-bg-img'] : '', - 'background-repeat' => isset( $astra_options['footer-bg-rep'] ) ? $astra_options['footer-bg-rep'] : 'repeat', - 'background-position' => isset( $astra_options['footer-bg-pos'] ) ? $astra_options['footer-bg-pos'] : 'center center', - 'background-size' => isset( $astra_options['footer-bg-size'] ) ? $astra_options['footer-bg-size'] : 'auto', - 'background-attachment' => isset( $astra_options['footer-bg-atch'] ) ? $astra_options['footer-bg-atch'] : 'scroll', - ); - - // Site layout background image and color. - $site_layout = isset( $astra_options['site-layout'] ) ? $astra_options['site-layout'] : ''; - switch ( $site_layout ) { - case 'ast-box-layout': - $astra_options['site-layout-outside-bg-obj'] = array( - 'background-color' => isset( $astra_options['site-layout-outside-bg-color'] ) ? $astra_options['site-layout-outside-bg-color'] : '', - 'background-image' => isset( $astra_options['site-layout-box-bg-img'] ) ? $astra_options['site-layout-box-bg-img'] : '', - 'background-repeat' => isset( $astra_options['site-layout-box-bg-rep'] ) ? $astra_options['site-layout-box-bg-rep'] : 'no-repeat', - 'background-position' => isset( $astra_options['site-layout-box-bg-pos'] ) ? $astra_options['site-layout-box-bg-pos'] : 'center center', - 'background-size' => isset( $astra_options['site-layout-box-bg-size'] ) ? $astra_options['site-layout-box-bg-size'] : 'cover', - 'background-attachment' => isset( $astra_options['site-layout-box-bg-atch'] ) ? $astra_options['site-layout-box-bg-atch'] : 'scroll', - ); - break; - - case 'ast-padded-layout': - $bg_color = isset( $astra_options['site-layout-outside-bg-color'] ) ? $astra_options['site-layout-outside-bg-color'] : ''; - $bg_image = isset( $astra_options['site-layout-padded-bg-img'] ) ? $astra_options['site-layout-padded-bg-img'] : ''; - - $astra_options['site-layout-outside-bg-obj'] = array( - 'background-color' => empty( $bg_image ) ? $bg_color : '', - 'background-image' => $bg_image, - 'background-repeat' => isset( $astra_options['site-layout-padded-bg-rep'] ) ? $astra_options['site-layout-padded-bg-rep'] : 'no-repeat', - 'background-position' => isset( $astra_options['site-layout-padded-bg-pos'] ) ? $astra_options['site-layout-padded-bg-pos'] : 'center center', - 'background-size' => isset( $astra_options['site-layout-padded-bg-size'] ) ? $astra_options['site-layout-padded-bg-size'] : 'cover', - 'background-attachment' => '', - ); - break; - - case 'ast-full-width-layout': - case 'ast-fluid-width-layout': - default: - $astra_options['site-layout-outside-bg-obj'] = array( - 'background-color' => isset( $astra_options['site-layout-outside-bg-color'] ) ? $astra_options['site-layout-outside-bg-color'] : '', - ); - break; - } - - update_option( ASTRA_THEME_SETTINGS, $astra_options ); - } - - /** - * Mobile Header - Border new param introduced for Top, Right, Bottom and left border. - * Update options of older version than 1.4.0-beta.3. - * - * @since 1.4.0-beta.3 - */ - public static function v_1_4_0_beta_3() { - - $theme_options = get_option( 'astra-settings' ); - $mobile_logo_width = astra_get_option( 'mobile-header-logo-width' ); - - if ( '' != $mobile_logo_width ) { - $theme_options['ast-header-responsive-logo-width']['tablet'] = $mobile_logo_width; - } - - $mobile_logo = ( isset( $theme_options['mobile-header-logo'] ) && '' !== $theme_options['mobile-header-logo'] ) ? $theme_options['mobile-header-logo'] : false; - - if ( '' != $mobile_logo ) { - $theme_options['inherit-sticky-logo'] = false; - } - - update_option( 'astra-settings', $theme_options ); - } - - /** - * Introduced different logo for mobile devices option - * - * @since 1.4.0-beta.4 - */ - public static function v_1_4_0_beta_4() { - - $mobile_header_logo = astra_get_option( 'mobile-header-logo' ); - $theme_options = get_option( 'astra-settings' ); - - if ( '' != $mobile_header_logo ) { - $theme_options['different-mobile-logo'] = true; - } - - update_option( 'astra-settings', $theme_options ); - } - - /** - * Function to backward compatibility for version less than 1.4.0 - * - * @since 1.4.0-beta.5 - */ - public static function v_1_4_0_beta_5() { - - // Set default toggle button style. - $theme_options = get_option( 'astra-settings' ); - - if ( ! isset( $theme_options['mobile-header-toggle-btn-style'] ) ) { - $theme_options['mobile-header-toggle-btn-style'] = 'fill'; - } - - $theme_options['hide-custom-menu-mobile'] = 0; - - update_option( 'astra-settings', $theme_options ); - - } - - /** - * Function to backward compatibility for version less than 1.4.3 - * Set the new option different-retina-logo to true for users who are already using a retina logo. - * - * @since 1.4.3-aplha.1 - */ - public static function v_1_4_3_alpha_1() { - - $mobile_header_logo = astra_get_option( 'ast-header-retina-logo' ); - $theme_options = get_option( 'astra-settings' ); - - if ( '' != $mobile_header_logo ) { - $theme_options['different-retina-logo'] = '1'; - } - - update_option( 'astra-settings', $theme_options ); - } - - /** - * Manage backwards compatibility when migrating to v1.4.9 - * - * @since 1.4.9 - * @return void - */ - public static function v_1_4_9() { - $theme_options = get_option( 'astra-settings' ); - - // Set flag to use anchors CSS selectors in the CSS for headings. - if ( ! isset( $theme_options['include-headings-in-typography'] ) ) { - $theme_options['include-headings-in-typography'] = true; - update_option( 'astra-settings', $theme_options ); - } - } - - /** - * Added Submenu Border options into theme from Addon - * - * @since 1.5.0-beta.4 - * - * @return void - */ - public static function v_1_5_0_beta_4() { - - $border_disabled_values = array( - 'top' => '0', - 'bottom' => '0', - 'left' => '0', - 'right' => '0', - ); - $inside_border_disabled_values = array( - 'bottom' => '0', - ); - - $border_enabled_values = array( - 'top' => '1', - 'bottom' => '1', - 'left' => '1', - 'right' => '1', - ); - $inside_border_enabled_values = array( - 'bottom' => '1', - ); - - $theme_options = get_option( 'astra-settings' ); - $submenu_border = isset( $theme_options['primary-submenu-border'] ) ? $theme_options['primary-submenu-border'] : true; - - // Primary Header. - if ( $submenu_border ) { - $theme_options['primary-submenu-border'] = $border_enabled_values; - $theme_options['primary-submenu-item-border'] = $inside_border_enabled_values; - } else { - $theme_options['primary-submenu-border'] = $border_disabled_values; - $theme_options['primary-submenu-item-border'] = $inside_border_disabled_values; - } - - update_option( 'astra-settings', $theme_options ); - } - - /** - * Set flag 'submenu-below-header' to false to load fallback CSS to force menu load right after the container cropping logo and header. - * - * @see https://github.com/brainstormforce/astra/pull/820/ - * - * @return void - */ - public static function v_1_5_0_rc_1() { - $theme_options = get_option( 'astra-settings' ); - - // Set flag to use anchors CSS selectors in the CSS for headings. - if ( ! isset( $theme_options['submenu-below-header'] ) ) { - $theme_options['submenu-below-header'] = false; - update_option( 'astra-settings', $theme_options ); - } - } - - /** - * Set Primary Header submenu border color 'primary-submenu-b-color' to '#eaeaea' for old users who doesn't set any color and set the theme color who install the fresh 1.5.0-rc.3 theme. - * - * @see https://github.com/brainstormforce/astra/pull/835 - * - * @return void - */ - public static function v_1_5_0_rc_3() { - - $theme_options = get_option( 'astra-settings' ); - - // Set the default #eaeaea sub menu border color who doesn't set any color. - if ( ! isset( $theme_options['primary-submenu-b-color'] ) || empty( $theme_options['primary-submenu-b-color'] ) ) { - $theme_options['primary-submenu-b-color'] = '#eaeaea'; - } - - // Set the primary sub menu animation to default for existing user. - if ( ! isset( $theme_options['header-main-submenu-container-animation'] ) ) { - $theme_options['header-main-submenu-container-animation'] = ''; - } - - update_option( 'astra-settings', $theme_options ); - - } - - /** - * Change the Primary submenu option to be checkbpx rather than border selection. - * - * @return void - */ - public static function v_1_5_1() { - $theme_options = get_option( 'astra-settings', array() ); - $primary_submenu_otem_border = isset( $theme_options['primary-submenu-item-border'] ) ? $theme_options['primary-submenu-item-border'] : array(); - - if ( is_array( $primary_submenu_otem_border ) && '0' != $primary_submenu_otem_border['bottom'] ) { - $theme_options['primary-submenu-item-border'] = 1; - } else { - $theme_options['primary-submenu-item-border'] = 0; - } - if ( isset( $theme_options['primary-submenu-b-color'] ) && ! empty( $theme_options['primary-submenu-b-color'] ) ) { - $theme_options['primary-submenu-item-b-color'] = $theme_options['primary-submenu-b-color']; - } - - update_option( 'astra-settings', $theme_options ); - } - - /** - * Add same font variant as font weight for body and heading. - * - * @return void - */ - public static function v_1_5_2() { - $theme_options = get_option( 'astra-settings', array() ); - if ( isset( $theme_options['body-font-weight'] ) && is_numeric( $theme_options['body-font-weight'] ) ) { - $theme_options['body-font-variant'] = $theme_options['body-font-weight']; - } - if ( isset( $theme_options['headings-font-weight'] ) && is_numeric( $theme_options['headings-font-weight'] ) ) { - $theme_options['headings-font-variant'] = $theme_options['headings-font-weight']; - } - - update_option( 'astra-settings', $theme_options ); - } - - /** - * Disable transparent header in customizer if the transparent header addon was disabled. - * - * @return void - */ - public static function v_1_6_0() { - $theme_options = get_option( 'astra-settings', array() ); - - // Disable Transparent header is Transparent Header addon was deactivated from Astra Pro. - if ( is_callable( 'Astra_Ext_Extension::get_enabled_addons' ) ) { - $addons = Astra_Ext_Extension::get_enabled_addons(); - - // If transparent header is addon was disabled, disable the transparent header. - if ( 'transparent-header' !== $addons['transparent-header'] ) { - $theme_options['transparent-header-enable'] = 0; - } - } - - update_option( 'astra-settings', $theme_options ); - } - - /** - * Add backward compatibility for Heading tags previous default values. - * Set Inline Logo & Site Title as false if user had not changed its value. - * Change default value for blog archive blog title. - * - * @return void - */ - public static function v_1_6_1() { - $theme_options = get_option( 'astra-settings', array() ); - - // If user was using a default value for h1, Set the default in the option. - if ( ! isset( $theme_options['font-size-h1'] ) ) { - $theme_options['font-size-h1'] = array( - 'desktop' => '48', - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ); - } - // If user was using a default value for h2, Set the default in the option. - if ( ! isset( $theme_options['font-size-h2'] ) ) { - $theme_options['font-size-h2'] = array( - 'desktop' => '42', - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ); - } - // If user was using a default value for h3, Set the default in the option. - if ( ! isset( $theme_options['font-size-h3'] ) ) { - $theme_options['font-size-h3'] = array( - 'desktop' => '30', - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ); - } - - // If user was using a default value for h3, Set the default in the option. - if ( ! isset( $theme_options['font-size-page-title'] ) ) { - $theme_options['font-size-page-title'] = array( - 'desktop' => '30', - 'tablet' => '', - 'mobile' => '', - 'desktop-unit' => 'px', - 'tablet-unit' => 'px', - 'mobile-unit' => 'px', - ); - } - - // If inline-logo option was unset previously, set to to false as new default is `true`. - if ( ! isset( $theme_options['logo-title-inline'] ) ) { - $theme_options['logo-title-inline'] = 0; - } - - update_option( 'astra-settings', $theme_options ); - } - - /** - * Flush bundled products After udpating to version 2.0.0 - * - * @return void - */ - public static function v_2_0_0() { - update_site_option( 'bsf_force_check_extensions', true ); - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_Theme_Update::get_instance(); +' ) ) { + self::v_1_0_8(); + } + + // Update to older version than 1.0.12 version. + if ( version_compare( $saved_version, '1.0.12', '<' ) ) { + self::v_1_0_12(); + } + + // Update to older version than 1.0.14 version. + if ( version_compare( $saved_version, '1.0.14', '<' ) ) { + self::v_1_0_14(); + } + + // Update astra meta settings for Beaver Themer Backwards Compatibility. + if ( version_compare( $saved_version, '1.0.28', '<' ) ) { + self::v_1_0_28(); + } + + // Update astra meta settings for Beaver Themer Backwards Compatibility. + if ( version_compare( $saved_version, '1.1.0-beta.3', '<' ) ) { + self::v_1_1_0_beta_3(); + } + + // Update astra meta settings for Beaver Themer Backwards Compatibility. + if ( version_compare( $saved_version, '1.1.0-beta.4', '<' ) ) { + self::v_1_1_0_beta_4(); + } + + // Update astra meta settings for Beaver Themer Backwards Compatibility. + if ( version_compare( $saved_version, '1.2.2', '<' ) ) { + self::v_1_2_2(); + } + + // Update astra Theme colors values same as Link color. + if ( version_compare( $saved_version, '1.2.4', '<' ) ) { + self::v_1_2_4(); + } + + // Update astra Google Fonts values with fallback font. + if ( version_compare( $saved_version, '1.2.7', '<' ) ) { + self::v_1_2_7(); + } + + // Update astra background image data. + if ( version_compare( $saved_version, '1.3.0', '<' ) ) { + self::v_1_3_0(); + } + + // Update astra setting for inherit site logo compatibility. + if ( version_compare( $saved_version, '1.4.0-beta.3', '<' ) ) { + self::v_1_4_0_beta_3(); + } + + if ( version_compare( $saved_version, '1.4.0-beta.4', '<' ) ) { + self::v_1_4_0_beta_4(); + } + + if ( version_compare( $saved_version, '1.4.0-beta.5', '<' ) ) { + self::v_1_4_0_beta_5(); + } + + if ( version_compare( $saved_version, '1.4.3-alpha.1', '<' ) ) { + self::v_1_4_3_alpha_1(); + } + + if ( version_compare( $saved_version, '1.4.9', '<' ) ) { + self::v_1_4_9(); + } + + if ( version_compare( $saved_version, '1.5.0-beta.4', '<' ) ) { + self::v_1_5_0_beta_4(); + } + + if ( version_compare( $saved_version, '1.5.0-rc.1', '<' ) ) { + self::v_1_5_0_rc_1(); + } + + if ( version_compare( $saved_version, '1.5.0', '<' ) ) { + self::v_1_5_0_rc_3(); + } + + if ( version_compare( $saved_version, '1.5.1', '<' ) ) { + self::v_1_5_1(); + } + + if ( version_compare( $saved_version, '1.5.2', '<' ) ) { + self::v_1_5_2(); + } + + if ( version_compare( $saved_version, '1.6.0', '<' ) ) { + self::v_1_6_0(); + } + + if ( version_compare( $saved_version, '1.6.1-alpha.3', '<' ) ) { + self::v_1_6_1(); + } + if ( version_compare( $saved_version, '2.0.0', '<' ) ) { + self::v_2_0_0(); + } + } + + /** + * Footer Widgets compatibilty for astra pro. + */ + public static function astra_pro_compatibility() { + + if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '1.0.0-beta.6', '<' ) ) { + remove_action( 'astra_footer_content', 'astra_advanced_footer_markup', 1 ); + } + } + + /** + * Update options of older version than 1.0.4. + * + * @since 1.0.4 + */ + public static function v_1_0_4() { + + $options = array( + 'font-size-body', + 'body-line-height', + 'font-size-site-title', + 'font-size-site-tagline', + 'font-size-entry-title', + 'font-size-page-title', + 'font-size-h1', + 'font-size-h2', + 'font-size-h3', + 'font-size-h4', + 'font-size-h5', + 'font-size-h6', + + // Addon Options. + 'footer-adv-wgt-title-font-size', + 'footer-adv-wgt-title-line-height', + 'footer-adv-wgt-content-font-size', + 'footer-adv-wgt-content-line-height', + 'above-header-font-size', + 'font-size-below-header-primary-menu', + 'font-size-below-header-dropdown-menu', + 'font-size-below-header-content', + 'font-size-related-post', + 'line-height-related-post', + 'title-bar-title-font-size', + 'title-bar-title-line-height', + 'title-bar-breadcrumb-font-size', + 'title-bar-breadcrumb-line-height', + 'line-height-page-title', + 'font-size-post-meta', + 'line-height-post-meta', + 'font-size-post-pagination', + 'line-height-h1', + 'line-height-h2', + 'line-height-h3', + 'line-height-h4', + 'line-height-h5', + 'line-height-h6', + 'font-size-footer-content', + 'line-height-footer-content', + 'line-height-site-title', + 'line-height-site-tagline', + 'font-size-primary-menu', + 'line-height-primary-menu', + 'font-size-primary-dropdown-menu', + 'line-height-primary-dropdown-menu', + 'font-size-widget-title', + 'line-height-widget-title', + 'font-size-widget-content', + 'line-height-widget-content', + 'line-height-entry-title', + ); + + $astra_options = get_option( 'ast-settings', array() ); + + if ( 0 < count( $astra_options ) ) { + foreach ( $options as $key ) { + + if ( array_key_exists( $key, $astra_options ) && ! is_array( $astra_options[ $key ] ) ) { + + $astra_options[ $key ] = array( + 'desktop' => $astra_options[ $key ], + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ); + } + } + } + + update_option( 'ast-settings', $astra_options ); + } + + /** + * Update options of older version than 1.0.5. + * + * @since 1.0.5 + */ + public static function v_1_0_5() { + + $astra_old_options = get_option( 'ast-settings', array() ); + $astra_new_options = get_option( ASTRA_THEME_SETTINGS, array() ); + + // Merge old customizer options in new option. + $astra_options = wp_parse_args( $astra_new_options, $astra_old_options ); + + // Update option. + update_option( ASTRA_THEME_SETTINGS, $astra_options ); + + // Delete old option. + delete_option( 'ast-settings' ); + } + + /** + * Update options of older version than 1.0.8. + * + * @since 1.0.8 + */ + public static function v_1_0_8() { + + $options = array( + 'body-line-height', + + // Addon Options. + 'footer-adv-wgt-title-line-height', + 'footer-adv-wgt-content-line-height', + 'line-height-related-post', + 'title-bar-title-line-height', + 'title-bar-breadcrumb-line-height', + 'line-height-page-title', + 'line-height-post-meta', + 'line-height-h1', + 'line-height-h2', + 'line-height-h3', + 'line-height-h4', + 'line-height-h5', + 'line-height-h6', + 'line-height-footer-content', + 'line-height-site-title', + 'line-height-site-tagline', + 'line-height-primary-menu', + 'line-height-primary-dropdown-menu', + 'line-height-widget-title', + 'line-height-widget-content', + 'line-height-entry-title', + ); + + $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); + + if ( 0 < count( $astra_options ) ) { + foreach ( $options as $key ) { + + if ( array_key_exists( $key, $astra_options ) && is_array( $astra_options[ $key ] ) ) { + + if ( in_array( $astra_options[ $key ]['desktop-unit'], array( '', 'em' ) ) ) { + $astra_options[ $key ] = $astra_options[ $key ]['desktop']; + } else { + $astra_options[ $key ] = ''; + } + } + } + } + + update_option( ASTRA_THEME_SETTINGS, $astra_options ); + } + + /** + * Update options of older version than 1.0.12. + * + * @since 1.0.12 + */ + public static function v_1_0_12() { + + $options = array( + 'site-content-layout' => 'plain-container', + 'single-page-content-layout' => 'plain-container', + 'single-post-content-layout' => 'content-boxed-container', + 'archive-post-content-layout' => 'content-boxed-container', + ); + + $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); + + foreach ( $options as $key => $value ) { + if ( ! isset( $astra_options[ $key ] ) ) { + $astra_options[ $key ] = $value; + } + } + + update_option( ASTRA_THEME_SETTINGS, $astra_options ); + } + + /** + * Update options of older version than 1.0.14. + * + * @since 1.0.14 + * @return void + */ + public static function v_1_0_14() { + + $options = array( + 'footer-sml-divider' => '4', + 'footer-sml-divider-color' => '#fff', + 'footer-adv' => 'layout-4', + 'single-page-sidebar-layout' => 'no-sidebar', + 'single-post-sidebar-layout' => 'right-sidebar', + 'archive-post-sidebar-layout' => 'right-sidebar', + ); + + $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); + + foreach ( $options as $key => $value ) { + if ( ! isset( $astra_options[ $key ] ) ) { + $astra_options[ $key ] = $value; + } + } + + update_option( ASTRA_THEME_SETTINGS, $astra_options ); + + update_option( '_astra_pb_compatibility_offset', 1 ); + update_option( '_astra_pb_compatibility_time', gmdate( 'Y-m-d H:i:s' ) ); + } + + /** + * Update page meta settings for all the themer layouts which are not already set. + * Default settings to previous versions was `no-sidebar` and `page-builder` through filters. + * + * @since 1.0.28 + * @return void + */ + public static function v_1_0_28() { + + $query = array( + 'post_type' => 'fl-theme-layout', + 'no_found_rows' => true, + 'post_status' => 'any', + 'fields' => 'ids', + ); + + // Execute the query. + $posts = new WP_Query( $query ); + + foreach ( $posts->posts as $id ) { + + $sidebar = get_post_meta( $id, 'site-sidebar-layout', true ); + + if ( '' == $sidebar ) { + update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' ); + } + + $content_layout = get_post_meta( $id, 'site-content-layout', true ); + + if ( '' == $content_layout ) { + update_post_meta( $id, 'site-content-layout', 'page-builder' ); + } + } + + } + + /** + * Update options of older version than 1.1.0-beta.3. + * + * @since 1.1.0-beta.3 + */ + public static function v_1_1_0_beta_3() { + + $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); + + if ( isset( $astra_options['shop-grid'] ) ) { + + $astra_options['shop-grids'] = array( + 'desktop' => $astra_options['shop-grid'], + 'tablet' => 2, + 'mobile' => 1, + ); + + unset( $astra_options['shop-grid'] ); + } + + update_option( ASTRA_THEME_SETTINGS, $astra_options ); + } + + /** + * Update options of older version than 1.1.0-beta.3. + * + * Container Style + * Sidebar + * Grid + * + * @since 1.1.0-beta.3 + */ + public static function v_1_1_0_beta_4() { + + $options = array( + 'woocommerce-content-layout' => 'default', + 'woocommerce-sidebar-layout' => 'default', + /* Shop */ + 'shop-grids' => array( + 'desktop' => 3, + 'tablet' => 2, + 'mobile' => 1, + ), + 'shop-no-of-products' => '9', + ); + + $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); + + foreach ( $options as $key => $value ) { + if ( ! isset( $astra_options[ $key ] ) ) { + $astra_options[ $key ] = $value; + } + } + + update_option( ASTRA_THEME_SETTINGS, $astra_options ); + } + + /** + * Update options of older version than 1.2.2. + * + * Logo Width + * + * @since 1.2.2 + */ + public static function v_1_2_2() { + + $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); + + if ( isset( $astra_options['ast-header-logo-width'] ) && ! is_array( $astra_options['ast-header-logo-width'] ) ) { + $astra_options['ast-header-responsive-logo-width'] = array( + 'desktop' => $astra_options['ast-header-logo-width'], + 'tablet' => '', + 'mobile' => '', + ); + } + + if ( isset( $astra_options['blog-width'] ) ) { + $astra_options['shop-archive-width'] = $astra_options['blog-width']; + } + + if ( isset( $astra_options['blog-max-width'] ) ) { + $astra_options['shop-archive-max-width'] = $astra_options['blog-max-width']; + } + + update_option( ASTRA_THEME_SETTINGS, $astra_options ); + } + + /** + * Update Theme Color value same as Link Color for older version than 1.2.4. + * + * Theme Color update + * + * @since 1.2.4 + */ + public static function v_1_2_4() { + + $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); + + if ( isset( $astra_options['link-color'] ) ) { + $astra_options['theme-color'] = $astra_options['link-color']; + } + + update_option( ASTRA_THEME_SETTINGS, $astra_options ); + } + + /** + * Update Google Fonts value with font categories + * + * Google Font Update + * + * @since 1.2.7 + */ + public static function v_1_2_7() { + + $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); + $google_fonts = Astra_Font_Families::get_google_fonts(); + + foreach ( $astra_options as $key => $value ) { + + if ( ! is_array( $value ) && ! empty( $value ) && ! is_bool( $value ) ) { + + if ( array_key_exists( $value, $google_fonts ) ) { + $astra_options[ $key ] = "'" . $value . "', " . $google_fonts[ $value ][1]; + } + } + } + + update_option( ASTRA_THEME_SETTINGS, $astra_options ); + } + + /** + * Update options of older version than 1.3.0. + * + * Background options + * + * @since 1.3.0 + */ + public static function v_1_3_0() { + $astra_options = get_option( ASTRA_THEME_SETTINGS, array() ); + + $astra_options['header-bg-obj'] = array( + 'background-color' => isset( $astra_options['header-bg-color'] ) ? $astra_options['header-bg-color'] : '', + ); + + $astra_options['content-bg-obj'] = array( + 'background-color' => isset( $astra_options['content-bg-color'] ) ? $astra_options['content-bg-color'] : '#ffffff', + ); + + $astra_options['footer-adv-bg-obj'] = array( + 'background-color' => isset( $astra_options['footer-adv-bg-color'] ) ? $astra_options['footer-adv-bg-color'] : '', + 'background-image' => isset( $astra_options['footer-adv-bg-img'] ) ? $astra_options['footer-adv-bg-img'] : '', + 'background-repeat' => isset( $astra_options['footer-adv-bg-repeat'] ) ? $astra_options['footer-adv-bg-repeat'] : 'no-repeat', + 'background-position' => isset( $astra_options['footer-adv-bg-pos'] ) ? $astra_options['footer-adv-bg-pos'] : 'center center', + 'background-size' => isset( $astra_options['footer-adv-bg-size'] ) ? $astra_options['footer-adv-bg-size'] : 'cover', + 'background-attachment' => isset( $astra_options['footer-adv-bg-attac'] ) ? $astra_options['footer-adv-bg-attac'] : 'scroll', + ); + + $astra_options['footer-bg-obj'] = array( + 'background-color' => isset( $astra_options['footer-bg-color'] ) ? $astra_options['footer-bg-color'] : '', + 'background-image' => isset( $astra_options['footer-bg-img'] ) ? $astra_options['footer-bg-img'] : '', + 'background-repeat' => isset( $astra_options['footer-bg-rep'] ) ? $astra_options['footer-bg-rep'] : 'repeat', + 'background-position' => isset( $astra_options['footer-bg-pos'] ) ? $astra_options['footer-bg-pos'] : 'center center', + 'background-size' => isset( $astra_options['footer-bg-size'] ) ? $astra_options['footer-bg-size'] : 'auto', + 'background-attachment' => isset( $astra_options['footer-bg-atch'] ) ? $astra_options['footer-bg-atch'] : 'scroll', + ); + + // Site layout background image and color. + $site_layout = isset( $astra_options['site-layout'] ) ? $astra_options['site-layout'] : ''; + switch ( $site_layout ) { + case 'ast-box-layout': + $astra_options['site-layout-outside-bg-obj'] = array( + 'background-color' => isset( $astra_options['site-layout-outside-bg-color'] ) ? $astra_options['site-layout-outside-bg-color'] : '', + 'background-image' => isset( $astra_options['site-layout-box-bg-img'] ) ? $astra_options['site-layout-box-bg-img'] : '', + 'background-repeat' => isset( $astra_options['site-layout-box-bg-rep'] ) ? $astra_options['site-layout-box-bg-rep'] : 'no-repeat', + 'background-position' => isset( $astra_options['site-layout-box-bg-pos'] ) ? $astra_options['site-layout-box-bg-pos'] : 'center center', + 'background-size' => isset( $astra_options['site-layout-box-bg-size'] ) ? $astra_options['site-layout-box-bg-size'] : 'cover', + 'background-attachment' => isset( $astra_options['site-layout-box-bg-atch'] ) ? $astra_options['site-layout-box-bg-atch'] : 'scroll', + ); + break; + + case 'ast-padded-layout': + $bg_color = isset( $astra_options['site-layout-outside-bg-color'] ) ? $astra_options['site-layout-outside-bg-color'] : ''; + $bg_image = isset( $astra_options['site-layout-padded-bg-img'] ) ? $astra_options['site-layout-padded-bg-img'] : ''; + + $astra_options['site-layout-outside-bg-obj'] = array( + 'background-color' => empty( $bg_image ) ? $bg_color : '', + 'background-image' => $bg_image, + 'background-repeat' => isset( $astra_options['site-layout-padded-bg-rep'] ) ? $astra_options['site-layout-padded-bg-rep'] : 'no-repeat', + 'background-position' => isset( $astra_options['site-layout-padded-bg-pos'] ) ? $astra_options['site-layout-padded-bg-pos'] : 'center center', + 'background-size' => isset( $astra_options['site-layout-padded-bg-size'] ) ? $astra_options['site-layout-padded-bg-size'] : 'cover', + 'background-attachment' => '', + ); + break; + + case 'ast-full-width-layout': + case 'ast-fluid-width-layout': + default: + $astra_options['site-layout-outside-bg-obj'] = array( + 'background-color' => isset( $astra_options['site-layout-outside-bg-color'] ) ? $astra_options['site-layout-outside-bg-color'] : '', + ); + break; + } + + update_option( ASTRA_THEME_SETTINGS, $astra_options ); + } + + /** + * Mobile Header - Border new param introduced for Top, Right, Bottom and left border. + * Update options of older version than 1.4.0-beta.3. + * + * @since 1.4.0-beta.3 + */ + public static function v_1_4_0_beta_3() { + + $theme_options = get_option( 'astra-settings' ); + $mobile_logo_width = astra_get_option( 'mobile-header-logo-width' ); + + if ( '' != $mobile_logo_width ) { + $theme_options['ast-header-responsive-logo-width']['tablet'] = $mobile_logo_width; + } + + $mobile_logo = ( isset( $theme_options['mobile-header-logo'] ) && '' !== $theme_options['mobile-header-logo'] ) ? $theme_options['mobile-header-logo'] : false; + + if ( '' != $mobile_logo ) { + $theme_options['inherit-sticky-logo'] = false; + } + + update_option( 'astra-settings', $theme_options ); + } + + /** + * Introduced different logo for mobile devices option + * + * @since 1.4.0-beta.4 + */ + public static function v_1_4_0_beta_4() { + + $mobile_header_logo = astra_get_option( 'mobile-header-logo' ); + $theme_options = get_option( 'astra-settings' ); + + if ( '' != $mobile_header_logo ) { + $theme_options['different-mobile-logo'] = true; + } + + update_option( 'astra-settings', $theme_options ); + } + + /** + * Function to backward compatibility for version less than 1.4.0 + * + * @since 1.4.0-beta.5 + */ + public static function v_1_4_0_beta_5() { + + // Set default toggle button style. + $theme_options = get_option( 'astra-settings' ); + + if ( ! isset( $theme_options['mobile-header-toggle-btn-style'] ) ) { + $theme_options['mobile-header-toggle-btn-style'] = 'fill'; + } + + $theme_options['hide-custom-menu-mobile'] = 0; + + update_option( 'astra-settings', $theme_options ); + + } + + /** + * Function to backward compatibility for version less than 1.4.3 + * Set the new option different-retina-logo to true for users who are already using a retina logo. + * + * @since 1.4.3-aplha.1 + */ + public static function v_1_4_3_alpha_1() { + + $mobile_header_logo = astra_get_option( 'ast-header-retina-logo' ); + $theme_options = get_option( 'astra-settings' ); + + if ( '' != $mobile_header_logo ) { + $theme_options['different-retina-logo'] = '1'; + } + + update_option( 'astra-settings', $theme_options ); + } + + /** + * Manage backwards compatibility when migrating to v1.4.9 + * + * @since 1.4.9 + * @return void + */ + public static function v_1_4_9() { + $theme_options = get_option( 'astra-settings' ); + + // Set flag to use anchors CSS selectors in the CSS for headings. + if ( ! isset( $theme_options['include-headings-in-typography'] ) ) { + $theme_options['include-headings-in-typography'] = true; + update_option( 'astra-settings', $theme_options ); + } + } + + /** + * Added Submenu Border options into theme from Addon + * + * @since 1.5.0-beta.4 + * + * @return void + */ + public static function v_1_5_0_beta_4() { + + $border_disabled_values = array( + 'top' => '0', + 'bottom' => '0', + 'left' => '0', + 'right' => '0', + ); + $inside_border_disabled_values = array( + 'bottom' => '0', + ); + + $border_enabled_values = array( + 'top' => '1', + 'bottom' => '1', + 'left' => '1', + 'right' => '1', + ); + $inside_border_enabled_values = array( + 'bottom' => '1', + ); + + $theme_options = get_option( 'astra-settings' ); + $submenu_border = isset( $theme_options['primary-submenu-border'] ) ? $theme_options['primary-submenu-border'] : true; + + // Primary Header. + if ( $submenu_border ) { + $theme_options['primary-submenu-border'] = $border_enabled_values; + $theme_options['primary-submenu-item-border'] = $inside_border_enabled_values; + } else { + $theme_options['primary-submenu-border'] = $border_disabled_values; + $theme_options['primary-submenu-item-border'] = $inside_border_disabled_values; + } + + update_option( 'astra-settings', $theme_options ); + } + + /** + * Set flag 'submenu-below-header' to false to load fallback CSS to force menu load right after the container cropping logo and header. + * + * @see https://github.com/brainstormforce/astra/pull/820/ + * + * @return void + */ + public static function v_1_5_0_rc_1() { + $theme_options = get_option( 'astra-settings' ); + + // Set flag to use anchors CSS selectors in the CSS for headings. + if ( ! isset( $theme_options['submenu-below-header'] ) ) { + $theme_options['submenu-below-header'] = false; + update_option( 'astra-settings', $theme_options ); + } + } + + /** + * Set Primary Header submenu border color 'primary-submenu-b-color' to '#eaeaea' for old users who doesn't set any color and set the theme color who install the fresh 1.5.0-rc.3 theme. + * + * @see https://github.com/brainstormforce/astra/pull/835 + * + * @return void + */ + public static function v_1_5_0_rc_3() { + + $theme_options = get_option( 'astra-settings' ); + + // Set the default #eaeaea sub menu border color who doesn't set any color. + if ( ! isset( $theme_options['primary-submenu-b-color'] ) || empty( $theme_options['primary-submenu-b-color'] ) ) { + $theme_options['primary-submenu-b-color'] = '#eaeaea'; + } + + // Set the primary sub menu animation to default for existing user. + if ( ! isset( $theme_options['header-main-submenu-container-animation'] ) ) { + $theme_options['header-main-submenu-container-animation'] = ''; + } + + update_option( 'astra-settings', $theme_options ); + + } + + /** + * Change the Primary submenu option to be checkbpx rather than border selection. + * + * @return void + */ + public static function v_1_5_1() { + $theme_options = get_option( 'astra-settings', array() ); + $primary_submenu_otem_border = isset( $theme_options['primary-submenu-item-border'] ) ? $theme_options['primary-submenu-item-border'] : array(); + + if ( is_array( $primary_submenu_otem_border ) && '0' != $primary_submenu_otem_border['bottom'] ) { + $theme_options['primary-submenu-item-border'] = 1; + } else { + $theme_options['primary-submenu-item-border'] = 0; + } + if ( isset( $theme_options['primary-submenu-b-color'] ) && ! empty( $theme_options['primary-submenu-b-color'] ) ) { + $theme_options['primary-submenu-item-b-color'] = $theme_options['primary-submenu-b-color']; + } + + update_option( 'astra-settings', $theme_options ); + } + + /** + * Add same font variant as font weight for body and heading. + * + * @return void + */ + public static function v_1_5_2() { + $theme_options = get_option( 'astra-settings', array() ); + if ( isset( $theme_options['body-font-weight'] ) && is_numeric( $theme_options['body-font-weight'] ) ) { + $theme_options['body-font-variant'] = $theme_options['body-font-weight']; + } + if ( isset( $theme_options['headings-font-weight'] ) && is_numeric( $theme_options['headings-font-weight'] ) ) { + $theme_options['headings-font-variant'] = $theme_options['headings-font-weight']; + } + + update_option( 'astra-settings', $theme_options ); + } + + /** + * Disable transparent header in customizer if the transparent header addon was disabled. + * + * @return void + */ + public static function v_1_6_0() { + $theme_options = get_option( 'astra-settings', array() ); + + // Disable Transparent header is Transparent Header addon was deactivated from Astra Pro. + if ( is_callable( 'Astra_Ext_Extension::get_enabled_addons' ) ) { + $addons = Astra_Ext_Extension::get_enabled_addons(); + + // If transparent header is addon was disabled, disable the transparent header. + if ( 'transparent-header' !== $addons['transparent-header'] ) { + $theme_options['transparent-header-enable'] = 0; + } + } + + update_option( 'astra-settings', $theme_options ); + } + + /** + * Add backward compatibility for Heading tags previous default values. + * Set Inline Logo & Site Title as false if user had not changed its value. + * Change default value for blog archive blog title. + * + * @return void + */ + public static function v_1_6_1() { + $theme_options = get_option( 'astra-settings', array() ); + + // If user was using a default value for h1, Set the default in the option. + if ( ! isset( $theme_options['font-size-h1'] ) ) { + $theme_options['font-size-h1'] = array( + 'desktop' => '48', + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ); + } + // If user was using a default value for h2, Set the default in the option. + if ( ! isset( $theme_options['font-size-h2'] ) ) { + $theme_options['font-size-h2'] = array( + 'desktop' => '42', + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ); + } + // If user was using a default value for h3, Set the default in the option. + if ( ! isset( $theme_options['font-size-h3'] ) ) { + $theme_options['font-size-h3'] = array( + 'desktop' => '30', + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ); + } + + // If user was using a default value for h3, Set the default in the option. + if ( ! isset( $theme_options['font-size-page-title'] ) ) { + $theme_options['font-size-page-title'] = array( + 'desktop' => '30', + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ); + } + + // If inline-logo option was unset previously, set to to false as new default is `true`. + if ( ! isset( $theme_options['logo-title-inline'] ) ) { + $theme_options['logo-title-inline'] = 0; + } + + update_option( 'astra-settings', $theme_options ); + } + + /** + * Flush bundled products After udpating to version 2.0.0 + * + * @return void + */ + public static function v_2_0_0() { + update_site_option( 'bsf_force_check_extensions', true ); + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_Theme_Update::get_instance(); diff --git a/inc/theme-update/class-astra-theme-wp-background-process.php b/inc/theme-update/class-astra-theme-wp-background-process.php index 0b334f1..a19661b 100644 --- a/inc/theme-update/class-astra-theme-wp-background-process.php +++ b/inc/theme-update/class-astra-theme-wp-background-process.php @@ -1,68 +1,68 @@ - $tag ) { - if ( get_queried_object_id() === (int) $tags_data[ $key ]['id'] ) { - $tags_data[ $key ]['class'] = $tags_data[ $key ]['class'] . ' current-item'; - } - } - } - - return apply_filters( 'astra_filter_widget_tag_cloud', $tags_data ); - } - add_filter( 'wp_generate_tag_cloud_data', 'astra_filter_widget_tag_cloud' ); - -endif; - -/** - * Register widget area. - */ -if ( ! function_exists( 'astra_widgets_init' ) ) : - - /** - * Register widget area. - * - * @see https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar - */ - function astra_widgets_init() { - - /** - * Register Main Sidebar - */ - register_sidebar( - apply_filters( - 'astra_widgets_init', - array( - 'name' => esc_html__( 'Main Sidebar', 'astra' ), - 'id' => 'sidebar-1', - 'description' => '', - 'before_widget' => '', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - - /** - * Register Header Widgets area - */ - register_sidebar( - apply_filters( - 'astra_header_widgets_init', - array( - 'name' => esc_html__( 'Header', 'astra' ), - 'id' => 'header-widget', - 'description' => '', - 'before_widget' => '', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - - /** - * Register Footer Bar Widgets area - */ - register_sidebar( - apply_filters( - 'astra_footer_1_widgets_init', - array( - 'name' => esc_html__( 'Footer Bar Section 1', 'astra' ), - 'id' => 'footer-widget-1', - 'description' => '', - 'before_widget' => '', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - - register_sidebar( - apply_filters( - 'astra_footer_2_widgets_init', - array( - 'name' => esc_html__( 'Footer Bar Section 2', 'astra' ), - 'id' => 'footer-widget-2', - 'description' => '', - 'before_widget' => '', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - - /** - * Register Footer Widgets area - */ - register_sidebar( - apply_filters( - 'astra_advanced_footer_widget_1_args', - array( - 'name' => esc_html__( 'Footer Widget Area 1', 'astra' ), - 'id' => 'advanced-footer-widget-1', - 'before_widget' => '
    ', - 'after_widget' => '
    ', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - - register_sidebar( - apply_filters( - 'astra_advanced_footer_widget_2_args', - array( - 'name' => esc_html__( 'Footer Widget Area 2', 'astra' ), - 'id' => 'advanced-footer-widget-2', - 'before_widget' => '
    ', - 'after_widget' => '
    ', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - - register_sidebar( - apply_filters( - 'astra_advanced_footer_widget_3_args', - array( - 'name' => esc_html__( 'Footer Widget Area 3', 'astra' ), - 'id' => 'advanced-footer-widget-3', - 'before_widget' => '
    ', - 'after_widget' => '
    ', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - - register_sidebar( - apply_filters( - 'astra_advanced_footer_widget_4_args', - array( - 'name' => esc_html__( 'Footer Widget Area 4', 'astra' ), - 'id' => 'advanced-footer-widget-4', - 'before_widget' => '
    ', - 'after_widget' => '
    ', - 'before_title' => '

    ', - 'after_title' => '

    ', - ) - ) - ); - } - add_action( 'widgets_init', 'astra_widgets_init' ); - -endif; + $tag ) { + if ( get_queried_object_id() === (int) $tags_data[ $key ]['id'] ) { + $tags_data[ $key ]['class'] = $tags_data[ $key ]['class'] . ' current-item'; + } + } + } + + return apply_filters( 'astra_filter_widget_tag_cloud', $tags_data ); + } + add_filter( 'wp_generate_tag_cloud_data', 'astra_filter_widget_tag_cloud' ); + +endif; + +/** + * Register widget area. + */ +if ( ! function_exists( 'astra_widgets_init' ) ) : + + /** + * Register widget area. + * + * @see https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar + */ + function astra_widgets_init() { + + /** + * Register Main Sidebar + */ + register_sidebar( + apply_filters( + 'astra_widgets_init', + array( + 'name' => esc_html__( 'Main Sidebar', 'astra' ), + 'id' => 'sidebar-1', + 'description' => '', + 'before_widget' => '', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + + /** + * Register Header Widgets area + */ + register_sidebar( + apply_filters( + 'astra_header_widgets_init', + array( + 'name' => esc_html__( 'Header', 'astra' ), + 'id' => 'header-widget', + 'description' => '', + 'before_widget' => '', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + + /** + * Register Footer Bar Widgets area + */ + register_sidebar( + apply_filters( + 'astra_footer_1_widgets_init', + array( + 'name' => esc_html__( 'Footer Bar Section 1', 'astra' ), + 'id' => 'footer-widget-1', + 'description' => '', + 'before_widget' => '', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + + register_sidebar( + apply_filters( + 'astra_footer_2_widgets_init', + array( + 'name' => esc_html__( 'Footer Bar Section 2', 'astra' ), + 'id' => 'footer-widget-2', + 'description' => '', + 'before_widget' => '', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + + /** + * Register Footer Widgets area + */ + register_sidebar( + apply_filters( + 'astra_advanced_footer_widget_1_args', + array( + 'name' => esc_html__( 'Footer Widget Area 1', 'astra' ), + 'id' => 'advanced-footer-widget-1', + 'before_widget' => '
    ', + 'after_widget' => '
    ', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + + register_sidebar( + apply_filters( + 'astra_advanced_footer_widget_2_args', + array( + 'name' => esc_html__( 'Footer Widget Area 2', 'astra' ), + 'id' => 'advanced-footer-widget-2', + 'before_widget' => '
    ', + 'after_widget' => '
    ', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + + register_sidebar( + apply_filters( + 'astra_advanced_footer_widget_3_args', + array( + 'name' => esc_html__( 'Footer Widget Area 3', 'astra' ), + 'id' => 'advanced-footer-widget-3', + 'before_widget' => '
    ', + 'after_widget' => '
    ', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + + register_sidebar( + apply_filters( + 'astra_advanced_footer_widget_4_args', + array( + 'name' => esc_html__( 'Footer Widget Area 4', 'astra' ), + 'id' => 'advanced-footer-widget-4', + 'before_widget' => '
    ', + 'after_widget' => '
    ', + 'before_title' => '

    ', + 'after_title' => '

    ', + ) + ) + ); + } + add_action( 'widgets_init', 'astra_widgets_init' ); + +endif; diff --git a/index.php b/index.php index 96796a2..9e4da7d 100644 --- a/index.php +++ b/index.php @@ -1,44 +1,44 @@ - - - - - - -
    > - -
    - + + + + + +
    > + +
    + - - - - - - - -
    > - - - - - - - -
    - - - - - - - - + + + + + + + + +
    > + + + + + + + +
    + + + + + + + + diff --git a/search.php b/search.php index c469b5c..5c873a8 100644 --- a/search.php +++ b/search.php @@ -1,43 +1,43 @@ - - - - - - - - -
    > - - - - - - - - - - - -
    - - - - - - - - + + + + + + + + +
    > + + + + + + + + + + + +
    + + + + + + + + diff --git a/sidebar.php b/sidebar.php index f7c4322..03db710 100644 --- a/sidebar.php +++ b/sidebar.php @@ -1,39 +1,39 @@ - 'secondary', - 'class' => join( ' ', astra_get_secondary_class() ), - 'role' => 'complementary', - ) - ); - echo '>'; - ?> - - - + 'secondary', + 'class' => join( ' ', astra_get_secondary_class() ), + 'role' => 'complementary', + ) + ); + echo '>'; + ?> + + + diff --git a/single.php b/single.php index a283c1f..9d31d92 100644 --- a/single.php +++ b/single.php @@ -1,39 +1,39 @@ - - - - - - - - -
    > - - - - - - - -
    - - - - - - - - + + + + + + + + +
    > + + + + + + + +
    + + + + + + + + diff --git a/template-parts/404/404-layout.php b/template-parts/404/404-layout.php index bd57724..a80ea2e 100644 --- a/template-parts/404/404-layout.php +++ b/template-parts/404/404-layout.php @@ -1,28 +1,28 @@ - -
    'ast-404-layout-1' ) ); ?> > - -

    ', '

    ' ); ?> - -
    - -
    - -
    - - - -
    - + +
    'ast-404-layout-1' ) ); ?> > + +

    ', '

    ' ); ?> + +
    + +
    + +
    + + + +
    + diff --git a/template-parts/404/index.php b/template-parts/404/index.php index 8b96815..820bcb9 100644 --- a/template-parts/404/index.php +++ b/template-parts/404/index.php @@ -1,9 +1,9 @@ - - -
    - -
    + + +
    + +
    diff --git a/template-parts/blog/blog-layout.php b/template-parts/blog/blog-layout.php index 66acc03..660e953 100644 --- a/template-parts/blog/blog-layout.php +++ b/template-parts/blog/blog-layout.php @@ -1,42 +1,42 @@ - -
    > -
    - -
    '', - ) - ); - ?> - > - '', - 'link_before' => '', - 'link_after' => '', - ) - ); - ?> -
    -
    -
    + +
    > +
    + +
    '', + ) + ); + ?> + > + '', + 'link_before' => '', + 'link_after' => '', + ) + ); + ?> +
    +
    +
    diff --git a/template-parts/blog/index.php b/template-parts/blog/index.php index 8b96815..820bcb9 100644 --- a/template-parts/blog/index.php +++ b/template-parts/blog/index.php @@ -1,9 +1,9 @@ - - - - -
    - - - - - - - -
    - - + + + + +
    + + + + + + + +
    + + diff --git a/template-parts/content-blog.php b/template-parts/content-blog.php index 7992674..7276a01 100644 --- a/template-parts/content-blog.php +++ b/template-parts/content-blog.php @@ -1,28 +1,28 @@ - - -
    'post-' . get_the_id(), - 'class' => join( ' ', get_post_class() ), - ) - ); - ?> -> - - - -
    - + + +
    'post-' . get_the_id(), + 'class' => join( ' ', get_post_class() ), + ) + ); + ?> +> + + + +
    + diff --git a/template-parts/content-none.php b/template-parts/content-none.php index 56a9a14..cab9fe2 100644 --- a/template-parts/content-none.php +++ b/template-parts/content-none.php @@ -1,48 +1,48 @@ - - -
    -
    - - - -

    - Get started here.', 'astra' ), - array( - 'a' => array( - 'href' => array(), - ), - ) - ), - esc_url( admin_url( 'post-new.php' ) ) - ); - ?> -

    - - - -

    - - - - -

    - - - - -
    -
    + + +
    +
    + + + +

    + Get started here.', 'astra' ), + array( + 'a' => array( + 'href' => array(), + ), + ) + ), + esc_url( admin_url( 'post-new.php' ) ) + ); + ?> +

    + + + +

    + + + + +

    + + + + +
    +
    diff --git a/template-parts/content-page.php b/template-parts/content-page.php index 274f34c..9f07e4d 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -1,87 +1,87 @@ - - -
    'post-' . get_the_id(), - 'class' => join( ' ', get_post_class() ), - ) - ); - ?> -> - -
    - - - '', - ) - ) . '>', - '' - ); - ?> -
    - -
    '', - ) - ); - ?> - > - - - - - - - - '', - 'link_before' => '', - 'link_after' => '', - ) - ); - ?> - -
    - - "', '"', false ) - ), - '
    ', - '
    ' - ); - ?> - - - -
    - - + + +
    'post-' . get_the_id(), + 'class' => join( ' ', get_post_class() ), + ) + ); + ?> +> + +
    + + + '', + ) + ) . '>', + '' + ); + ?> +
    + +
    '', + ) + ); + ?> + > + + + + + + + + '', + 'link_before' => '', + 'link_after' => '', + ) + ); + ?> + +
    + + "', '"', false ) + ), + '
    ', + '
    ' + ); + ?> + + + +
    + + diff --git a/template-parts/content-single.php b/template-parts/content-single.php index 8fa2e65..bce22b0 100644 --- a/template-parts/content-single.php +++ b/template-parts/content-single.php @@ -1,35 +1,35 @@ - - - - -
    'post-' . get_the_id(), - 'class' => join( ' ', get_post_class() ), - ) - ); - ?> -> - - - - - - - -
    - - + + + + +
    'post-' . get_the_id(), + 'class' => join( ' ', get_post_class() ), + ) + ); + ?> +> + + + + + + + +
    + + diff --git a/template-parts/content.php b/template-parts/content.php index fe10036..d84563c 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -1,99 +1,99 @@ - - - - -
    'post-' . get_the_id(), - 'class' => join( ' ', get_post_class() ), - ) - ); - ?> -> - - -
    - - '', - ) - ) . '>', - esc_url( get_permalink() ) - ), - '' - ); - ?> - -
    - -
    '', - ) - ); - ?> - > - - - - →', - array( - 'span' => array( - 'class' => array(), - ), - ) - ), - the_title( '"', '"', false ) - ) - ); - ?> - - - - '', - 'link_before' => '', - 'link_after' => '', - ) - ); - ?> -
    - -
    - -
    - - - -
    - - + + + + +
    'post-' . get_the_id(), + 'class' => join( ' ', get_post_class() ), + ) + ); + ?> +> + + +
    + + '', + ) + ) . '>', + esc_url( get_permalink() ) + ), + '' + ); + ?> + +
    + +
    '', + ) + ); + ?> + > + + + + →', + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + the_title( '"', '"', false ) + ) + ); + ?> + + + + '', + 'link_before' => '', + 'link_after' => '', + ) + ); + ?> +
    + +
    + +
    + + + +
    + + diff --git a/template-parts/footer/footer-sml-layout-2.php b/template-parts/footer/footer-sml-layout-2.php index 65916e3..2d1bb15 100644 --- a/template-parts/footer/footer-sml-layout-2.php +++ b/template-parts/footer/footer-sml-layout-2.php @@ -1,64 +1,64 @@ - - - + + + diff --git a/template-parts/footer/footer-sml-layout.php b/template-parts/footer/footer-sml-layout.php index 0fb6592..dcf5459 100644 --- a/template-parts/footer/footer-sml-layout.php +++ b/template-parts/footer/footer-sml-layout.php @@ -1,40 +1,40 @@ - - - + + + diff --git a/template-parts/footer/index.php b/template-parts/footer/index.php index 8b96815..820bcb9 100644 --- a/template-parts/footer/index.php +++ b/template-parts/footer/index.php @@ -1,9 +1,9 @@ - section and everything up until
    - * - * @see https://developer.wordpress.org/themes/basics/template-files/#template-partials - * - * @package Astra - * @author Astra - * @copyright Copyright (c) 2020, Astra - * @link https://wpastra.com/ - * @since Astra 1.0.0 - */ - -?> - -
    -
    > - -
    - -
    - -
    -
    - -
    -
    + section and everything up until
    + * + * @see https://developer.wordpress.org/themes/basics/template-files/#template-partials + * + * @package Astra + * @author Astra + * @copyright Copyright (c) 2020, Astra + * @link https://wpastra.com/ + * @since Astra 1.0.0 + */ + +?> + +
    +
    > + +
    + +
    + +
    +
    + +
    +
    diff --git a/template-parts/header/index.php b/template-parts/header/index.php index 8b96815..820bcb9 100644 --- a/template-parts/header/index.php +++ b/template-parts/header/index.php @@ -1,9 +1,9 @@ - - -
    > - - - -
    - - - - - - - -
    - - - -
    '', - ) - ); - ?> - > - - - - - - "', '"', false ) - ), - '', - '' - ); - ?> - - - - '', - 'link_before' => '', - 'link_after' => '', - ) - ); - ?> -
    -
    + + +
    > + + + +
    + + + + + + + +
    + + + +
    '', + ) + ); + ?> + > + + + + + + "', '"', false ) + ), + '', + '' + ); + ?> + + + + '', + 'link_before' => '', + 'link_after' => '', + ) + ); + ?> +
    +
    -- cgit v1.2.3-70-g09d2