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. --- .../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 +- 164 files changed, 54807 insertions(+), 55242 deletions(-) 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 (limited to 'inc') 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