class-astra-yoast-seo.php 0000666 00000001250 15210370257 0011417 0 ustar 00 ASTRA_THEME_SETTINGS . '[woocommerce-content-divider]',
'type' => 'control',
'section' => 'section-container-layout',
'control' => 'ast-divider',
'priority' => 85,
'settings' => array(),
),
/**
* Option: Shop Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[woocommerce-content-layout]',
'type' => 'control',
'control' => 'select',
'default' => astra_get_option( 'woocommerce-content-layout' ),
'section' => 'section-container-layout',
'priority' => 85,
'title' => __( 'WooCommerce 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_Woo_Shop_Container_Configs();
woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php 0000666 00000003733 15210370257 0025366 0 ustar 00 ASTRA_THEME_SETTINGS . '[single-product-breadcrumb-disable]',
'section' => 'section-woo-shop-single',
'type' => 'control',
'control' => 'checkbox',
'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' ),
'required' => array( ASTRA_THEME_SETTINGS . '[transparent-header-enable]', '==', '1' ),
'priority' => 26,
'control' => 'checkbox',
),
);
return array_merge( $configurations, $_configs );
}
}
}
new Astra_Woo_Shop_Single_Layout_Configs();
woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php 0000666 00000002552 15210370257 0025034 0 ustar 00 ASTRA_THEME_SETTINGS . '[enable-cart-upsells]',
'section' => 'section-woo-shop-cart',
'type' => 'control',
'control' => 'checkbox',
'default' => astra_get_option( 'enable-cart-upsells' ),
'title' => __( 'Enable Upsells', 'astra' ),
'priority' => 10,
),
);
return array_merge( $configurations, $_configs );
}
}
}
new Astra_Woo_Shop_Cart_Layout_Configs();
woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php 0000666 00000007551 15210370257 0024111 0 ustar 00 ASTRA_THEME_SETTINGS . '[shop-grids]',
'type' => 'control',
'control' => 'ast-responsive-slider',
'section' => 'woocommerce_product_catalog',
'default' => 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',
'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' => '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' ),
),
),
/**
* Option: Enter Width
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[shop-archive-max-width]',
'type' => 'control',
'control' => 'ast-slider',
'section' => 'woocommerce_product_catalog',
'default' => 1200,
'priority' => 10,
'required' => array( ASTRA_THEME_SETTINGS . '[shop-archive-width]', '===', 'custom' ),
'title' => __( 'Custom Width', 'astra' ),
'transport' => 'postMessage',
'suffix' => '',
'input_attrs' => array(
'min' => 768,
'step' => 1,
'max' => 1920,
),
),
);
$configurations = array_merge( $configurations, $_configs );
return $configurations;
}
}
}
new Astra_Woo_Shop_Layout_Configs();
woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php 0000666 00000005025 15210370257 0022662 0 ustar 00 ASTRA_THEME_SETTINGS . '[single-product-sidebar-layout-divider]',
'section' => 'section-sidebars',
'type' => 'control',
'control' => 'ast-divider',
'priority' => 5,
'settings' => array(),
),
/**
* Option: Shop Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[woocommerce-sidebar-layout]',
'type' => 'control',
'control' => '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' => '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' ),
),
),
);
return array_merge( $configurations, $_configs );
}
}
}
new Astra_Woo_Shop_Sidebar_Configs();
woocommerce/customizer/class-astra-customizer-register-woo-section.php 0000666 00000003526 15210370257 0022521 0 ustar 00 '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();
woocommerce/class-astra-woocommerce.php 0000666 00000175215 15210370257 0014347 0 ustar 00 =' ) ) {
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' ) );
}
/**
* 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/';
$key = 'astra-woocommerce';
// Register & Enqueue Styles.
// Generate CSS URL.
$css_file = $css_uri . '' . $file_prefix . '.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,
),
);
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;
} else {
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;
}
/**
* 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' => '',
)
)
);
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' => '',
)
)
);
}
/**
* 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,
),
/**
* 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 li:hover > a.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 ),
),
);
/* Parse WooCommerce General CSS from array() */
$css_output = astra_parse_css( $css_output );
$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)',
),
);
$css_output .= astra_parse_css( $tablet_css_shop_page_grid, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() );
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)' => 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)' => 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%',
),
);
} else {
$min_tablet_css = array(
'.woocommerce #reviews #comments' => array(
'width' => '55%',
'float' => 'left',
),
'.woocommerce #reviews #review_form_wrapper' => array(
'width' => '45%',
'float' => 'right',
'padding-left' => '2em',
),
'.woocommerce form.checkout_coupon' => array(
'width' => '50%',
),
);
}
$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',
),
);
$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.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)',
),
'.woocommerce.mobile-columns-5 ul.products li.product, .woocommerce-page.mobile-columns-5 ul.products li.product' => array(
'width' => '13%',
'width' => 'calc(20% - 16px)',
),
'.woocommerce.mobile-columns-4 ul.products li.product, .woocommerce-page.mobile-columns-4 ul.products li.product' => array(
'width' => '19%',
'width' => 'calc(25% - 15px)',
),
'.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)',
),
'.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)',
),
'.woocommerce.mobile-columns-1 ul.products li.product, .woocommerce-page.mobile-columns-1 ul.products li.product' => array(
'width' => '100%',
),
'.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 div.product .related.products ul.products li.product' => array(
'width' => '46.1%',
'width' => 'calc(50% - 10px)',
),
'.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',
),
);
$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-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',
),
'.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',
),
'.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',
),
'.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.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',
),
'.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',
),
'.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 ul.products li.product:nth-child(n), .woocommerce-page.mobile-columns-1 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,
),
);
} 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-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',
),
'.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',
),
'.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',
),
'.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.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',
),
'.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',
),
'.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 ul.products li.product:nth-child(n), .woocommerce-page.mobile-columns-1 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,
),
);
}
$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 ) );
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 ) {
/**
* 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';
}
/**
* 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();
?>
astra_get_cart_link();
$fragments['a.cart-container'] = ob_get_clean();
return $fragments;
}
}
endif;
if ( apply_filters( 'astra_enable_woocommerce_integration', true ) ) {
Astra_Woocommerce::get_instance();
}
woocommerce/woocommerce-common-functions.php 0000666 00000017615 15210370257 0015427 0 ustar 00 ';
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'];
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;
class-astra-divi-builder.php 0000666 00000002200 15210370257 0012047 0 ustar 00 '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();
edd/customizer/sections/class-astra-edd-container-configs.php 0000666 00000004043 15210370257 0020430 0 ustar 00 ASTRA_THEME_SETTINGS . '[edd-content-divider]',
'type' => 'control',
'section' => 'section-container-layout',
'control' => 'ast-divider',
'priority' => 85,
'settings' => array(),
),
/**
* Option: Shop Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[edd-content-layout]',
'type' => 'control',
'control' => 'select',
'default' => astra_get_option( 'edd-content-layout' ),
'section' => 'section-container-layout',
'priority' => 85,
'title' => __( 'Easy Digital Downloads 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_Edd_Container_Configs();
edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php 0000666 00000002656 15210370257 0024245 0 ustar 00 ASTRA_THEME_SETTINGS . '[disable-edd-single-product-nav]',
'section' => 'section-edd-single',
'type' => 'control',
'control' => 'checkbox',
'default' => astra_get_option( 'disable-edd-single-product-nav' ),
'title' => __( 'Disable Product Navigation', 'astra' ),
'priority' => 10,
),
);
return array_merge( $configurations, $_configs );
}
}
}
new Astra_Edd_Single_Product_Layout_Configs();
edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php 0000666 00000012532 15210370257 0022721 0 ustar 00 ASTRA_THEME_SETTINGS . '[edd-archive-grids]',
'type' => 'control',
'control' => 'ast-responsive-slider',
'section' => 'section-edd-archive',
'default' => array(
'desktop' => 4,
'tablet' => 3,
'mobile' => 2,
),
'priority' => 10,
'title' => __( 'Archive Columns', 'astra' ),
'input_attrs' => array(
'step' => 1,
'min' => 1,
'max' => 6,
),
),
/**
* Option: EDD Archive Post Meta
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]',
'type' => 'control',
'control' => 'ast-sortable',
'section' => 'section-edd-archive',
'default' => astra_get_option( 'edd-archive-product-structure' ),
'priority' => 30,
'title' => __( 'Product Structure', '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' ),
'required' => array( ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]', 'contains', 'add_cart' ),
'priority' => 31,
'title' => __( 'Cart Button Text', 'astra' ),
),
/**
* Option: Variable product button
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[edd-archive-variable-button]',
'type' => 'control',
'control' => 'select',
'section' => 'section-edd-archive',
'default' => astra_get_option( 'edd-archive-variable-button' ),
'required' => array( ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]', 'contains', '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',
'section' => 'section-edd-archive',
'default' => astra_get_option( 'edd-archive-variable-button-text' ),
'required' => array( ASTRA_THEME_SETTINGS . '[edd-archive-variable-button]', '==', 'button' ),
'priority' => 31,
'title' => __( 'Variable Product Button Text', 'astra' ),
),
/**
* Option: Easy Digital Downloads Shop Archive Content Divider
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[edd-archive-width-divider]',
'type' => 'control',
'control' => 'ast-divider',
'section' => 'section-edd-archive',
'priority' => 220,
'settings' => array(),
),
/**
* Option: Archive Content Width
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[edd-archive-width]',
'type' => 'control',
'control' => 'select',
'section' => 'section-edd-archive',
'default' => astra_get_option( 'edd-archive-width' ),
'priority' => 220,
'title' => __( 'Archive Content Width', 'astra' ),
'choices' => array(
'default' => __( 'Default', 'astra' ),
'custom' => __( 'Custom', 'astra' ),
),
),
/**
* Option: Enter Width
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[edd-archive-max-width]',
'type' => 'control',
'control' => 'ast-slider',
'section' => 'section-edd-archive',
'default' => 1200,
'priority' => 225,
'required' => array( ASTRA_THEME_SETTINGS . '[edd-archive-width]', '===', 'custom' ),
'title' => __( 'Custom Width', 'astra' ),
'transport' => 'postMessage',
'suffix' => '',
'input_attrs' => array(
'min' => 768,
'step' => 1,
'max' => 1920,
),
),
);
$configurations = array_merge( $configurations, $_configs );
return $configurations;
}
}
}
new Astra_Edd_Archive_Layout_Configs();
edd/customizer/sections/class-astra-edd-sidebar-configs.php 0000666 00000005041 15210370257 0020056 0 ustar 00 ASTRA_THEME_SETTINGS . '[edd-product-sidebar-layout-divider]',
'section' => 'section-sidebars',
'type' => 'control',
'control' => 'ast-divider',
'priority' => 5,
'settings' => array(),
),
/**
* Option: Shop Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[edd-sidebar-layout]',
'type' => 'control',
'control' => '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' => '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' ),
),
),
);
return array_merge( $configurations, $_configs );
}
}
}
new Astra_Edd_Sidebar_Configs();
edd/class-astra-edd.php 0000666 00000073711 15210370257 0010777 0 ustar 00 →',
$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();
?>
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)',
),
);
/* 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 ( $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() );
$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)',
),
);
/* 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_color = astra_get_option( 'button-bg-color', $theme_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(
/**
* 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( $link_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 ),
),
// 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 ),
),
'.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' ),
),
);
/* 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' => '',
)
)
);
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' => '',
)
)
);
}
/**
* 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 ) {
/**
* 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';
}
}
endif;
if ( apply_filters( 'astra_enable_edd_integration', true ) ) {
Astra_Edd::get_instance();
}
edd/edd-common-functions.php 0000666 00000020177 15210370257 0012056 0 ustar 00 ';
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 );
?>
';
$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;
}
class-astra-ubermeu.php 0000666 00000003427 15210370257 0011150 0 ustar 00 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() {
return 'no-sidebar';
}
);
add_filter(
'astra_get_content_layout',
function () {
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();
class-astra-amp.php 0000666 00000126014 15210370257 0010257 0 ustar 00 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',
),
'.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 > a' => 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',
),
'.header-main-layout-1 .main-navigation' => array(
'padding' => '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 .page_item_has_children > .ast-menu-toggle, .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',
),
'.main-header-bar-navigation .menu-item-has-children > a:after' => array(
'content' => 'none',
),
'.main-header-bar .main-header-bar-navigation .page_item_has_children > .ast-menu-toggle::before, .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',
),
'.ast-button-wrap .menu-toggle.toggled .menu-toggle-icon:before' => array(
'content' => "\e5cd",
),
);
$parse_css = $compiled_css . astra_parse_css( $css, '', 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 .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 .entry-content .alignwide' => array(
'margin-left' => 'auto',
'margin-right' => 'auto',
),
'.ast-amp .main-navigation' => array(
'padding-left' => '0',
),
'.ast-amp .main-navigation ul li a, .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 ul.children li a, .ast-amp .main-navigation ul.sub-menu li a' => array(
'padding-left' => '30px',
),
'.ast-amp .main-navigation ul.children li a:before, .ast-amp .main-navigation ul.sub-menu li a:before' => array(
'content' => '"\01f78e"',
'font-family' => '"Astra"',
'font-size' => '0.65em',
'text-decoration' => 'inherit',
'display' => 'inline-block',
'transform' => 'translate(0, -2px) rotateZ(270deg)',
'margin-right' => '5px',
),
'.ast-amp .main-navigation ul.children li li a, .ast-amp .main-navigation ul.sub-menu li li a' => array(
'padding-left' => '40px',
),
'.ast-amp .main-navigation ul.children li li li a, .ast-amp .main-navigation ul.sub-menu li li li a' => array(),
'.ast-amp .main-navigation ul.children li li li li a, .ast-amp .main-navigation ul.sub-menu li li li li a' => array(
'padding-left' => '60px',
),
'.ast-amp .ast-header-custom-item' => array(
'background-color' => '#f9f9f9',
),
'.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',
),
'.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 .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 .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 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-amp .ast-site-identity' => array(
'width' => '100%',
),
'.ast-amp .main-header-bar-navigation .page_item_has_children > a:after, .ast-amp .main-header-bar-navigation .menu-item-has-children > a: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 .children, .ast-amp .main-header-bar .main-header-bar-navigation .sub-menu' => array(
'line-height' => '3',
),
'.ast-amp .main-header-bar .main-header-bar-navigation .page_item_has_children .sub-menu, .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 .page_item_has_children > .ast-menu-toggle, .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 .page_item_has_children > .ast-menu-toggle::before, .ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before' => array(
'font-weight' => 'bold',
'content' => '"\01f78e"',
'font-family' => '"Astra"',
'text-decoration' => 'inherit',
'display' => 'inline-block',
),
'.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-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-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-bar-navigation' => array(
'width' => '-webkit-calc( 100% + 40px)',
'width' => 'calc(100% + 40px )',
'margin' => '0 -20px',
),
'.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-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-widget-area .widget' => array(
'margin' => '0.5em 0',
'display' => 'block',
),
'.ast-amp .main-header-bar' => array(
'border' => '0',
),
'.ast-amp .nav-fallback-text' => array(
'float' => 'none',
),
'.ast-amp .site-header' => array(
'border-bottom-color' => '#eaeaea',
'border-bottom-style' => 'solid',
),
'.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-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-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-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-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 .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array(
'right' => '0',
),
'.ast-amp .ast-mobile-header-stack .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array(
'right' => '-1em',
),
'.ast-safari-browser-less-than-11.ast-woocommerce-cart-menu.ast-header-break-point .header-main-layout-2 .main-header-container' => array(
'display' => 'flex',
),
'.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-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',
),
);
$parse_css .= astra_parse_css( $astra_break_point_navigation, '', astra_header_break_point() );
// 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() );
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();
class-astra-beaver-themer.php 0000666 00000024144 15210370257 0012231 0 ustar 00 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 ) {
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 ) {
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 ) {
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 ) {
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',
function() {
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 && 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 );
}
}
}
}
endif;
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Visual_Composer::get_instance();
class-astra-beaver-builder.php 0000666 00000004602 15210370257 0012370 0 ustar 00 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' );
}
}
}
}
}
endif;
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Beaver_Builder::get_instance();
learndash/class-astra-learndash.php 0000666 00000034720 15210370257 0013406 0 ustar 00 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();
}
/**
* 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';
}
}
/**
* 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;
$post_type = get_post_type();
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;
}
}
endif;
if ( apply_filters( 'astra_enable_learndash_integration', true ) ) {
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_LearnDash::get_instance();
}
learndash/customizer/class-astra-customizer-register-learndash-section.php 0000666 00000002502 15210370257 0023271 0 ustar 00 'section',
'name' => 'section-learndash',
'priority' => 65,
'title' => __( 'LearnDash', 'astra' ),
),
);
return array_merge( $configurations, $configs );
}
}
}
new Astra_Customizer_Register_Learndash_Section();
learndash/customizer/sections/class-astra-learndash-sidebar-configs.php 0000666 00000003771 15210370257 0022500 0 ustar 00 ASTRA_THEME_SETTINGS . '[learndash-sidebar-layout-divider]',
'type' => 'control',
'section' => 'section-sidebars',
'control' => 'ast-divider',
'priority' => 5,
'settings' => array(),
),
/**
* Option: LearnDash
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[learndash-sidebar-layout]',
'type' => 'control',
'control' => 'select',
'section' => 'section-sidebars',
'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();
learndash/customizer/sections/class-astra-learndash-container-configs.php 0000666 00000004302 15210370257 0023040 0 ustar 00 ASTRA_THEME_SETTINGS . '[learndash-content-divider]',
'type' => 'control',
'section' => 'section-container-layout',
'control' => 'ast-divider',
'priority' => 68,
'settings' => array(),
),
/**
* Option: Shop Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[learndash-content-layout]',
'type' => 'control',
'control' => '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();
learndash/customizer/sections/layout/class-astra-learndash-general-configs.php 0000666 00000003423 15210370257 0024013 0 ustar 00 ASTRA_THEME_SETTINGS . '[learndash-lesson-serial-number]',
'section' => 'section-learndash',
'type' => 'control',
'control' => 'checkbox',
'default' => astra_get_option( 'learndash-lesson-serial-number' ),
'title' => __( 'Display Serial Number', 'astra' ),
'priority' => 25,
),
/**
* Option: Differentiate Rows
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[learndash-differentiate-rows]',
'default' => astra_get_option( 'learndash-differentiate-rows' ),
'type' => 'control',
'control' => 'checkbox',
'section' => 'section-learndash',
'title' => __( 'Differentiate Rows', 'astra' ),
'priority' => 30,
),
);
return array_merge( $configurations, $_configs );
}
}
}
new Astra_Learndash_General_Configs();
class-astra-bne-flyout.php 0000666 00000002224 15210370257 0011562 0 ustar 00 '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();
class-astra-elementor-pro.php 0000666 00000024504 15210370257 0012273 0 ustar 00 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' ) );
remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_default' ) );
// 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 ) {
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 );
}
}
/**
* 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';
}
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';
}
);
}
}
/**
* 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;
class-astra-contact-form-7.php 0000666 00000002544 15210370257 0012243 0 ustar 00 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 ),
'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 );
$text_color = astra_get_option( 'text-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 );
/**
* 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',
);
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 Bar', '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' => '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' => '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;
}
}
endif;
/**
* Kicking this off by calling 'get_instance()' method
*/
if ( apply_filters( 'astra_enable_lifterlms_integration', true ) ) {
Astra_LifterLMS::get_instance();
}
lifterlms/customizer/class-astra-liferlms-section-configs.php 0000666 00000002252 15210370257 0020611 0 ustar 00 'section-lifterlms',
'type' => 'section',
'priority' => 65,
'title' => __( 'LifterLMS', 'astra' ),
),
);
return array_merge( $configurations, $_configs );
}
}
}
new Astra_Liferlms_Section_Configs();
lifterlms/customizer/sections/class-astra-lifter-container-configs.php 0000666 00000004022 15210370257 0022423 0 ustar 00 ASTRA_THEME_SETTINGS . '[lifterlms-content-divider]',
'section' => 'section-container-layout',
'type' => 'control',
'control' => 'ast-divider',
'priority' => 66,
'settings' => array(),
),
/**
* Option: Shop Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[lifterlms-content-layout]',
'type' => 'control',
'control' => '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();
lifterlms/customizer/sections/layout/class-astra-lifter-general-configs.php 0000666 00000004054 15210370257 0023400 0 ustar 00 ASTRA_THEME_SETTINGS . '[llms-course-grid]',
'type' => 'control',
'control' => 'ast-responsive-slider',
'section' => 'section-lifterlms',
'default' => array(
'desktop' => 3,
'tablet' => 2,
'mobile' => 1,
),
'title' => __( 'Course Columns', 'astra' ),
'priority' => 0,
'input_attrs' => array(
'step' => 1,
'min' => 1,
'max' => 6,
),
),
/**
* Option: Membership Columns
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[llms-membership-grid]',
'type' => 'control',
'control' => 'ast-responsive-slider',
'section' => 'section-lifterlms',
'default' => array(
'desktop' => 3,
'tablet' => 2,
'mobile' => 1,
),
'title' => __( 'Membership Columns', 'astra' ),
'priority' => 0,
'input_attrs' => array(
'step' => 1,
'min' => 1,
'max' => 6,
),
),
);
return array_merge( $configurations, $_configs );
}
}
}
new Astra_Lifter_General_Configs();
lifterlms/customizer/sections/class-astra-lifter-sidebar-configs.php 0000666 00000005071 15210370257 0022057 0 ustar 00 ASTRA_THEME_SETTINGS . '[lifterlms-course-lesson-sidebar-layout-divider]',
'section' => 'section-sidebars',
'type' => 'control',
'control' => 'ast-divider',
'priority' => 5,
'settings' => array(),
),
/**
* Option: Shop Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[lifterlms-sidebar-layout]',
'type' => 'control',
'control' => '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' => '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();
class-astra-bb-ultimate-addon.php 0000666 00000026776 15210370257 0013010 0 ustar 00 $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();
index.php 0000666 00000000157 15210370257 0006375 0 ustar 00