#js&&****&……PK #Zr ( scroll-to-top/css/static-css.phpnu [ array(
'color' => $scroll_to_top_icon_color,
'background-color' => $scroll_to_top_icon_bg_color,
'font-size' => astra_get_css_value( $scroll_to_top_icon_size, 'px' ),
'border-top-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'top', 'desktop' ),
'border-top-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'right', 'desktop' ),
'border-bottom-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'bottom', 'desktop' ),
'border-bottom-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'left', 'desktop' ),
),
'#ast-scroll-top:hover' => array(
'color' => $scroll_to_top_icon_h_color,
'background-color' => $scroll_to_top_icon_h_bg_color,
),
);
$scroll_css = astra_parse_css( $scroll_to_top );
$scroll_to_top_tablet = array(
'#ast-scroll-top' => array(
'border-top-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'top', 'tablet' ),
'border-top-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'right', 'tablet' ),
'border-bottom-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'bottom', 'tablet' ),
'border-bottom-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'left', 'tablet' ),
),
);
/* Parse CSS from array() -> max-width: (tablet-breakpoint) px CSS */
$scroll_css .= astra_parse_css( $scroll_to_top_tablet, '', astra_get_tablet_breakpoint() );
$scroll_to_top_mobile = array(
'#ast-scroll-top' => array(
'border-top-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'top', 'mobile' ),
'border-top-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'right', 'mobile' ),
'border-bottom-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'bottom', 'mobile' ),
'border-bottom-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'left', 'mobile' ),
),
);
/* Parse CSS from array() -> max-width: (mobile-breakpoint) px CSS */
$scroll_css .= astra_parse_css( $scroll_to_top_mobile, '', astra_get_mobile_breakpoint() );
if ( is_rtl() ) {
$scroll_to_top_rtl = array(
'#ast-scroll-top .ast-icon.icon-arrow svg' => array(
'margin-right' => '0px',
),
);
$scroll_css .= astra_parse_css( $scroll_to_top_rtl );
}
if ( false === Astra_Icons::is_svg_icons() ) {
$scroll_to_top_icon = array(
'.ast-scroll-top-icon::before' => array(
'content' => '"\e900"',
'font-family' => 'Astra',
'text-decoration' => 'inherit',
),
'.ast-scroll-top-icon' => array(
'transform' => 'rotate(180deg)',
),
);
$scroll_css .= astra_parse_css( $scroll_to_top_icon );
}
// Only if responsive devices is selected.
$svg_width = array(
/**
* Add spacing based on padded layout spacing
*/
'#ast-scroll-top .ast-icon.icon-arrow svg' => array(
'width' => '1em',
),
);
$scroll_css .= astra_parse_css( $svg_width, '', astra_get_tablet_breakpoint() );
return $dynamic_css . $scroll_css;
}
PK #ZHs/e + scroll-to-top/class-astra-scroll-to-top.phpnu [ array(
'top' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
'right' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
'bottom' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
'left' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
),
'tablet' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'mobile' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
);
$defaults['scroll-to-top-icon-color'] = '';
$defaults['scroll-to-top-icon-h-color'] = '';
$defaults['scroll-to-top-icon-bg-color'] = '';
$defaults['scroll-to-top-icon-h-bg-color'] = '';
return $defaults;
}
/**
* Add customizer configs for scroll to top in the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
* @since 4.0.0
*/
public function new_customize_register( $wp_customize ) {
require_once ASTRA_SCROLL_TO_TOP_DIR . 'classes/customizer/class-astra-scroll-to-top-configs.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound -- Not a template file so loading in a normal way.
}
/**
* Customizer Preview
*
* @since 4.0.0
*/
public function preview_scripts() {
/** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( SCRIPT_DEBUG ) {
/** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
wp_enqueue_script( 'astra-scroll-to-top-customize-preview-js', ASTRA_SCROLL_TO_TOP_URL . 'assets/js/unminified/customizer-preview.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
} else {
wp_enqueue_script( 'astra-scroll-to-top-customize-preview-js', ASTRA_SCROLL_TO_TOP_URL . 'assets/js/minified/customizer-preview.min.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
}
}
/**
* Scroll to Top addon markup loader
*
* Loads appropriate template file based on the style option selected in options panel.
*
* @since 4.0.0
*/
public function html_markup_loader() {
if ( true === astra_get_option( 'scroll-to-top-enable', true ) ) {
get_template_part( 'template-parts/scroll-to-top' );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Scroll_To_Top_Loader::get_instance();
PK #Z*c~( ( F scroll-to-top/classes/customizer/class-astra-scroll-to-top-configs.phpnu [ ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'default' => astra_get_option( 'scroll-to-top-enable' ),
'type' => 'control',
'section' => 'section-scroll-to-top',
'title' => __( 'Enable Scroll to Top', 'astra' ),
'priority' => 1,
'control' => 'ast-toggle-control',
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
/**
* Option: Scroll to Top Display On
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-on-devices]',
'default' => astra_get_option( 'scroll-to-top-on-devices' ),
'type' => 'control',
'control' => 'ast-selector',
'section' => 'section-scroll-to-top',
'priority' => 10,
'title' => __( 'Display On', 'astra' ),
'choices' => array(
'desktop' => __( 'Desktop', 'astra' ),
'mobile' => __( 'Mobile', 'astra' ),
'both' => __( 'Desktop + Mobile', 'astra' ),
),
'renderAs' => 'text',
'responsive' => false,
'divider' => array( 'ast_class' => 'ast-top-section-divider ast-bottom-section-divider' ),
'context' => array(
'relation' => 'AND',
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
),
/**
* Option: Scroll to Top Position
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-icon-position]',
'default' => astra_get_option( 'scroll-to-top-icon-position' ),
'type' => 'control',
'control' => 'ast-selector',
'transport' => 'postMessage',
'section' => 'section-scroll-to-top',
'title' => __( 'Position', 'astra' ),
'choices' => array(
'left' => __( 'Left', 'astra' ),
'right' => __( 'Right', 'astra' ),
),
'priority' => 11,
'responsive' => false,
'renderAs' => 'text',
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
'context' => array(
'relation' => 'AND',
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
),
/**
* Option: Scroll To Top Icon Size
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-icon-size]',
'default' => astra_get_option( 'scroll-to-top-icon-size' ),
'type' => 'control',
'control' => 'ast-slider',
'transport' => 'postMessage',
'section' => 'section-scroll-to-top',
'title' => __( 'Icon Size', 'astra' ),
'suffix' => 'px',
'priority' => 12,
'context' => array(
'relation' => 'AND',
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-on-top-color-group]',
'default' => astra_get_option( 'scroll-on-top-color-group' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Icon Color', 'astra' ),
'section' => 'section-scroll-to-top',
'context' => array(
'relation' => 'AND',
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
'priority' => 1,
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-on-top-bg-color-group]',
'default' => astra_get_option( 'scroll-on-top-bg-color-group' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Background Color', 'astra' ),
'section' => 'section-scroll-to-top',
'transport' => 'postMessage',
'context' => array(
'relation' => 'AND',
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
'priority' => 1,
),
/**
* Option: Scroll To Top Radius
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-icon-radius-fields]',
'default' => astra_get_option( 'scroll-to-top-icon-radius-fields' ),
'type' => 'control',
'control' => 'ast-responsive-spacing',
'transport' => 'postMessage',
'section' => 'section-scroll-to-top',
'title' => __( 'Border Radius', 'astra' ),
'suffix' => 'px',
'priority' => 1,
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
'context' => array(
'relation' => 'AND',
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
'linked_choices' => true,
'unit_choices' => array( 'px', 'em', '%' ),
'choices' => array(
'top' => __( 'Top', 'astra' ),
'right' => __( 'Right', 'astra' ),
'bottom' => __( 'Bottom', 'astra' ),
'left' => __( 'Left', 'astra' ),
),
'connected' => false,
),
/**
* Option: Icon Color
*/
array(
'name' => 'scroll-to-top-icon-color',
'default' => astra_get_option( 'scroll-to-top-icon-color' ),
'type' => 'sub-control',
'priority' => 1,
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-color-group]',
'section' => 'section-scroll-to-top',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'transport' => 'postMessage',
'title' => __( 'Color', 'astra' ),
),
/**
* Option: Icon Background Color
*/
array(
'name' => 'scroll-to-top-icon-bg-color',
'default' => astra_get_option( 'scroll-to-top-icon-bg-color' ),
'type' => 'sub-control',
'priority' => 1,
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-bg-color-group]',
'section' => 'section-scroll-to-top',
'transport' => 'postMessage',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'title' => __( 'Color', 'astra' ),
),
/**
* Option: Icon Hover Color
*/
array(
'name' => 'scroll-to-top-icon-h-color',
'default' => astra_get_option( 'scroll-to-top-icon-h-color' ),
'type' => 'sub-control',
'priority' => 1,
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-color-group]',
'section' => 'section-scroll-to-top',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'transport' => 'postMessage',
'title' => __( 'Hover Color', 'astra' ),
),
/**
* Option: Link Hover Background Color
*/
array(
'name' => 'scroll-to-top-icon-h-bg-color',
'default' => astra_get_option( 'scroll-to-top-icon-h-bg-color' ),
'type' => 'sub-control',
'priority' => 1,
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-bg-color-group]',
'section' => 'section-scroll-to-top',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'transport' => 'postMessage',
'title' => __( 'Hover Color', 'astra' ),
),
);
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$_configs[] = array(
'name' => 'section-scroll-to-top-ast-context-tabs',
'section' => 'section-scroll-to-top',
'type' => 'control',
'control' => 'ast-builder-header-control',
'priority' => 0,
'description' => '',
);
$_configs[] = array(
'name' => ASTRA_THEME_SETTINGS . '[enable-scroll-to-top-notice]',
'type' => 'control',
'control' => 'ast-description',
'section' => 'section-scroll-to-top',
'priority' => 1,
'label' => '',
'help' => __( 'Note: To get design settings in action make sure to enable Scroll to Top.', 'astra' ),
'context' => array(
'relation' => 'AND',
Astra_Builder_Helper::$design_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '!=',
'value' => true,
),
),
);
}
$configurations = array_merge( $configurations, $_configs );
return $configurations;
}
}
/** Creating instance for getting customizer configs. */
new Astra_Scroll_To_Top_Configs();
PK #ZA1pN N 8 scroll-to-top/assets/js/unminified/customizer-preview.jsnu [ /**
* This file adds some LIVE to the Customizer live preview. To leverage
* this, set your custom settings to 'postMessage' and then add your handling
* here. Your javascript should grab settings from customizer controls, and
* then make any necessary changes to the page using jQuery.
*
* @package Astra
* @since x.x.x
*/
( function( $ ) {
astra_css(
'astra-settings[scroll-to-top-icon-size]',
'font-size',
'#ast-scroll-top',
'px'
);
astra_css( 'astra-settings[scroll-to-top-icon-color]', 'color', '#ast-scroll-top' );
astra_css( 'astra-settings[scroll-to-top-icon-bg-color]', 'background-color', '#ast-scroll-top' );
astra_css( 'astra-settings[scroll-to-top-icon-h-color]', 'color', '#ast-scroll-top:hover' );
astra_css( 'astra-settings[scroll-to-top-icon-h-bg-color]', 'background-color', '#ast-scroll-top:hover' );
// Border Radius Fields for Button.
wp.customize( 'astra-settings[scroll-to-top-icon-radius-fields]', function( value ) {
value.bind( function( border ) {
let tablet_break_point = astraBuilderPreview.tablet_break_point || 768,
mobile_break_point = astraBuilderPreview.mobile_break_point || 544;
let dynamicStyle = '';
dynamicStyle += ' #ast-scroll-top { border-top-left-radius :' + border['desktop']['top'] + border['desktop-unit']
+ '; border-bottom-right-radius :' + border['desktop']['bottom'] + border['desktop-unit'] + '; border-bottom-left-radius :'
+ border['desktop']['left'] + border['desktop-unit'] + '; border-top-right-radius :' + border['desktop']['right'] + border['desktop-unit'] + '; } ';
dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) { #ast-scroll-top { border-top-left-radius :' + border['tablet']['top'] + border['tablet-unit']
+ '; border-bottom-right-radius :' + border['tablet']['bottom'] + border['tablet-unit'] + '; border-bottom-left-radius :'
+ border['tablet']['left'] + border['tablet-unit'] + '; border-top-right-radius :' + border['tablet']['right'] + border['tablet-unit'] + '; } }';
dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) { #ast-scroll-top { border-top-left-radius :' + border['mobile']['top'] + border['mobile-unit']
+ '; border-bottom-right-radius :' + border['mobile']['bottom'] + border['mobile-unit'] + '; border-bottom-left-radius :'
+ border['mobile']['left'] + border['mobile-unit'] + '; border-top-right-radius :' + border['mobile']['right'] + border['mobile-unit'] + '; } }';
astra_add_dynamic_css( 'scroll-to-top-icon-radius-fields', dynamicStyle );
} );
} );
// Scroll to top position.
wp.customize( 'astra-settings[scroll-to-top-icon-position]', function( value ) {
value.bind( function( position ) {
jQuery("#ast-scroll-top").removeClass("ast-scroll-to-top-right ast-scroll-to-top-left");
jQuery("#ast-scroll-top").addClass("ast-scroll-to-top-"+position);
} );
} );
} )( jQuery );
PK #ZgK 3 scroll-to-top/assets/js/unminified/scroll-to-top.jsnu [ /**
* Scroll To Top
*
* @package Astra
* @since 1.0.0
*/
document.addEventListener("DOMContentLoaded", function() {
var masthead = document.querySelector( '#page header' );
var astScrollTop = document.getElementById( 'ast-scroll-top' );
if ( astScrollTop ) {
astScrollToTop = function () {
var content = getComputedStyle(astScrollTop).content,
device = astScrollTop.dataset.onDevices;
content = content.replace( /[^0-9]/g, '' );
if( 'both' == device || ( 'desktop' == device && '769' == content ) || ( 'mobile' == device && '' == content ) ) {
// Get current window / document scroll.
var scrollTop = window.pageYOffset || document.body.scrollTop;
// If masthead found.
if( masthead && masthead.length ){
if (scrollTop > masthead.offsetHeight + 100) {
astScrollTop.style.display = "block";
} else {
astScrollTop.style.display = "none";
}
}
else{
// If there is no masthead set default start scroll
if ( window.pageYOffset > 300 ) {
astScrollTop.style.display = "block";
} else {
astScrollTop.style.display = "none";
}
}
} else {
astScrollTop.style.display = "none";
}
};
astScrollToTop();
window.addEventListener('scroll', function () {
astScrollToTop();
});
astScrollTop.onclick = function(e){
e.preventDefault();
window.scrollTo({
top: 0,
left: 0,
behavior: 'smooth'
});
};
}
});
PK #ZhG G : scroll-to-top/assets/js/minified/customizer-preview.min.jsnu [ jQuery,astra_css("astra-settings[scroll-to-top-icon-size]","font-size","#ast-scroll-top","px"),astra_css("astra-settings[scroll-to-top-icon-color]","color","#ast-scroll-top"),astra_css("astra-settings[scroll-to-top-icon-bg-color]","background-color","#ast-scroll-top"),astra_css("astra-settings[scroll-to-top-icon-h-color]","color","#ast-scroll-top:hover"),astra_css("astra-settings[scroll-to-top-icon-h-bg-color]","background-color","#ast-scroll-top:hover"),wp.customize("astra-settings[scroll-to-top-icon-radius-fields]",function(t){t.bind(function(t){var o=astraBuilderPreview.tablet_break_point||768,s="",s=(s=(s+=" #ast-scroll-top { border-top-left-radius :"+t.desktop.top+t["desktop-unit"]+"; border-bottom-right-radius :"+t.desktop.bottom+t["desktop-unit"]+"; border-bottom-left-radius :"+t.desktop.left+t["desktop-unit"]+"; border-top-right-radius :"+t.desktop.right+t["desktop-unit"]+"; } ")+("@media (max-width: "+o+"px) { #ast-scroll-top { border-top-left-radius :"+t.tablet.top+t["tablet-unit"]+"; border-bottom-right-radius :"+t.tablet.bottom+t["tablet-unit"]+"; border-bottom-left-radius :"+t.tablet.left+t["tablet-unit"]+"; border-top-right-radius :"+t.tablet.right+t["tablet-unit"]+"; } }"))+("@media (max-width: "+(astraBuilderPreview.mobile_break_point||544)+"px) { #ast-scroll-top { border-top-left-radius :"+t.mobile.top+t["mobile-unit"]+"; border-bottom-right-radius :"+t.mobile.bottom+t["mobile-unit"]+"; border-bottom-left-radius :"+t.mobile.left+t["mobile-unit"]+"; border-top-right-radius :"+t.mobile.right+t["mobile-unit"]+"; } }");astra_add_dynamic_css("scroll-to-top-icon-radius-fields",s)})}),wp.customize("astra-settings[scroll-to-top-icon-position]",function(t){t.bind(function(t){jQuery("#ast-scroll-top").removeClass("ast-scroll-to-top-right ast-scroll-to-top-left"),jQuery("#ast-scroll-top").addClass("ast-scroll-to-top-"+t)})});PK #Z3{ . breadcrumbs/class-astra-breadcrumbs-loader.phpnu [ '',
'tablet' => '',
'mobile' => '',
);
$defaults['breadcrumb-active-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['breadcrumb-hover-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['breadcrumb-separator-color'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['breadcrumb-bg-color'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['breadcrumb-spacing'] = array(
'desktop' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'tablet' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'mobile' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
);
/**
* Breadcrumb Font Defaults
*/
$defaults['breadcrumb-font-family'] = 'inherit';
$defaults['breadcrumb-font-weight'] = 'inherit';
$defaults['breadcrumb-font-size'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
);
$defaults['breadcrumb-font-extras'] = array(
'line-height' => ! isset( $astra_options['breadcrumb-font-extras'] ) && isset( $astra_options['breadcrumb-line-height'] ) ? $astra_options['breadcrumb-line-height'] : '',
'line-height-unit' => 'em',
'letter-spacing' => '',
'letter-spacing-unit' => 'px',
'text-transform' => ! isset( $astra_options['breadcrumb-font-extras'] ) && isset( $astra_options['breadcrumb-text-transform'] ) ? $astra_options['breadcrumb-text-transform'] : '',
'text-decoration' => '',
);
/**
* Breadcrumb Separator defaults
*/
$defaults['breadcrumb-separator-selector'] = '\003E';
$defaults['breadcrumb-separator'] = '\00bb';
return $defaults;
}
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public function customize_register( $wp_customize ) {
/**
* Register Panel & Sections
*/
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-configs.php';
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-color-configs.php';
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-typo-configs.php';
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Customizer Preview
*/
public function preview_scripts() {
/**
* Load unminified if SCRIPT_DEBUG is true.
*/
/* Directory and Extension */
$dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
$file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
wp_enqueue_script( 'astra-breadcrumbs-customizer-preview-js', ASTRA_THEME_BREADCRUMBS_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Breadcrumbs_Loader::get_instance();
PK #Z(fܯ ' breadcrumbs/class-astra-breadcrumbs.phpnu [ $breadcrumb_enable,
);
}
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] ) {
$options['yoast-seo-breadcrumbs'] = 'Yoast SEO Breadcrumbs';
}
if ( function_exists( 'bcn_display' ) ) {
$options['breadcrumb-navxt'] = 'Breadcrumb NavXT';
}
if ( function_exists( 'rank_math_the_breadcrumbs' ) ) {
$options['rank-math'] = 'Rank Math';
}
if ( function_exists( 'seopress_display_breadcrumbs' ) ) {
$options['seopress'] = 'SEOPress';
}
return $options;
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Breadcrumbs::get_instance();
}
PK #Zzbǿ . breadcrumbs/class-astra-breadcrumbs-markup.phpnu [
';
}
astra_get_breadcrumb();
if ( $breadcrumb_position && ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) ) {
echo '
';
}
}
/**
* Astra Breadcrumbs Rules
*
* Checks the rules defined for displaying Breadcrumb on different pages.
*
* @since 1.8.0
*
* @return boolean
*/
public static function astra_breadcrumb_rules() {
// Display Breadcrumb default true.
$display_breadcrumb = true;
if ( is_front_page() && '0' == astra_get_option( 'breadcrumb-disable-home-page' ) ) {
$display_breadcrumb = false;
}
if ( is_home() && '0' == astra_get_option( 'breadcrumb-disable-blog-posts-page' ) ) {
$display_breadcrumb = false;
}
if ( is_search() && '0' == astra_get_option( 'breadcrumb-disable-search' ) ) {
$display_breadcrumb = false;
}
if ( ( is_archive() ) && '0' == astra_get_option( 'breadcrumb-disable-archive' ) ) {
$display_breadcrumb = false;
}
if ( is_page() && '0' == astra_get_option( 'breadcrumb-disable-single-page' ) ) {
$display_breadcrumb = false;
}
if ( is_single() && '0' == astra_get_option( 'breadcrumb-disable-single-post' ) ) {
$display_breadcrumb = false;
}
if ( is_singular() && '0' == astra_get_option( 'breadcrumb-disable-singular' ) ) {
$display_breadcrumb = false;
}
if ( is_404() && '0' == astra_get_option( 'breadcrumb-disable-404-page' ) ) {
$display_breadcrumb = false;
}
return apply_filters( 'astra_breadcrumb_enabled', $display_breadcrumb );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Breadcrumbs_Markup::get_instance();
PK #Z䇄j 6 breadcrumbs/assets/js/unminified/customizer-preview.jsnu [ /**
* This file adds some LIVE to the Customizer live preview. To leverage
* this, set your custom settings to 'postMessage' and then add your handling
* here. Your javascript should grab settings from customizer controls, and
* then make any necessary changes to the page using jQuery.
*
* @package Astra
* @since 1.7.0
*/
( function( $ ) {
/* Breadcrumb Typography */
astra_responsive_font_size(
'astra-settings[breadcrumb-font-size]',
'.ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after'
);
astra_generate_outside_font_family_css(
'astra-settings[breadcrumb-font-family]',
'.ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after'
);
astra_generate_font_weight_css( 'astra-settings[breadcrumb-font-family]', 'astra-settings[breadcrumb-font-weight]', 'font-weight', '.ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after' );
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Line Height */
astra_font_extras_css( 'breadcrumb-font-extras', '.ast-breadcrumbs-wrapper .ast-breadcrumbs-name, .ast-breadcrumbs-wrapper .ast-breadcrumbs-item, .ast-breadcrumbs-wrapper .ast-breadcrumbs .separator, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after' );
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Text Color */
astra_color_responsive_css(
'breadcrumb',
'astra-settings[breadcrumb-active-color-responsive]',
'color',
'.ast-breadcrumbs-wrapper .trail-items .trail-end, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast .breadcrumb_last, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-inner, .ast-breadcrumbs-wrapper .breadcrumb-item.active'
);
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Link Color */
astra_color_responsive_css(
'breadcrumb',
'astra-settings[breadcrumb-text-color-responsive]',
'color',
'.ast-breadcrumbs-wrapper .trail-items a, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast a, .ast-breadcrumbs-wrapper .breadcrumbs a, .ast-breadcrumbs-wrapper .rank-math-breadcrumb a, .ast-breadcrumbs-wrapper .breadcrumb-item a'
);
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Hover Color */
astra_color_responsive_css(
'breadcrumb',
'astra-settings[breadcrumb-hover-color-responsive]',
'color',
'.ast-breadcrumbs-wrapper .trail-items a:hover, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast a:hover, .ast-breadcrumbs-wrapper .breadcrumbs a:hover, .ast-breadcrumbs-wrapper .rank-math-breadcrumb a:hover, .ast-breadcrumbs-wrapper .breadcrumb-item a:hover'
);
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Separator Color */
astra_color_responsive_css(
'breadcrumb',
'astra-settings[breadcrumb-separator-color]',
'color',
'.ast-breadcrumbs-wrapper .trail-items li::after, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb .separator, .ast-breadcrumbs-wrapper .breadcrumb-item:after'
);
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Background Color */
astra_color_responsive_css(
'breadcrumb',
'astra-settings[breadcrumb-bg-color]',
'background-color',
'.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb, .ast-primary-sticky-header-active .main-header-bar.ast-header-breadcrumb'
);
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Alignment */
astra_css(
'astra-settings[breadcrumb-alignment]',
'text-align',
'.ast-breadcrumbs-wrapper'
);
/**
* Breadcrumb Spacing
*/
wp.customize( 'astra-settings[breadcrumb-spacing]', function( value ) {
value.bind( function( padding ) {
var spacing_value = wp.customize( 'astra-settings[breadcrumb-position]' ).get();
if( 'astra_header_markup_after' == spacing_value || 'astra_header_after' == spacing_value ) {
astra_responsive_spacing( 'astra-settings[breadcrumb-spacing]','.main-header-bar.ast-header-breadcrumb', 'padding', ['top', 'right', 'bottom', 'left' ] );
} else if( 'astra_masthead_content' == spacing_value ) {
astra_responsive_spacing( 'astra-settings[breadcrumb-spacing]','.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .ast-breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner', 'padding', ['top', 'right', 'bottom', 'left' ] );
} else {
astra_responsive_spacing( 'astra-settings[breadcrumb-spacing]','.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-wrapper .ast-breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner', 'padding', ['top', 'right', 'bottom', 'left' ] );
}
} );
} );
/**
* Breadcrumb Separator.
*/
wp.customize( 'astra-settings[breadcrumb-separator-selector]', function( value ) {
value.bind( function( value ) {
const customBreadcrumbValue = wp.customize.value( 'astra-settings[breadcrumb-separator]' )();
const currentSelectedSeparator = 'unicode' !== value ? value : customBreadcrumbValue;
let dynamicStyle = '';
dynamicStyle += '.trail-items li::after {';
dynamicStyle += 'content: "' + currentSelectedSeparator + '";';
dynamicStyle += '} ';
astra_add_dynamic_css( 'breadcrumb-separator-selector', dynamicStyle );
} );
} );
wp.customize( 'astra-settings[breadcrumb-separator]', function( value ) {
value.bind( function( value ) {
let dynamicStyle = '';
dynamicStyle += '.trail-items li::after {';
dynamicStyle += 'content: "' + value + '";';
dynamicStyle += '} ';
astra_add_dynamic_css( 'breadcrumb-separator', dynamicStyle );
} );
} );
} )( jQuery );
PK #Zz 8 breadcrumbs/assets/js/minified/customizer-preview.min.jsnu [ jQuery,astra_responsive_font_size("astra-settings[breadcrumb-font-size]",".ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after"),astra_generate_outside_font_family_css("astra-settings[breadcrumb-font-family]",".ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after"),astra_generate_font_weight_css("astra-settings[breadcrumb-font-family]","astra-settings[breadcrumb-font-weight]","font-weight",".ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after"),astra_font_extras_css("breadcrumb-font-extras",".ast-breadcrumbs-wrapper .ast-breadcrumbs-name, .ast-breadcrumbs-wrapper .ast-breadcrumbs-item, .ast-breadcrumbs-wrapper .ast-breadcrumbs .separator, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after"),astra_color_responsive_css("breadcrumb","astra-settings[breadcrumb-active-color-responsive]","color",".ast-breadcrumbs-wrapper .trail-items .trail-end, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast .breadcrumb_last, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-inner, .ast-breadcrumbs-wrapper .breadcrumb-item.active"),astra_color_responsive_css("breadcrumb","astra-settings[breadcrumb-text-color-responsive]","color",".ast-breadcrumbs-wrapper .trail-items a, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast a, .ast-breadcrumbs-wrapper .breadcrumbs a, .ast-breadcrumbs-wrapper .rank-math-breadcrumb a, .ast-breadcrumbs-wrapper .breadcrumb-item a"),astra_color_responsive_css("breadcrumb","astra-settings[breadcrumb-hover-color-responsive]","color",".ast-breadcrumbs-wrapper .trail-items a:hover, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast a:hover, .ast-breadcrumbs-wrapper .breadcrumbs a:hover, .ast-breadcrumbs-wrapper .rank-math-breadcrumb a:hover, .ast-breadcrumbs-wrapper .breadcrumb-item a:hover"),astra_color_responsive_css("breadcrumb","astra-settings[breadcrumb-separator-color]","color",".ast-breadcrumbs-wrapper .trail-items li::after, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb .separator, .ast-breadcrumbs-wrapper .breadcrumb-item:after"),astra_color_responsive_css("breadcrumb","astra-settings[breadcrumb-bg-color]","background-color",".ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb, .ast-primary-sticky-header-active .main-header-bar.ast-header-breadcrumb"),astra_css("astra-settings[breadcrumb-alignment]","text-align",".ast-breadcrumbs-wrapper"),wp.customize("astra-settings[breadcrumb-spacing]",function(r){r.bind(function(r){var a=wp.customize("astra-settings[breadcrumb-position]").get();"astra_header_markup_after"==a||"astra_header_after"==a?astra_responsive_spacing("astra-settings[breadcrumb-spacing]",".main-header-bar.ast-header-breadcrumb","padding",["top","right","bottom","left"]):"astra_masthead_content"==a?astra_responsive_spacing("astra-settings[breadcrumb-spacing]",".ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .ast-breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner","padding",["top","right","bottom","left"]):astra_responsive_spacing("astra-settings[breadcrumb-spacing]",".ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-wrapper .ast-breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner","padding",["top","right","bottom","left"])})}),wp.customize("astra-settings[breadcrumb-separator-selector]",function(r){r.bind(function(r){var a=wp.customize.value("astra-settings[breadcrumb-separator]")(),e="",e=(e+=".trail-items li::after {")+('content: "'+("unicode"!==r?r:a)+'";')+"} ";astra_add_dynamic_css("breadcrumb-separator-selector",e)})}),wp.customize("astra-settings[breadcrumb-separator]",function(r){r.bind(function(r){var a="",a=(a+=".trail-items li::after {")+('content: "'+r+'";')+"} ";astra_add_dynamic_css("breadcrumb-separator",a)})});PK #Zz4d 4d ' breadcrumbs/dynamic-css/dynamic.css.phpnu [ array(
'display' => 'inline-block',
'margin' => '0',
'padding' => '0',
'border' => 'none',
'background' => 'inherit',
'text-indent' => '0',
'text-decoration' => 'none',
),
'.ast-breadcrumbs .trail-browse' => array(
'font-size' => 'inherit',
'font-style' => 'inherit',
'font-weight' => 'inherit',
'color' => 'inherit',
),
'.ast-breadcrumbs .trail-items' => array(
'list-style' => 'none',
),
'.trail-items li::after' => array(
'padding' => '0 0.3em',
'content' => '"\00bb"',
),
'.trail-items li:last-of-type::after' => array(
'display' => 'none',
),
),
'',
''
);
if ( 'none' === $breadcrumb_position ) {
return $dynamic_css;
}
/**
* Set CSS Params
*/
$default_color_array = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$breadcrumb_text_color = astra_get_option( 'breadcrumb-text-color-responsive', $default_color_array );
$breadcrumb_active_color = astra_get_option( 'breadcrumb-active-color-responsive', $default_color_array );
$breadcrumb_hover_color = astra_get_option( 'breadcrumb-hover-color-responsive', $default_color_array );
$breadcrumb_separator_color = astra_get_option( 'breadcrumb-separator-color', $default_color_array );
$breadcrumb_bg_color = astra_get_option( 'breadcrumb-bg-color', $default_color_array );
$breadcrumb_font_size = astra_get_option( 'breadcrumb-font-size' );
$breadcrumb_spacing = astra_get_option( 'breadcrumb-spacing' );
$breadcrumb_alignment = astra_get_option( 'breadcrumb-alignment' );
$breadcrumb_separator = astra_get_option( 'breadcrumb-separator' );
$breadcrumb_separator_selector = astra_get_option( 'breadcrumb-separator-selector' );
/**
* Generate dynamic CSS based on the Breadcrumb Source option selected from the customizer.
*/
$breadcrumb_source = astra_get_option( 'select-breadcrumb-source' );
/**
* Generate Dynamic CSS
*/
$css = '';
$breadcrumbs_default_css = array();
$breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false;
$wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable;
if ( ! is_array( $wpseo_option ) ) {
unset( $wpseo_option );
$wpseo_option = array(
'breadcrumbs-enable' => $breadcrumb_enable,
);
}
/**
* Breadcrumb Separator
*/
$current_selected_separator = '';
if ( 'unicode' === $breadcrumb_separator_selector ) {
$current_selected_separator = $breadcrumb_separator;
} else {
$current_selected_separator = $breadcrumb_separator_selector;
}
$css .= astra_parse_css(
array(
'.trail-items li::after' => array(
'content' => '"' . $current_selected_separator . '"',
),
),
'',
''
);
/**
* Breadcrumb Colors & Typography
*/
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && $breadcrumb_source && 'yoast-seo-breadcrumbs' == $breadcrumb_source ) {
/* Yoast SEO Breadcrumb CSS - Desktop */
$breadcrumbs_desktop = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumb_last' => array(
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper span' => array(
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
);
/* Yoast SEO Breadcrumb CSS - Tablet */
$breadcrumbs_tablet = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumb_last' => array(
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper span' => array(
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
),
);
/* Yoast SEO Breadcrumb CSS - Mobile */
$breadcrumbs_mobile = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumb_last' => array(
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper span' => array(
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
),
);
} elseif ( function_exists( 'bcn_display' ) && $breadcrumb_source && 'breadcrumb-navxt' == $breadcrumb_source ) {
/* Breadcrumb NavXT CSS - Desktop */
$breadcrumbs_desktop = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .current-item' => array(
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumbs' => array(
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
);
/* Breadcrumb NavXT CSS - Tablet */
$breadcrumbs_tablet = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .current-item' => array(
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumbs' => array(
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
),
);
/* Breadcrumb NavXT CSS - Mobile */
$breadcrumbs_mobile = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .current-item' => array(
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumbs' => array(
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
),
);
} elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && $breadcrumb_source && 'rank-math' == $breadcrumb_source ) {
/* Rank Math CSS - Desktop */
$breadcrumbs_desktop = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .last' => array(
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .separator' => array(
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
);
/* Rank Math CSS - Tablet */
$breadcrumbs_tablet = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .last' => array(
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .separator' => array(
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
),
);
/* Rank Math CSS - Mobile */
$breadcrumbs_mobile = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .last' => array(
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .separator' => array(
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
),
);
} elseif ( function_exists( 'seopress_display_breadcrumbs' ) && $breadcrumb_source && 'seopress' == $breadcrumb_source ) {
/* SEOPress CSS - Desktop */
$breadcrumbs_desktop = array(
'.ast-breadcrumbs-inner .breadcrumb-item a' => array(
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item.active' => array(
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item:after' => array(
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item, .ast-breadcrumbs-inner .breadcrumb-item.active, .ast-breadcrumbs-inner .breadcrumb-item:after' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
);
/* SEOPress CSS - Tablet */
$breadcrumbs_tablet = array(
'.ast-breadcrumbs-inner .breadcrumb-item a' => array(
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item.active' => array(
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item:after' => array(
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item, .ast-breadcrumbs-inner .breadcrumb-item.active, .ast-breadcrumbs-inner .breadcrumb-item:after' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
),
);
/* SEOPress CSS - Mobile */
$breadcrumbs_mobile = array(
'.ast-breadcrumbs-inner .breadcrumb-item a' => array(
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item.active' => array(
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item:after' => array(
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item, .ast-breadcrumbs-inner .breadcrumb-item.active, .ast-breadcrumbs-inner .breadcrumb-item:after' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
),
);
} else {
/* Default Breadcrumb CSS - Desktop */
$breadcrumbs_desktop = array(
'.ast-breadcrumbs-wrapper .trail-items a' => array(
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .trail-items .trail-end' => array(
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .trail-items a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .trail-items li::after' => array(
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper *' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
);
/* Default Breadcrumb CSS - Tablet */
$breadcrumbs_tablet = array(
'.ast-breadcrumbs-wrapper .trail-items a' => array(
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .trail-items .trail-end' => array(
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .trail-items a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .trail-items li::after' => array(
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
),
);
/* Default Breadcrumb CSS - Mobile */
$breadcrumbs_mobile = array(
'.ast-breadcrumbs-wrapper .trail-items a' => array(
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .trail-items .trail-end' => array(
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .trail-items a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .trail-items li::after' => array(
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
),
);
}
/* Breadcrumb CSS for Background Color */
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array(
'background-color' => esc_attr( $breadcrumb_bg_color['desktop'] ),
);
$breadcrumbs_tablet['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array(
'background-color' => esc_attr( $breadcrumb_bg_color['tablet'] ),
);
$breadcrumbs_mobile['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array(
'background-color' => esc_attr( $breadcrumb_bg_color['mobile'] ),
);
/* Breadcrumb CSS for Spacing */
if ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) {
// After Header.
$breadcrumbs_desktop['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ),
);
$breadcrumbs_tablet['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ),
);
$breadcrumbs_mobile['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ),
);
$breadcrumbs_default_css['.ast-header-breadcrumb'] = array(
'padding-top' => '10px',
'padding-bottom' => '10px',
'width' => '100%',
);
} elseif ( 'astra_masthead_content' === $breadcrumb_position ) {
// Inside Header.
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ),
);
$breadcrumbs_tablet['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ),
);
$breadcrumbs_mobile['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ),
);
$breadcrumbs_default_css['.ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-bottom' => '10px',
);
$breadcrumbs_default_css['.ast-header-break-point .ast-breadcrumbs-wrapper'] = array(
'order' => '4',
);
} else {
// Before Title.
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ),
);
$breadcrumbs_tablet['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ),
);
$breadcrumbs_mobile['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ),
);
}
/* Breadcrumb CSS for Alignment */
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper'] = array(
'text-align' => esc_attr( $breadcrumb_alignment ),
);
$css .= astra_parse_css( $breadcrumbs_desktop );
$css .= astra_parse_css( $breadcrumbs_tablet, '', astra_get_tablet_breakpoint() );
$css .= astra_parse_css( $breadcrumbs_mobile, '', astra_get_mobile_breakpoint() );
$css .= astra_parse_css( $breadcrumbs_default_css );
/* Breadcrumb default CSS */
$css .= astra_parse_css(
array(
'.ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar.ast-header-breadcrumb' => array(
'padding-top' => '1em',
'padding-bottom' => '1em',
),
),
'',
''
);
$css .= astra_parse_css(
array(
'.ast-header-break-point .main-header-bar.ast-header-breadcrumb' => array(
'border-bottom-width' => '1px',
'border-bottom-color' => '#eaeaea',
'border-bottom-style' => 'solid',
),
),
'',
''
);
$css .= astra_parse_css(
array(
'.ast-breadcrumbs-wrapper' => array(
'line-height' => '1.4',
),
),
'',
''
);
$css .= astra_parse_css(
array(
'.ast-breadcrumbs-wrapper .rank-math-breadcrumb p' => array(
'margin-bottom' => '0px',
),
),
'',
''
);
$css .= astra_parse_css(
array(
'.ast-breadcrumbs-wrapper' => array(
'display' => 'block',
'width' => '100%',
),
),
'',
''
);
$dynamic_css .= $css;
return $dynamic_css;
}
PK #ZGJ GJ : breadcrumbs/customizer/class-astra-breadcrumbs-configs.phpnu [ __( 'Default', 'astra' ),
),
'breadcrumb-list'
);
$_section = 'section-breadcrumb';
$positions = array(
'none' => __( 'None', 'astra' ),
'astra_masthead_content' => __( 'Inside', 'astra' ),
'astra_header_markup_after' => __( 'After Header', 'astra' ),
'astra_entry_top' => __( 'Before Title', 'astra' ),
);
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$positions = array(
'none' => __( 'None', 'astra' ),
'astra_header_primary_container_after' => __( 'Inside', 'astra' ),
'astra_header_after' => __( 'After', 'astra' ),
'astra_entry_top' => __( 'Before Title', 'astra' ),
);
}
$_configs = array(
/*
* Breadcrumb
*/
array(
'name' => $_section,
'type' => 'section',
'priority' => 20,
'title' => __( 'Breadcrumb', 'astra' ),
'description_hidden' => true,
'description' => $this->section_get_description(
array(
'description' => '' . __( 'Helpful Information', 'astra' ) . '
',
'links' => array(
array(
'text' => __( 'Breadcrumb Overview', 'astra' ) . ' »',
'attrs' => array(
'href' => astra_get_pro_url( '/docs/add-breadcrumbs-with-astra/', 'free-theme', 'customizer', 'helpful_information' ),
),
),
),
)
),
),
/**
* Option: Breadcrumb Position
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'default' => astra_get_option( 'breadcrumb-position', 'none' ),
'section' => $_section,
'title' => __( 'Header Position', 'astra' ),
'type' => 'control',
'control' => 'ast-select',
'priority' => 5,
'choices' => $positions,
'partial' => array(
'selector' => '.ast-breadcrumbs-wrapper .ast-breadcrumbs .trail-items',
'container_inclusive' => false,
),
'context' => Astra_Builder_Helper::$general_tab,
'responsive' => false,
'renderAs' => 'text',
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
// Breadcrumb if set to None - Show the notice under the Design tab.
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-position-none-notice]',
'type' => 'control',
'control' => 'ast-description',
'section' => $_section,
'priority' => 5,
'label' => '',
'help' => __( 'Note: To get design settings in action make sure to select Header Position other than None.', 'astra' ),
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '==',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Divider
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-layout-divider]',
'section' => $_section,
'title' => __( 'Display Settings', 'astra' ),
'type' => 'control',
'control' => 'ast-heading',
'priority' => 25,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
/**
* Option: Disable Breadcrumb on Categories
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-home-page]',
'default' => astra_get_option( 'breadcrumb-disable-home-page', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on Home Page?', 'astra' ),
'priority' => 25,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
/**
* Option: Disable Breadcrumb on Categories
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-blog-posts-page]',
'default' => astra_get_option( 'breadcrumb-disable-blog-posts-page', '1' ),
'type' => 'control',
'section' => $_section,
'description' => __( 'Latest posts page or when any page is selected as blog page', 'astra' ),
'title' => __( 'Enable on Blog / Posts Page?', 'astra' ),
'priority' => 25,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on Search
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-search]',
'default' => astra_get_option( 'breadcrumb-disable-search', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on Search?', 'astra' ),
'priority' => 30,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on Archive
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-archive]',
'default' => astra_get_option( 'breadcrumb-disable-archive', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on Archive?', 'astra' ),
'priority' => 35,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on Single Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-single-page]',
'default' => astra_get_option( 'breadcrumb-disable-single-page', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on Single Page?', 'astra' ),
'priority' => 40,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on Single Post
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-single-post]',
'default' => astra_get_option( 'breadcrumb-disable-single-post', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on Single Post?', 'astra' ),
'priority' => 45,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on Singular
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-singular]',
'default' => astra_get_option( 'breadcrumb-disable-singular', '1' ),
'type' => 'control',
'section' => $_section,
'description' => __( 'All Pages, All Posts, All Attachments', 'astra' ),
'title' => __( 'Enable on Singular?', 'astra' ),
'priority' => 50,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on 404 Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-404-page]',
'default' => astra_get_option( 'breadcrumb-disable-404-page', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on 404 Page?', 'astra' ),
'priority' => 55,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Breadcrumb Alignment
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-alignment]',
'default' => astra_get_option( 'breadcrumb-alignment', 'left' ),
'section' => $_section,
'transport' => 'postMessage',
'title' => __( 'Alignment', 'astra' ),
'type' => 'control',
'control' => 'ast-selector',
'priority' => 24,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
'choices' => array(
'left' => 'align-left',
'center' => 'align-center',
'right' => 'align-right',
),
'responsive' => false,
'divider' => array( 'ast_class' => 'ast-top-section-divider ast-bottom-spacing' ),
),
/**
* Option: Breadcrumb Spacing
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-spacing]',
'default' => astra_get_option( 'breadcrumb-spacing' ),
'type' => 'control',
'transport' => 'postMessage',
'control' => 'ast-responsive-spacing',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
'priority' => 83,
'title' => __( 'Spacing', 'astra' ),
'linked_choices' => true,
'unit_choices' => array( 'px', 'em', '%' ),
'choices' => array(
'top' => __( 'Top', 'astra' ),
'right' => __( 'Right', 'astra' ),
'bottom' => __( 'Bottom', 'astra' ),
'left' => __( 'Left', 'astra' ),
),
'section' => $_section,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
),
);
if ( $this->is_third_party_breadcrumb_active() ) {
$_configs[] = array(
'name' => ASTRA_THEME_SETTINGS . '[select-breadcrumb-source]',
'default' => astra_get_option( 'select-breadcrumb-source', 'default' ),
'section' => $_section,
'title' => __( 'Breadcrumb Source', 'astra' ),
'type' => 'control',
'control' => 'ast-select',
'priority' => 10,
'choices' => $breadcrumb_source_list,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
'divider' => array( 'ast_class' => 'ast-top-divider' ),
);
}
if ( $this->is_selected_breadcrumb_active() ) {
/**
* Option: Breadcrumb separator
*/
$_configs[] = array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-selector]',
'type' => 'control',
'control' => 'ast-radio-image',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ),
'default' => astra_get_option( 'breadcrumb-separator-selector' ),
'priority' => 15,
'title' => __( 'Separator', 'astra' ),
'section' => $_section,
'choices' => array(
'\003E' => array(
'label' => __( 'Type 1', 'astra' ),
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-1' ),
),
'\00BB' => array(
'label' => __( 'Type 2', 'astra' ),
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-2' ),
),
'\002F' => array(
'label' => __( 'Type 3', 'astra' ),
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-3' ),
),
'unicode' => array(
'label' => __( 'Custom separator', 'astra' ),
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-unicode' ),
),
),
'alt_layout' => true,
'transport' => 'postMessage',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
);
/**
* Option: Breadcrumb Unicode input
*/
$_configs[] = array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator]',
'type' => 'control',
'control' => 'text',
'section' => $_section,
'default' => astra_get_option( 'breadcrumb-separator' ),
'priority' => 15,
'title' => __( 'Unicode', 'astra' ),
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-selector]',
'operator' => '=',
'value' => 'unicode',
),
Astra_Builder_Helper::$general_tab_config,
),
'transport' => 'postMessage',
);
}
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$_configs[] = array(
'name' => $_section . '-ast-context-tabs',
'section' => $_section,
'type' => 'control',
'control' => 'ast-builder-header-control',
'priority' => 0,
'description' => '',
);
}
return array_merge( $configurations, $_configs );
}
/**
* Is third-party breadcrumb active.
* Decide if the Source option should be visible depending on third party plugins.
*
* @return boolean True - If the option should be displayed, False - If the option should be hidden.
*/
public function is_third_party_breadcrumb_active() {
// Check if breadcrumb is turned on from WPSEO option.
$breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false;
$wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable;
if ( ! is_array( $wpseo_option ) ) {
unset( $wpseo_option );
$wpseo_option = array(
'breadcrumbs-enable' => $breadcrumb_enable,
);
}
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] ) {
// Check if breadcrumb is turned on from SEO Yoast plugin.
return true;
} elseif ( function_exists( 'bcn_display' ) ) {
// Check if breadcrumb is turned on from Breadcrumb NavXT plugin.
return true;
} elseif ( function_exists( 'rank_math_the_breadcrumbs' ) ) {
// Check if breadcrumb is turned on from Rank Math plugin.
return true;
} elseif ( function_exists( 'seopress_display_breadcrumbs' ) ) {
// Check if breadcrumb is turned on from SEOPress plugin.
return true;
} else {
return false;
}
}
/**
* Is selected third-party breadcrumb active.
* Decide if the Separator option should be visible depending on third party plugins.
*
* @return boolean True - If the option should be displayed, False - If the option should be hidden.
*/
public function is_selected_breadcrumb_active() {
// Check if breadcrumb is turned on from WPSEO option.
$selected_breadcrumb_source = astra_get_option( 'select-breadcrumb-source' );
$breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false;
$wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable;
if ( ! is_array( $wpseo_option ) ) {
unset( $wpseo_option );
$wpseo_option = array(
'breadcrumbs-enable' => $breadcrumb_enable,
);
}
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && 'yoast-seo-breadcrumbs' === $selected_breadcrumb_source ) {
// Check if breadcrumb is turned on from SEO Yoast plugin.
return false;
} elseif ( function_exists( 'bcn_display' ) && 'breadcrumb-navxt' === $selected_breadcrumb_source ) {
// Check if breadcrumb is turned on from Breadcrumb NavXT plugin.
return false;
} elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && 'rank-math' === $selected_breadcrumb_source ) {
// Check if breadcrumb is turned on from Rank Math plugin.
return false;
} elseif ( function_exists( 'seopress_display_breadcrumbs' ) ) {
// Check if breadcrumb is turned on from SEOPress plugin.
return false;
} else {
return true;
}
}
}
}
new Astra_Breadcrumbs_Configs();
PK #Z~ ? breadcrumbs/customizer/class-astra-breadcrumbs-typo-configs.phpnu [ ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
'default' => astra_get_option( 'section-breadcrumb-typo' ),
'type' => 'control',
'control' => 'ast-settings-group',
'title' => esc_html__( 'Content Font', 'astra' ),
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'priority' => 71,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-section-divider' ),
),
/**
* Option: Font Family
*/
array(
'name' => 'breadcrumb-font-family',
'default' => astra_get_option( 'breadcrumb-font-family' ),
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
'section' => 'section-breadcrumb',
'control' => 'ast-font',
'font_type' => 'ast-font-family',
'title' => esc_html__( 'Font Family', 'astra' ),
'connect' => 'breadcrumb-font-weight',
'priority' => 5,
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
),
/**
* Option: Font Weight
*/
array(
'name' => 'breadcrumb-font-weight',
'control' => 'ast-font',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
'section' => 'section-breadcrumb',
'font_type' => 'ast-font-weight',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
'default' => astra_get_option( 'breadcrumb-font-weight' ),
'title' => esc_html__( 'Font Weight', 'astra' ),
'connect' => 'breadcrumb-font-family',
'priority' => 10,
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
),
/**
* Option: Font Size
*/
array(
'name' => 'breadcrumb-font-size',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
'type' => 'sub-control',
'control' => 'ast-responsive-slider',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'title' => esc_html__( 'Font Size', 'astra' ),
'priority' => 10,
'default' => astra_get_option( 'breadcrumb-font-size' ),
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
'input_attrs' => array(
'px' => array(
'min' => 0,
'step' => 1,
'max' => 200,
),
'em' => array(
'min' => 0,
'step' => 0.01,
'max' => 20,
),
'vw' => array(
'min' => 0,
'step' => 0.1,
'max' => 25,
),
'rem' => array(
'min' => 0,
'step' => 0.1,
'max' => 20,
),
),
),
/**
* Option: Breadcrumb Content Font Extras
*/
array(
'name' => 'breadcrumb-font-extras',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
'control' => 'ast-font-extras',
'section' => 'section-breadcrumb',
'priority' => 25,
'default' => astra_get_option( 'breadcrumb-font-extras' ),
'title' => esc_html__( 'Line Height', 'astra' ),
),
);
return array_merge( $configurations, $_configs );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
new Astra_Breadcrumbs_Typo_Configs();
PK #ZHY @ breadcrumbs/customizer/class-astra-breadcrumbs-color-configs.phpnu [ ASTRA_THEME_SETTINGS . '[breadcrumb-color-section-divider]',
'section' => 'section-breadcumb',
'title' => __( 'Colors', 'astra' ),
'type' => 'control',
'control' => 'ast-heading',
'priority' => 72,
'divider' => array( 'ast_class' => 'ast-bottom-spacing' ),
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
),
/*
* Breadcrumb Color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-bg-color]',
'type' => 'control',
'default' => astra_get_option( 'breadcrumb-bg-color' ),
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'title' => __( 'Background Color', 'astra' ),
'responsive' => true,
'rgba' => true,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
'priority' => 72,
),
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-active-color-responsive]',
'default' => astra_get_option( 'breadcrumb-active-color-responsive' ),
'type' => 'control',
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'title' => __( 'Text Color', 'astra' ),
'responsive' => true,
'rgba' => true,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
'priority' => 72,
),
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-color]',
'default' => astra_get_option( 'breadcrumb-separator-color' ),
'type' => 'control',
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'title' => __( 'Separator Color', 'astra' ),
'responsive' => true,
'rgba' => true,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
'priority' => 72,
),
array(
'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]',
'default' => astra_get_option( 'section-breadcrumb-color' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Content Link Color', 'astra' ),
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'priority' => 72,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
'responsive' => true,
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
),
array(
'name' => 'breadcrumb-text-color-responsive',
'default' => astra_get_option( 'breadcrumb-text-color-responsive' ),
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]',
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'tab' => __( 'Normal', 'astra' ),
'control' => 'ast-responsive-color',
'title' => __( 'Normal', 'astra' ),
'responsive' => true,
'rgba' => true,
'priority' => 15,
),
array(
'name' => 'breadcrumb-hover-color-responsive',
'default' => astra_get_option( 'breadcrumb-hover-color-responsive' ),
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]',
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'tab' => __( 'Hover', 'astra' ),
'control' => 'ast-responsive-color',
'title' => __( 'Hover', 'astra' ),
'responsive' => true,
'rgba' => true,
'priority' => 20,
),
);
if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
array_push(
$_configs,
/**
* Option: Divider
* Option: breadcrumb color Section divider
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-color-divider]',
'type' => 'control',
'control' => 'ast-heading',
'section' => 'section-breadcrumb',
'title' => __( 'Colors', 'astra' ),
'priority' => 71,
'settings' => array(),
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
)
);
}
return array_merge( $configurations, $_configs );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
new Astra_Breadcrumbs_Color_Configs();
PK #ZJϺl , breadcrumbs/class-astra-breadcrumb-trail.phpnu [
' .
astra_get_selected_breadcrumb( $echo ) .
'
';
}
?>
$breadcrumb_enable
);
}
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && $breadcrumb_source && 'yoast-seo-breadcrumbs' == $breadcrumb_source ) {
// Check if breadcrumb is turned on from WPSEO option.
return yoast_breadcrumb( '', '
', $echo );
} elseif ( function_exists( 'bcn_display' ) && $breadcrumb_source && 'breadcrumb-navxt' == $breadcrumb_source ) {
if( true === $echo ) {
?>
' . bcn_display( ! $echo ) . '';
} elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && $breadcrumb_source && 'rank-math' == $breadcrumb_source ) {
// Check if breadcrumb is turned on from Rank Math plugin.
if ( ! $echo ) {
ob_start();
rank_math_the_breadcrumbs();
return ob_get_clean();
}
rank_math_the_breadcrumbs();
} elseif ( function_exists( 'seopress_display_breadcrumbs' ) && $breadcrumb_source && 'seopress' == $breadcrumb_source ) {
// Check if breadcrumb is turned on from SEOPress plugin.
if ( ! $echo ) {
ob_start();
seopress_display_breadcrumbs( false );
return ob_get_clean();
}
seopress_display_breadcrumbs();
} else {
// Load default Astra breadcrumb if none selected.
return astra_get_breadcrumb_trail( $echo );
}
}
/**
* Deprecating astra_breadcrumb_trail function.
*
* @since 1.8.1
* @deprecated 1.8.1 Use astra_get_breadcrumb()
* @param array $args List of args.
* @see astra_breadcrumb_trail()
*
* @return string new breadcrumb function.
*/
function astra_breadcrumb_trail( $args = array() ) {
_deprecated_function( __FUNCTION__, '1.8.1', 'astra_get_breadcrumb()' );
astra_get_breadcrumb();
}
/**
* Shows a breadcrumb for all types of pages. This is a wrapper function for the Breadcrumb_Trail class,
* which should be used in theme templates.
*
* @since 1.8.1
* @param boolean $echo Whether to echo or not.
* @return string Selected Breadcrumb.
*/
function astra_get_breadcrumb_trail( $echo = true ) {
$defaults = array(
'before' => '',
'after' => '
',
'show_browse' => false,
'echo' => $echo,
);
$args = apply_filters( 'astra_breadcrumb_trail_args', $defaults );
$breadcrumb = apply_filters( 'astra_breadcrumb_trail_object', null, $args );
if ( ! is_object( $breadcrumb ) ) {
$breadcrumb = new Astra_Breadcrumb_Trail( $args );
}
return $breadcrumb->trail();
}
/**
* Creates a breadcrumbs menu for the site based on the current page that's being viewed by the user.
*
* @since 0.6.0
*/
class Astra_Breadcrumb_Trail {
/**
* Array of items belonging to the current breadcrumb trail.
*
* @since 0.1.0
* @var array
*/
public $items = array();
/**
* Arguments used to build the breadcrumb trail.
*
* @since 0.1.0
* @var array
*/
public $args = array();
/**
* Array of text labels.
*
* @since 1.0.0
* @var array
*/
public $labels = array();
/**
* Array of post types (key) and taxonomies (value) to use for single post views.
*
* @since 1.0.0
* @var array
*/
public $post_taxonomy = array();
/* ====== Magic Methods ====== */
/**
* Magic method to use in case someone tries to output the layout object as a string.
* We'll just return the trail HTML.
*
* @since 1.0.0
* @return string
*/
public function __toString() {
return $this->trail();
}
/**
* Sets up the breadcrumb trail properties. Calls the `Breadcrumb_Trail::add_items()` method
* to create the array of breadcrumb items.
*
* @since 0.6.0
* @param array $args {
* @type string $container Container HTML element. nav|div
* @type string $before String to output before breadcrumb menu.
* @type string $after String to output after breadcrumb menu.
* @type string $browse_tag The HTML tag to use to wrap the "Browse" header text.
* @type string $list_tag The HTML tag to use for the list wrapper.
* @type string $item_tag The HTML tag to use for the item wrapper.
* @type bool $show_on_front Whether to show when `is_front_page()`.
* @type bool $network Whether to link to the network main site (multisite only).
* @type bool $show_title Whether to show the title (last item) in the trail.
* @type bool $show_browse Whether to show the breadcrumb menu header.
* @type array $labels Text labels. @see Breadcrumb_Trail::set_labels()
* @type array $post_taxonomy Taxonomies to use for post types. @see Breadcrumb_Trail::set_post_taxonomy()
* @type bool $echo Whether to print or return the breadcrumbs.
* }
* @return void
*/
public function __construct( $args = array() ) {
$defaults = array(
'container' => 'nav',
'before' => '',
'after' => '',
'browse_tag' => 'h2',
'list_tag' => 'ul',
'item_tag' => 'li',
'show_on_front' => true,
'network' => false,
'show_title' => true,
'show_browse' => true,
'labels' => array(),
'post_taxonomy' => array(),
'echo' => true,
'schema' => true,
);
// Parse the arguments with the deaults.
$this->args = apply_filters( 'astra_breadcrumb_trail_args', wp_parse_args( $args, $defaults ) );
// Set the labels and post taxonomy properties.
$this->set_labels();
$this->set_post_taxonomy();
// Let's find some items to add to the trail!
$this->add_items();
}
/* ====== Public Methods ====== */
/**
* Formats the HTML output for the breadcrumb trail.
*
* @since 0.6.0
* @return string
*/
public function trail() {
// Set up variables that we'll need.
$breadcrumb = '';
$item_count = count( $this->items );
$item_position = 0;
$meta = '';
if ( 2 > $item_count ) {
$this->args['schema'] = false;
}
// Connect the breadcrumb trail if there are items in the trail.
if ( 0 < $item_count ) {
// Add 'browse' label if it should be shown.
if ( true === $this->args['show_browse'] ) {
$breadcrumb .= sprintf(
'<%1$s class="trail-browse">%2$s%1$s>',
tag_escape( $this->args['browse_tag'] ),
$this->labels['browse']
);
}
// Open the unordered list.
$breadcrumb .= sprintf(
'<%1$s class="trail-items" %2$s>',
tag_escape( $this->args['list_tag'] ),
( $this->args['schema'] ? 'itemscope itemtype="http://schema.org/BreadcrumbList"' : '' )
);
if ( $this->args['schema'] ) {
// Add the number of items and item list order schema.
$breadcrumb .= sprintf( '', absint( $item_count ), astra_attr(
'breadcrumb-trail-items-num-meta',
array(
'name' => 'numberOfItems',
'class' => '',
)
) );
$breadcrumb .= ' '',
'name' => 'itemListOrder',
'content' => 'Ascending',
)
) . '/>';
}
// Loop through the items and add them to the list.
foreach ( $this->items as $item ) {
// Iterate the item position.
++$item_position;
// Check if the item is linked.
preg_match( '/()(.*?)(<\/a>)/i', $item, $matches );
// Wrap the item text with appropriate itemprop.
$item = ! empty( $matches ) ? sprintf( '%s%s%s', $matches[1], $this->args['schema'] ? 'itemprop="name"' : '', $matches[2], $matches[3] ) : sprintf( '%s', $item );
// Wrap the item with its itemprop.
$item = ( ! empty( $matches ) && $this->args['schema'] )
? preg_replace( '/(/i', '$1$2 itemprop=$2item$2>', $item )
: sprintf( '%s', $item );
// Add list item classes.
$item_class = 'trail-item';
$item_schema_attr = 'itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"';
if ( 1 === $item_position && 1 < $item_count ) {
$item_class .= ' trail-begin';
} elseif ( $item_count === $item_position ) {
$item_class .= ' trail-end';
$item_schema_attr = '';
}
// Create list item attributes.
$attributes = $this->args['schema'] ? $item_schema_attr : '';
$attributes .= ' class="' . $item_class . '"';
if ( $this->args['schema'] ) {
// Build the meta position HTML.
$meta = sprintf( '', absint( $item_position ) );
}
if ( $item_count === $item_position ) {
$meta = '';
}
// Build the list item.
$breadcrumb .= sprintf( '<%1$s %2$s>%3$s%4$s%1$s>', tag_escape( $this->args['item_tag'] ),$attributes, $item, $meta );
}
// Close the unordered list.
$breadcrumb .= sprintf( '%s>', tag_escape( $this->args['list_tag'] ) );
// Wrap the breadcrumb trail.
$breadcrumb = sprintf(
'<%1$s role="navigation" aria-label="%2$s" class="breadcrumb-trail breadcrumbs" >%3$s%4$s%5$s%1$s>',
tag_escape( $this->args['container'] ),
esc_attr( $this->labels['aria_label'] ),
$this->args['before'],
$breadcrumb,
$this->args['after']
);
}
// Allow developers to filter the breadcrumb trail HTML.
$breadcrumb = apply_filters( 'astra_breadcrumb_trail', $breadcrumb, $this->args );
if ( false === $this->args['echo'] ) {
return $breadcrumb;
}
echo wp_kses_post( $breadcrumb );
}
/* ====== Protected Methods ====== */
/**
* Sets the labels property. Parses the inputted labels array with the defaults.
*
* @since 1.0.0
* @return void
*/
protected function set_labels() {
$defaults = array(
'browse' => esc_html__( 'Browse:', 'astra' ),
'aria_label' => esc_attr_x( 'Breadcrumbs', 'breadcrumbs aria label', 'astra' ),
'home' => esc_html__( 'Home', 'astra' ),
'error_404' => esc_html__( '404 Not Found', 'astra' ),
'archives' => esc_html__( 'Archives', 'astra' ),
// Translators: %s is the search query.
'search' => esc_html__( 'Search results for: %s', 'astra' ),
// Translators: %s is the page number.
'paged' => esc_html__( 'Page %s', 'astra' ),
// Translators: %s is the page number.
'paged_comments' => esc_html__( 'Comment Page %s', 'astra' ),
// Translators: Minute archive title. %s is the minute time format.
'archive_minute' => esc_html__( 'Minute %s', 'astra' ),
// Translators: Weekly archive title. %s is the week date format.
'archive_week' => esc_html__( 'Week %s', 'astra' ),
// "%s" is replaced with the translated date/time format.
'archive_minute_hour' => '%s',
'archive_hour' => '%s',
'archive_day' => '%s',
'archive_month' => '%s',
'archive_year' => '%s',
);
$this->labels = apply_filters( 'astra_breadcrumb_trail_labels', wp_parse_args( $this->args['labels'], $defaults ) );
}
/**
* Sets the `$post_taxonomy` property. This is an array of post types (key) and taxonomies (value).
* The taxonomy's terms are shown on the singular post view if set.
*
* @since 1.0.0
* @return void
*/
protected function set_post_taxonomy() {
$defaults = array();
// If post permalink is set to `%postname%`, use the `category` taxonomy.
if ( '%postname%' === trim( get_option( 'permalink_structure' ), '/' ) ) {
$defaults['post'] = 'category';
}
$this->post_taxonomy = apply_filters( 'astra_breadcrumb_trail_post_taxonomy', wp_parse_args( $this->args['post_taxonomy'], $defaults ) );
}
/**
* Runs through the various WordPress conditional tags to check the current page being viewed. Once
* a condition is met, a specific method is launched to add items to the `$items` array.
*
* @since 1.0.0
* @return void
*/
protected function add_items() {
// If viewing the front page.
if ( is_front_page() ) {
$this->add_front_page_items();
}
// If not viewing the front page.
else {
// Add the network and site home links.
$this->add_network_home_link();
$this->add_site_home_link();
// If viewing the home/blog page.
if ( is_home() ) {
$this->add_blog_items();
}
// If viewing a single post.
elseif ( is_singular() ) {
$this->add_singular_items();
}
// If viewing an archive page.
elseif ( is_archive() ) {
if ( is_post_type_archive() ) {
$this->add_post_type_archive_items();
}
elseif ( is_category() || is_tag() || is_tax() ) {
$this->add_term_archive_items();
}
elseif ( is_author() ) {
$this->add_user_archive_items();
}
elseif ( get_query_var( 'minute' ) && get_query_var( 'hour' ) ) {
$this->add_minute_hour_archive_items();
}
elseif ( get_query_var( 'minute' ) ) {
$this->add_minute_archive_items();
}
elseif ( get_query_var( 'hour' ) ) {
$this->add_hour_archive_items();
}
elseif ( is_day() ) {
$this->add_day_archive_items();
}
elseif ( get_query_var( 'w' ) ) {
$this->add_week_archive_items();
}
elseif ( is_month() ) {
$this->add_month_archive_items();
}
elseif ( is_year() ) {
$this->add_year_archive_items();
}
else {
$this->add_default_archive_items();
}
}
// If viewing a search results page.
elseif ( is_search() ) {
$this->add_search_items();
}
// If viewing the 404 page.
elseif ( is_404() ) {
$this->add_404_items();
}
}
// Add paged items if they exist.
$this->add_paged_items();
// Allow developers to overwrite the items for the breadcrumb trail.
$this->items = array_unique( apply_filters( 'astra_breadcrumb_trail_items', $this->items, $this->args ) );
}
/**
* Gets front items based on $wp_rewrite->front.
*
* @since 1.0.0
* @return void
*/
protected function add_rewrite_front_items() {
global $wp_rewrite;
if ( $wp_rewrite->front ) {
$this->add_path_parents( $wp_rewrite->front );
}
}
/**
* Adds the page/paged number to the items array.
*
* @since 1.0.0
* @return void
*/
protected function add_paged_items() {
// If viewing a paged singular post.
if ( is_singular() && 1 < get_query_var( 'page' ) && true === $this->args['show_title'] ) {
$this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'page' ) ) ) );
}
// If viewing a singular post with paged comments.
elseif ( is_singular() && get_option( 'page_comments' ) && 1 < get_query_var( 'cpage' ) ) {
$this->items[] = sprintf( $this->labels['paged_comments'], number_format_i18n( absint( get_query_var( 'cpage' ) ) ) );
}
// If viewing a paged archive-type page.
elseif ( is_paged() && true === $this->args['show_title'] ) {
$this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'paged' ) ) ) );
}
}
/**
* Adds the network (all sites) home page link to the items array.
*
* @since 1.0.0
* @return void
*/
protected function add_network_home_link() {
if ( is_multisite() && ! is_main_site() && true === $this->args['network'] ) {
$this->items[] = sprintf( '%s', esc_url( network_home_url() ), $this->labels['home'] );
}
}
/**
* Adds the current site's home page link to the items array.
*
* @since 1.0.0
* @return void
*/
protected function add_site_home_link() {
$network = is_multisite() && ! is_main_site() && true === $this->args['network'];
$label = $network ? get_bloginfo( 'name' ) : $this->labels['home'];
$rel = $network ? '' : ' rel="home"';
$this->items[] = sprintf( '%s', esc_url( user_trailingslashit( home_url() ) ), $rel, $label );
}
/**
* Adds items for the front page to the items array.
*
* @since 1.0.0
* @return void
*/
protected function add_front_page_items() {
// Only show front items if the 'show_on_front' argument is set to 'true'.
if ( true === $this->args['show_on_front'] || is_paged() || ( is_singular() && 1 < get_query_var( 'page' ) ) ) {
// Add network home link.
$this->add_network_home_link();
// If on a paged view, add the site home link.
if ( is_paged() ) {
$this->add_site_home_link();
}
// If on the main front page, add the network home title.
elseif ( true === $this->args['show_title'] ) {
$this->items[] = is_multisite() && true === $this->args['network'] ? get_bloginfo( 'name' ) : $this->labels['home'];
}
}
}
/**
* Adds items for the posts page (i.e., is_home()) to the items array.
*
* @since 1.0.0
* @return void
*/
protected function add_blog_items() {
// Get the post ID and post.
$post_id = get_queried_object_id();
$post = get_post( $post_id );
// If the post has parents, add them to the trail.
if ( 0 < $post->post_parent ) {
$this->add_post_parents( $post->post_parent );
}
// Get the page title.
$title = get_the_title( $post_id );
// Add the posts page item.
if ( is_paged() ) {
$this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), $title );
}
elseif ( $title && true === $this->args['show_title'] ) {
$this->items[] = $title;
}
}
/**
* Adds singular post items to the items array.
*
* @since 1.0.0
* @return void
*/
protected function add_singular_items() {
// Get the queried post.
$post = get_queried_object();
$post_id = get_queried_object_id();
// If the post has a parent, follow the parent trail.
if ( 0 < $post->post_parent ) {
$this->add_post_parents( $post->post_parent );
}
// If the post doesn't have a parent, get its hierarchy based off the post type.
else {
$this->add_post_hierarchy( $post_id );
}
// Display terms for specific post type taxonomy if requested.
if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) ) {
$this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] );
}
// End with the post title.
if ( $post_title = single_post_title( '', false ) ) {
if ( ( 1 < get_query_var( 'page' ) || is_paged() ) || ( get_option( 'page_comments' ) && 1 < absint( get_query_var( 'cpage' ) ) ) ) {
$this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), $post_title );
}
elseif ( true === $this->args['show_title'] ) {
$this->items[] = $post_title;
}
}
}
/**
* Adds the items to the trail items array for taxonomy term archives.
*
* @since 1.0.0
* @global object $wp_rewrite
* @return void
*/
protected function add_term_archive_items() {
global $wp_rewrite;
// Get some taxonomy and term variables.
$term = get_queried_object();
$taxonomy = get_taxonomy( $term->taxonomy );
$done_post_type = false;
// If there are rewrite rules for the taxonomy.
if ( false !== $taxonomy->rewrite ) {
// If 'with_front' is true, dd $wp_rewrite->front to the trail.
if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front ) {
$this->add_rewrite_front_items();
}
// Get parent pages by path if they exist.
$this->add_path_parents( $taxonomy->rewrite['slug'] );
// Add post type archive if its 'has_archive' matches the taxonomy rewrite 'slug'.
if ( $taxonomy->rewrite['slug'] ) {
$slug = trim( $taxonomy->rewrite['slug'], '/' );
// Deals with the situation if the slug has a '/' between multiple
// strings. For example, "movies/genres" where "movies" is the post
// type archive.
$matches = explode( '/', $slug );
// If matches are found for the path.
if ( isset( $matches ) ) {
// Reverse the array of matches to search for posts in the proper order.
$matches = array_reverse( $matches );
// Loop through each of the path matches.
foreach ( $matches as $match ) {
// Get public post types that match the rewrite slug.
$post_types = $this->get_post_types_by_slug( $match );
if ( ! empty( $post_types ) ) {
$post_type_object = $post_types[0];
// Add support for a non-standard label of 'archive_title' (special use case).
$label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name;
// Core filter hook.
$label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name );
// Add the post type archive link to the trail.
$this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), $label );
$done_post_type = true;
// Break out of the loop.
break;
}
}
}
}
}
// If there's a single post type for the taxonomy, use it.
if ( false === $done_post_type && 1 === count( $taxonomy->object_type ) && post_type_exists( $taxonomy->object_type[0] ) ) {
// If the post type is 'post'.
if ( 'post' === $taxonomy->object_type[0] ) {
$post_id = get_option( 'page_for_posts' );
if ( 'posts' !== get_option( 'show_on_front' ) && 0 < $post_id ) {
$this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) );
}
// If the post type is not 'post'.
} else {
$post_type_object = get_post_type_object( $taxonomy->object_type[0] );
$label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name;
// Core filter hook.
$label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name );
$this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), $label );
}
}
// If the taxonomy is hierarchical, list its parent terms.
if ( is_taxonomy_hierarchical( $term->taxonomy ) && $term->parent ) {
$this->add_term_parents( $term->parent, $term->taxonomy );
}
// Add the term name to the trail end.
if ( is_paged() ){
$this->items[] = sprintf( '%s', esc_url( get_term_link( $term, $term->taxonomy ) ), single_term_title( '', false ) );
}
elseif ( true === $this->args['show_title'] ) {
$this->items[] = single_term_title( '', false );
}
}
/**
* Adds the items to the trail items array for post type archives.
*
* @since 1.0.0
* @return void
*/
protected function add_post_type_archive_items() {
// Get the post type object.
$post_type_object = get_post_type_object( get_query_var( 'post_type' ) );
if ( is_object( $post_type_object ) && is_array( $post_type_object->rewrite ) ) {
// If 'with_front' is true, add $wp_rewrite->front to the trail.
if ( isset( $post_type_object->rewrite['with_front'] ) && $post_type_object->rewrite['with_front'] ) {
$this->add_rewrite_front_items();
}
// If there's a rewrite slug, check for parents.
if ( isset( $post_type_object->rewrite['slug'] ) && ! empty( $post_type_object->rewrite['slug'] ) ) {
$this->add_path_parents( $post_type_object->rewrite['slug'] );
}
}
// Add the post type [plural] name to the trail end.
if ( is_paged() || is_author() ) {
if ( is_object( $post_type_object ) ) {
$this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), post_type_archive_title( '', false ) );
}
}
elseif ( true === $this->args['show_title'] ) {
$this->items[] = post_type_archive_title( '', false );
}
// If viewing a post type archive by author.
if ( is_author() ) {
$this->add_user_archive_items();
}
}
/**
* Adds the items to the trail items array for user (author) archives.
*
* @since 1.0.0
* @global object $wp_rewrite
* @return void
*/
protected function add_user_archive_items() {
global $wp_rewrite;
// Add $wp_rewrite->front to the trail.
$this->add_rewrite_front_items();
// Get the user ID.
$user_id = get_query_var( 'author' );
// If $author_base exists, check for parent pages.
if ( ! empty( $wp_rewrite->author_base ) && ! is_post_type_archive() ) {
$this->add_path_parents( $wp_rewrite->author_base );
}
// Add the author's display name to the trail end.
if ( is_paged() ) {
$this->items[] = sprintf( '%s', esc_url( get_author_posts_url( $user_id ) ), get_the_author_meta( 'display_name', $user_id ) );
}
elseif ( true === $this->args['show_title'] ) {
$this->items[] = get_the_author_meta( 'display_name', $user_id );
}
}
/**
* Adds the items to the trail items array for minute + hour archives.
*
* @since 1.0.0
* @return void
*/
protected function add_minute_hour_archive_items() {
// Add $wp_rewrite->front to the trail.
$this->add_rewrite_front_items();
// Add the minute + hour item.
if ( true === $this->args['show_title'] ) {
$this->items[] = sprintf( $this->labels['archive_minute_hour'], get_the_time( esc_html_x( 'g:i a', 'minute and hour archives time format', 'astra' ) ) );
}
}
/**
* Adds the items to the trail items array for minute archives.
*
* @since 1.0.0
* @return void
*/
protected function add_minute_archive_items() {
// Add $wp_rewrite->front to the trail.
$this->add_rewrite_front_items();
// Add the minute item.
if ( true === $this->args['show_title'] ) {
$this->items[] = sprintf( $this->labels['archive_minute'], get_the_time( esc_html_x( 'i', 'minute archives time format', 'astra' ) ) );
}
}
/**
* Adds the items to the trail items array for hour archives.
*
* @since 1.0.0
* @return void
*/
protected function add_hour_archive_items() {
// Add $wp_rewrite->front to the trail.
$this->add_rewrite_front_items();
// Add the hour item.
if ( true === $this->args['show_title'] ) {
$this->items[] = sprintf( $this->labels['archive_hour'], get_the_time( esc_html_x( 'g a', 'hour archives time format', 'astra' ) ) );
}
}
/**
* Adds the items to the trail items array for day archives.
*
* @since 1.0.0
* @return void
*/
protected function add_day_archive_items() {
// Add $wp_rewrite->front to the trail.
$this->add_rewrite_front_items();
// Get year, month, and day.
$year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) );
$month = sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'astra' ) ) );
$day = sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'astra' ) ) );
// Add the year and month items.
$this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
$this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month );
// Add the day item.
if ( is_paged() ) {
$this->items[] = sprintf( '%s', esc_url( get_day_link( get_the_time( 'Y' ) ), get_the_time( 'm' ), get_the_time( 'd' ) ), $day );
}
elseif ( true === $this->args['show_title'] ) {
$this->items[] = $day;
}
}
/**
* Adds the items to the trail items array for week archives.
*
* @since 1.0.0
* @return void
*/
protected function add_week_archive_items() {
// Add $wp_rewrite->front to the trail.
$this->add_rewrite_front_items();
// Get the year and week.
$year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) );
$week = sprintf( $this->labels['archive_week'], get_the_time( esc_html_x( 'W', 'weekly archives date format', 'astra' ) ) );
// Add the year item.
$this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
// Add the week item.
if ( is_paged() ) {
/** @psalm-suppress InvalidArgument **/
$this->items[] = esc_url( get_archives_link( add_query_arg( array( 'm' => get_the_time( 'Y' ), 'w' => get_the_time( 'W' ) ), home_url() ), $week, false ) );
}
elseif ( true === $this->args['show_title'] ) {
$this->items[] = $week;
}
}
/**
* Adds the items to the trail items array for month archives.
*
* @since 1.0.0
* @return void
*/
protected function add_month_archive_items() {
// Add $wp_rewrite->front to the trail.
$this->add_rewrite_front_items();
// Get the year and month.
$year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) );
$month = sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'astra' ) ) );
// Add the year item.
$this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
// Add the month item.
if ( is_paged() ) {
$this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month );
}
elseif ( true === $this->args['show_title'] ) {
$this->items[] = $month;
}
}
/**
* Adds the items to the trail items array for year archives.
*
* @since 1.0.0
* @return void
*/
protected function add_year_archive_items() {
// Add $wp_rewrite->front to the trail.
$this->add_rewrite_front_items();
// Get the year.
$year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) );
// Add the year item.
if ( is_paged() ) {
$this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
}
elseif ( true === $this->args['show_title'] ) {
$this->items[] = $year;
}
}
/**
* Adds the items to the trail items array for archives that don't have a more specific method
* defined in this class.
*
* @since 1.0.0
* @return void
*/
protected function add_default_archive_items() {
// If this is a date-/time-based archive, add $wp_rewrite->front to the trail.
if ( is_date() || is_time() ) {
$this->add_rewrite_front_items();
}
if ( true === $this->args['show_title'] ) {
$this->items[] = $this->labels['archives'];
}
}
/**
* Adds the items to the trail items array for search results.
*
* @since 1.0.0
* @return void
*/
protected function add_search_items() {
if ( is_paged() ) {
$this->items[] = sprintf( '%s', esc_url( get_search_link() ), sprintf( $this->labels['search'], get_search_query() ) );
}
elseif ( true === $this->args['show_title'] ) {
$this->items[] = sprintf( $this->labels['search'], get_search_query() );
}
}
/**
* Adds the items to the trail items array for 404 pages.
*
* @since 1.0.0
* @return void
*/
protected function add_404_items() {
if ( true === $this->args['show_title'] ) {
$this->items[] = $this->labels['error_404'];
}
}
/**
* Adds a specific post's parents to the items array.
*
* @since 1.0.0
* @param int $post_id
* @return void
*/
protected function add_post_parents( $post_id ) {
$parents = array();
while ( $post_id ) {
// Get the post by ID.
$post = get_post( $post_id );
// If we hit a page that's set as the front page, bail.
if ( 'page' == $post->post_type && 'page' == get_option( 'show_on_front' ) && $post_id == get_option( 'page_on_front' ) ) {
break;
}
// Add the formatted post link to the array of parents.
$parents[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) );
// If there's no longer a post parent, break out of the loop.
if ( 0 >= $post->post_parent ) {
break;
}
// Change the post ID to the parent post to continue looping.
$post_id = $post->post_parent;
}
// Get the post hierarchy based off the final parent post.
$this->add_post_hierarchy( $post_id );
// Display terms for specific post type taxonomy if requested.
if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) ) {
$this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] );
}
// Merge the parent items into the items array.
$this->items = array_merge( $this->items, array_reverse( $parents ) );
}
/**
* Adds a specific post's hierarchy to the items array. The hierarchy is determined by post type's
* rewrite arguments and whether it has an archive page.
*
* @since 1.0.0
* @param int $post_id
* @return void
*/
protected function add_post_hierarchy( $post_id ) {
// Get the post type.
$post_type = get_post_type( $post_id );
$post_type_object = get_post_type_object( $post_type );
// If this is the 'post' post type, get the rewrite front items and map the rewrite tags.
if ( 'post' === $post_type ) {
// Add $wp_rewrite->front to the trail.
$this->add_rewrite_front_items();
// Map the rewrite tags.
$this->map_rewrite_tags( $post_id, get_option( 'permalink_structure' ) );
}
// If the post type has rewrite rules.
elseif ( false !== $post_type_object->rewrite ) {
// If 'with_front' is true, add $wp_rewrite->front to the trail.
if ( $post_type_object->rewrite['with_front'] ) {
$this->add_rewrite_front_items();
}
// If there's a path, check for parents.
if ( ! empty( $post_type_object->rewrite['slug'] ) ) {
$this->add_path_parents( $post_type_object->rewrite['slug'] );
}
}
// If there's an archive page, add it to the trail.
if ( $post_type_object->has_archive ) {
// Add support for a non-standard label of 'archive_title' (special use case).
$label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name;
// Core filter hook.
$label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name );
$this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type ) ), $label );
}
// Map the rewrite tags if there's a `%` in the slug.
if ( 'post' !== $post_type && ! empty( $post_type_object->rewrite['slug'] ) && false !== strpos( $post_type_object->rewrite['slug'], '%' ) ) {
$this->map_rewrite_tags( $post_id, $post_type_object->rewrite['slug'] );
}
}
/**
* Gets post types by slug. This is needed because the get_post_types() function doesn't exactly
* match the 'has_archive' argument when it's set as a string instead of a boolean.
*
* @since 0.6.0
* @param int $slug The post type archive slug to search for.
* @return void
*/
protected function get_post_types_by_slug( $slug ) {
$return = array();
$post_types = get_post_types( array(), 'objects' );
foreach ( $post_types as $type ) {
if ( $slug === $type->has_archive || ( true === $type->has_archive && $slug === $type->rewrite['slug'] ) ) {
$return[] = $type;
}
}
return $return;
}
/**
* Adds a post's terms from a specific taxonomy to the items array.
*
* @since 1.0.0
* @param int $post_id The ID of the post to get the terms for.
* @param string $taxonomy The taxonomy to get the terms from.
* @return void
*/
protected function add_post_terms( $post_id, $taxonomy ) {
// Get the post categories.
$terms = get_the_terms( $post_id, $taxonomy );
// Check that categories were returned.
if ( $terms && ! is_wp_error( $terms ) ) {
// Sort the terms by ID and get the first category.
if ( function_exists( 'wp_list_sort' ) ) {
$terms = wp_list_sort( $terms, 'term_id' );
}
else {
usort( $terms, '_usort_terms_by_ID' );
}
$term = get_term( $terms[0], $taxonomy );
// If the category has a parent, add the hierarchy to the trail.
if ( 0 < $term->parent ) {
$this->add_term_parents( $term->parent, $taxonomy );
}
// Add the category archive link to the trail.
$this->items[] = sprintf( '%s', esc_url( get_term_link( $term, $taxonomy ) ), $term->name );
}
}
/**
* Get parent posts by path. Currently, this method only supports getting parents of the 'page'
* post type. The goal of this function is to create a clear path back to home given what would
* normally be a "ghost" directory. If any page matches the given path, it'll be added.
*
* @since 1.0.0
* @param string $path The path (slug) to search for posts by.
* @return void
*/
function add_path_parents( $path ) {
// Trim '/' off $path in case we just got a simple '/' instead of a real path.
$path = trim( $path, '/' );
// If there's no path, return.
if ( empty( $path ) ) {
return;
}
// Get parent post by the path.
$post = get_page_by_path( $path );
if ( ! empty( $post ) ) {
$this->add_post_parents( $post->ID );
}
elseif ( is_null( $post ) ) {
// Separate post names into separate paths by '/'.
$path = trim( $path, '/' );
preg_match_all( "/\/.*?\z/", $path, $matches );
// If matches are found for the path.
if ( isset( $matches ) ) {
// Reverse the array of matches to search for posts in the proper order.
$matches = array_reverse( $matches );
// Loop through each of the path matches.
foreach ( $matches as $match ) {
// If a match is found.
if ( isset( $match[0] ) ) {
// Get the parent post by the given path.
$path = str_replace( $match[0], '', $path );
$post = get_page_by_path( trim( $path, '/' ) );
// If a parent post is found, set the $post_id and break out of the loop.
if ( ! empty( $post ) && 0 < $post->ID ) {
$this->add_post_parents( $post->ID );
break;
}
}
}
}
}
}
/**
* Searches for term parents of hierarchical taxonomies. This function is similar to the WordPress
* function get_category_parents() but handles any type of taxonomy.
*
* @since 1.0.0
* @param int $term_id ID of the term to get the parents of.
* @param string $taxonomy Name of the taxonomy for the given term.
* @return void
*/
function add_term_parents( $term_id, $taxonomy ) {
// Set up some default arrays.
$parents = array();
// While there is a parent ID, add the parent term link to the $parents array.
while ( $term_id ) {
// Get the parent term.
$term = get_term( $term_id, $taxonomy );
// Add the formatted term link to the array of parent terms.
$parents[] = sprintf( '%s', esc_url( get_term_link( $term, $taxonomy ) ), $term->name );
// Set the parent term's parent as the parent ID.
$term_id = $term->parent;
}
// If we have parent terms, reverse the array to put them in the proper order for the trail.
if ( ! empty( $parents ) ) {
$this->items = array_merge( $this->items, array_reverse( $parents ) );
}
}
/**
* Turns %tag% from permalink structures into usable links for the breadcrumb trail. This feels kind of
* hackish for now because we're checking for specific %tag% examples and only doing it for the 'post'
* post type. In the future, maybe it'll handle a wider variety of possibilities, especially for custom post
* types.
*
* @since 0.6.0
* @param int $post_id ID of the post whose parents we want.
* @param string $path Path of a potential parent page.
* @param array $args Mixed arguments for the menu.
* @return array
*/
protected function map_rewrite_tags( $post_id, $path ) {
$post = get_post( $post_id );
// Trim '/' from both sides of the $path.
$path = trim( $path, '/' );
// Split the $path into an array of strings.
$matches = explode( '/', $path );
// If matches are found for the path.
if ( is_array( $matches ) ) {
// Loop through each of the matches, adding each to the $trail array.
foreach ( $matches as $match ) {
// Trim any '/' from the $match.
$tag = trim( $match, '/' );
// If using the %year% tag, add a link to the yearly archive.
if ( '%year%' == $tag ) {
$this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y', $post_id ) ) ), sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) ) );
}
// If using the %monthnum% tag, add a link to the monthly archive.
elseif ( '%monthnum%' == $tag ) {
$this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ) ) ), sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'astra' ) ) ) );
}
// If using the %day% tag, add a link to the daily archive.
elseif ( '%day%' == $tag ) {
$this->items[] = sprintf( '%s', esc_url( get_day_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ), get_the_time( 'd', $post_id ) ) ), sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'astra' ) ) ) );
}
// If using the %author% tag, add a link to the post author archive.
elseif ( '%author%' == $tag ) {
$this->items[] = sprintf( '%s', esc_url( get_author_posts_url( $post->post_author ) ), get_the_author_meta( 'display_name', $post->post_author ) );
}
// If using the %category% tag, add a link to the first category archive to match permalinks.
elseif ( taxonomy_exists( trim( $tag, '%' ) ) ) {
// Force override terms in this post type.
$this->post_taxonomy[ $post->post_type ] = false;
// Add the post categories.
$this->add_post_terms( $post_id, trim( $tag, '%' ) );
}
}
}
}
}
PK #Zdɯ 9 transparent-header/class-astra-ext-transparent-header.phpnu [ ASTRA_THEME_SETTINGS . '[transparent-header-enable]',
'default' => astra_get_option( 'transparent-header-enable' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on Complete Website', 'astra' ),
'priority' => 20,
'control' => 'ast-toggle-control',
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
/**
* Option: Disable Transparent Header on 404 Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-404-page]',
'default' => astra_get_option( 'transparent-header-disable-404-page', $transparent_header_disable_archive ),
'type' => 'control',
'section' => $_section,
'context' => array(
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]',
'operator' => '==',
'value' => '1',
),
),
'title' => __( 'Disable on 404 Page?', 'astra' ),
'description' => __( 'This setting is generally not recommended on 404 page. If you would like to enable it, uncheck this option', 'astra' ),
'priority' => 25,
'control' => 'ast-toggle-control',
),
/**
* Option: Disable Transparent Header on Search Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-search-page]',
'default' => astra_get_option( 'transparent-header-disable-search-page', $transparent_header_disable_archive ),
'type' => 'control',
'section' => $_section,
'context' => array(
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]',
'operator' => '==',
'value' => '1',
),
),
'title' => __( 'Disable on Search Page?', 'astra' ),
'description' => __( 'This setting is generally not recommended on search page. If you would like to enable it, uncheck this option', 'astra' ),
'priority' => 25,
'control' => 'ast-toggle-control',
),
/**
* Option: Disable Transparent Header on Archive Pages
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-archive-pages]',
'default' => astra_get_option( 'transparent-header-disable-archive-pages', $transparent_header_disable_archive ),
'type' => 'control',
'section' => $_section,
'context' => array(
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]',
'operator' => '==',
'value' => '1',
),
),
'title' => __( 'Disable on Archive Pages?', 'astra' ),
'description' => __( 'This setting is generally not recommended on archives pages, etc. If you would like to enable it, uncheck this option', 'astra' ),
'priority' => 25,
'control' => 'ast-toggle-control',
),
/**
* Option: Disable Transparent Header on Archive Pages
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-index]',
'default' => astra_get_option( 'transparent-header-disable-index' ),
'type' => 'control',
'section' => $_section,
'context' => array(
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]',
'operator' => '==',
'value' => '1',
),
),
'title' => __( 'Disable on Blog page?', 'astra' ),
'description' => __( 'Blog Page is when Latest Posts are selected to be displayed on a particular page.', 'astra' ),
'priority' => 25,
'control' => 'ast-toggle-control',
),
/**
* Option: Disable Transparent Header on Your latest posts index Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-latest-posts-index]',
'default' => astra_get_option( 'transparent-header-disable-latest-posts-index' ),
'type' => 'control',
'section' => $_section,
'context' => array(
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]',
'operator' => '==',
'value' => '1',
),
),
'title' => __( 'Disable on Latest Posts Page?', 'astra' ),
'description' => __( "Latest Posts page is your site's front page when the latest posts are displayed on the home page.", 'astra' ),
'priority' => 25,
'control' => 'ast-toggle-control',
),
/**
* Option: Disable Transparent Header on Pages
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-page]',
'default' => astra_get_option( 'transparent-header-disable-page' ),
'type' => 'control',
'section' => $_section,
'context' => array(
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]',
'operator' => '==',
'value' => '1',
),
),
'title' => __( 'Disable on Pages?', 'astra' ),
'priority' => 25,
'control' => 'ast-toggle-control',
),
/**
* Option: Disable Transparent Header on Posts
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-posts]',
'default' => astra_get_option( 'transparent-header-disable-posts' ),
'type' => 'control',
'section' => $_section,
'context' => array(
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]',
'operator' => '==',
'value' => '1',
),
),
'title' => __( 'Disable on Posts?', 'astra' ),
'priority' => 25,
'control' => 'ast-toggle-control',
),
/**
* Option: Sticky Header Display On
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-on-devices]',
'default' => astra_get_option( 'transparent-header-on-devices' ),
'type' => 'control',
'section' => $_section,
'priority' => 27,
'title' => __( 'Enable On', 'astra' ),
'control' => 'ast-selector',
'choices' => array(
'desktop' => __( 'Desktop', 'astra' ),
'mobile' => __( 'Mobile', 'astra' ),
'both' => __( 'Desktop + Mobile', 'astra' ),
),
'responsive' => false,
'renderAs' => 'text',
'divider' => array( 'ast_class' => 'ast-top-dotted-divider ast-bottom-section-divider' ),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]',
'default' => $diff_trans_logo,
'type' => 'control',
'section' => $_section,
'title' => __( 'Different Transparent Logo', 'astra' ),
'priority' => 30,
'control' => 'ast-toggle-control',
),
/**
* Option: Transparent header logo selector
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-logo]',
'default' => astra_get_option( 'transparent-header-logo' ),
'type' => 'control',
'control' => 'image',
'sanitize_callback' => 'esc_url_raw',
'section' => $_section,
'context' => array(
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]',
'operator' => '==',
'value' => true,
),
),
'priority' => 30.1,
'title' => __( 'Logo', 'astra' ),
'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ),
'partial' => array(
'selector' => '.ast-replace-site-logo-transparent .site-branding .site-logo-img',
'container_inclusive' => false,
),
),
/**
* Option: Different retina logo
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[different-transparent-retina-logo]',
'default' => astra_get_option( 'different-transparent-retina-logo' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Different Logo For Retina Devices?', 'astra' ),
'context' => array(
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]',
'operator' => '==',
'value' => true,
),
),
'priority' => 30.2,
'control' => 'ast-toggle-control',
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
),
/**
* Option: Transparent header logo selector
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-retina-logo]',
'default' => astra_get_option( 'transparent-header-retina-logo' ),
'type' => 'control',
'control' => 'image',
'sanitize_callback' => 'esc_url_raw',
'section' => $_section,
'context' => array(
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-retina-logo]',
'operator' => '==',
'value' => true,
),
array(
'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]',
'operator' => '==',
'value' => true,
),
),
'priority' => 30.3,
'title' => __( 'Retina Logo', 'astra' ),
'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ),
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
),
/**
* Option: Transparent header logo width
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-logo-width]',
'default' => astra_get_option( 'transparent-header-logo-width' ),
'type' => 'control',
'transport' => 'postMessage',
'control' => 'ast-responsive-slider',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
'section' => $_section,
'context' => array(
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]',
'operator' => '==',
'value' => true,
),
),
'suffix' => 'px',
'priority' => 30.4,
'title' => __( 'Logo Width', 'astra' ),
'input_attrs' => array(
'min' => 50,
'step' => 1,
'max' => 600,
),
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
),
/**
* Option: Bottom Border Size
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-main-sep]',
'default' => astra_get_option( 'transparent-header-main-sep' ),
'type' => 'control',
'transport' => 'refresh',
'control' => 'ast-slider',
'section' => $_section,
'priority' => 32,
'title' => __( 'Bottom Border Size', 'astra' ),
'suffix' => 'px',
'input_attrs' => array(
'min' => 0,
'step' => 1,
'max' => 600,
),
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
/**
* Option: Bottom Border Color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-main-sep-color]',
'default' => astra_get_option( 'transparent-header-main-sep-color' ),
'type' => 'control',
'transport' => 'refresh',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'section' => $_section,
'priority' => 32,
'title' => __( 'Bottom Border Color', 'astra' ),
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-main-sep]',
'operator' => '>=',
'value' => 1,
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Transparent Header Styling
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[divider-sec-transparent-styling]',
'type' => 'control',
'control' => 'ast-heading',
'section' => $_section,
'title' => __( 'Colors & Background', 'astra' ),
'priority' => 32,
'settings' => array(),
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors]',
'default' => astra_get_option( 'transparent-header-colors' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Site Title', 'astra' ),
'section' => $_section,
'transport' => 'postMessage',
'priority' => 34,
'context' => ( Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
'responsive' => true,
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-menu]',
'default' => astra_get_option( 'transparent-header-colors-menu' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Text / Link', 'astra' ),
'section' => $_section,
'transport' => 'postMessage',
'priority' => 35,
'context' => ( Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
'responsive' => true,
'divider' => array(
'ast_class' => 'ast-top-dotted-divider',
'ast_title' => __( 'Menu Color', 'astra' ),
),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-submenu]',
'default' => astra_get_option( 'transparent-header-colors-submenu' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Text / Link', 'astra' ),
'section' => $_section,
'transport' => 'postMessage',
'priority' => 37,
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
'responsive' => true,
'divider' => array(
'ast_class' => 'ast-top-dotted-divider',
'ast_title' => __( 'Submenu Color', 'astra' ),
),
),
);
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$_hfb_configs = array(
/**
* Option: Header Builder Tabs
*/
array(
'name' => $_section . '-ast-context-tabs',
'section' => $_section,
'type' => 'control',
'control' => 'ast-builder-header-control',
'priority' => 0,
'description' => '',
),
/**
* Option: Transparent Header Builder - Social Element configs.
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-social-text-colors-content]',
'default' => astra_get_option( 'transparent-header-social-colors-content' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Text / Icon', 'astra' ),
'section' => $_section,
'transport' => 'postMessage',
'priority' => 40,
'context' => Astra_Builder_Helper::$design_tab,
'responsive' => true,
'divider' => array(
'ast_class' => 'ast-top-dotted-divider',
'ast_title' => __( 'Social Color', 'astra' ),
),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-social-background-colors-content]',
'default' => astra_get_option( 'transparent-header-social-colors-content' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Background', 'astra' ),
'section' => $_section,
'transport' => 'postMessage',
'priority' => 40,
'context' => Astra_Builder_Helper::$design_tab,
'responsive' => true,
),
/**
* Option: Social Text Color
*/
array(
'name' => 'transparent-header-social-icons-color',
'transport' => 'postMessage',
'default' => astra_get_option( 'transparent-header-social-icons-color' ),
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-text-colors-content]',
'section' => 'section-transparent-header',
'tab' => __( 'Normal', 'astra' ),
'control' => 'ast-responsive-color',
'responsive' => true,
'rgba' => true,
'priority' => 5,
'context' => Astra_Builder_Helper::$design_tab,
'title' => __( 'Normal', 'astra' ),
),
/**
* Option: Social Text Hover Color
*/
array(
'name' => 'transparent-header-social-icons-h-color',
'default' => astra_get_option( 'transparent-header-social-icons-h-color' ),
'transport' => 'postMessage',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-text-colors-content]',
'section' => 'section-transparent-header',
'tab' => __( 'Hover', 'astra' ),
'control' => 'ast-responsive-color',
'responsive' => true,
'rgba' => true,
'priority' => 7,
'context' => Astra_Builder_Helper::$design_tab,
'title' => __( 'Hover', 'astra' ),
),
/**
* Option: Social Background Color
*/
array(
'name' => 'transparent-header-social-icons-bg-color',
'default' => astra_get_option( 'transparent-header-social-icons-bg-color' ),
'transport' => 'postMessage',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-background-colors-content]',
'section' => 'section-transparent-header',
'tab' => __( 'Normal', 'astra' ),
'control' => 'ast-responsive-color',
'responsive' => true,
'rgba' => true,
'priority' => 9,
'context' => Astra_Builder_Helper::$design_tab,
'title' => __( 'Normal', 'astra' ),
),
/**
* Option: Social Background Hover Color
*/
array(
'name' => 'transparent-header-social-icons-bg-h-color',
'default' => astra_get_option( 'transparent-header-social-icons-bg-h-color' ),
'transport' => 'postMessage',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-social-background-colors-content]',
'section' => 'section-transparent-header',
'tab' => __( 'Hover', 'astra' ),
'control' => 'ast-responsive-color',
'responsive' => true,
'rgba' => true,
'priority' => 11,
'context' => Astra_Builder_Helper::$design_tab,
'title' => __( 'Hover', 'astra' ),
),
/**
* Option: Transparent Header Builder - HTML Elements configs.
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-html-colors-group]',
'default' => astra_get_option( 'transparent-header-html-colors-group' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Link', 'astra' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 75,
'context' => Astra_Builder_Helper::$design_tab,
),
// Option: HTML Text Color.
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-html-text-color]',
'default' => astra_get_option( 'transparent-header-html-text-color' ),
'type' => 'control',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 74,
'title' => __( 'Text', 'astra' ),
'context' => Astra_Builder_Helper::$design_tab,
'divider' => array(
'ast_class' => 'ast-top-divider ast-top-dotted-divider',
'ast_title' => __( 'HTML Color', 'astra' ),
),
),
// Option: HTML Link Color.
array(
'name' => 'transparent-header-html-link-color',
'default' => astra_get_option( 'transparent-header-html-link-color' ),
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-html-colors-group]',
'type' => 'sub-control',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 5,
'title' => __( 'Normal', 'astra' ),
'context' => Astra_Builder_Helper::$general_tab,
),
// Option: HTML Link Hover Color.
array(
'name' => 'transparent-header-html-link-h-color',
'default' => astra_get_option( 'transparent-header-html-link-h-color' ),
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-html-colors-group]',
'type' => 'sub-control',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 5,
'title' => __( 'Hover', 'astra' ),
'context' => Astra_Builder_Helper::$general_tab,
),
/**
* Option: Transparent Header Builder - Search Elements configs.
*/
// Option: Search Color.
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-search-icon-color]',
'default' => astra_get_option( 'transparent-header-search-icon-color' ),
'type' => 'control',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 45,
'title' => __( 'Icon', 'astra' ),
'context' => Astra_Builder_Helper::$design_tab,
'divider' => array(
'ast_class' => 'ast-top-divider ast-top-dotted-divider',
'ast_title' => __( 'Search Color', 'astra' ),
),
),
/**
* Search Box Background Color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-search-box-background-color]',
'default' => astra_get_option( 'transparent-header-search-box-background-color' ),
'type' => 'control',
'section' => 'section-transparent-header',
'priority' => 45,
'transport' => 'postMessage',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'title' => __( 'Box Background', 'astra' ),
'context' => array(
Astra_Builder_Helper::$design_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[header-search-box-type]',
'operator' => 'in',
'value' => array( 'slide-search', 'search-box' ),
),
),
),
/**
* Group: Transparent Header Button Colors Group
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-text-group]',
'default' => astra_get_option( 'transparent-header-buttons-group' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Text', 'astra' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 60,
'context' => Astra_Builder_Helper::$design_tab,
'divider' => array(
'ast_class' => 'ast-top-dotted-divider',
'ast_title' => __( 'Button Color', 'astra' ),
),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-background-group]',
'default' => astra_get_option( 'transparent-header-buttons-group' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Background', 'astra' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 60,
'context' => Astra_Builder_Helper::$design_tab,
),
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-border-group]',
'default' => astra_get_option( 'transparent-header-buttons-border-group' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Border Color', 'astra' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 60,
'context' => Astra_Builder_Helper::$design_tab,
),
/**
* Option: Button Text Color
*/
array(
'name' => 'transparent-header-button-text-color',
'transport' => 'postMessage',
'default' => astra_get_option( 'transparent-header-button-text-color' ),
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-text-group]',
'section' => 'section-transparent-header',
'tab' => __( 'Normal', 'astra' ),
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'priority' => 5,
'title' => __( 'Normal', 'astra' ),
),
/**
* Option: Button Text Hover Color
*/
array(
'name' => 'transparent-header-button-text-h-color',
'default' => astra_get_option( 'transparent-header-button-text-h-color' ),
'transport' => 'postMessage',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-text-group]',
'section' => 'section-transparent-header',
'tab' => __( 'Hover', 'astra' ),
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'priority' => 7,
'title' => __( 'Hover', 'astra' ),
),
/**
* Option: Button Background Color
*/
array(
'name' => 'transparent-header-button-bg-color',
'default' => astra_get_option( 'transparent-header-button-bg-color' ),
'transport' => 'postMessage',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-background-group]',
'section' => 'section-transparent-header',
'tab' => __( 'Normal', 'astra' ),
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'priority' => 9,
'title' => __( 'Normal', 'astra' ),
),
/**
* Option: Button Button Hover Color
*/
array(
'name' => 'transparent-header-button-bg-h-color',
'default' => astra_get_option( 'transparent-header-button-bg-h-color' ),
'transport' => 'postMessage',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-background-group]',
'section' => 'section-transparent-header',
'tab' => __( 'Hover', 'astra' ),
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'priority' => 11,
'title' => __( 'Hover', 'astra' ),
),
/**
* Option: Button Border Color
*/
array(
'name' => 'transparent-header-button-border-color',
'transport' => 'postMessage',
'default' => astra_get_option( 'transparent-header-button-border-color' ),
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-border-group]',
'section' => 'section-transparent-header',
'tab' => __( 'Normal', 'astra' ),
'control' => 'ast-color',
'priority' => 5,
'title' => __( 'Normal', 'astra' ),
),
/**
* Option: Button Border Hover Color
*/
array(
'name' => 'transparent-header-button-border-h-color',
'default' => astra_get_option( 'transparent-header-button-border-h-color' ),
'transport' => 'postMessage',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-buttons-border-group]',
'section' => 'section-transparent-header',
'tab' => __( 'Hover', 'astra' ),
'control' => 'ast-color',
'priority' => 7,
'title' => __( 'Hover', 'astra' ),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-account-icon-color]',
'default' => astra_get_option( 'transparent-account-icon-color' ),
'type' => 'control',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 65,
'title' => __( 'Icon', 'astra' ),
'divider' => array(
'ast_class' => 'ast-top-divider ast-top-dotted-divider',
'ast_title' => __( 'Account', 'astra' ),
),
'context' => array(
Astra_Builder_Helper::$design_tab_config,
array(
'relation' => 'OR',
array(
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
'operator' => '==',
'value' => 'icon',
),
array(
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
'operator' => '==',
'value' => 'text',
),
array(
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
'operator' => '!=',
'value' => 'none',
),
),
),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-account-type-text-color]',
'default' => astra_get_option( 'transparent-account-type-text-color' ),
'type' => 'control',
'section' => $_section,
'priority' => 65,
'transport' => 'postMessage',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'title' => __( 'Text', 'astra' ),
'context' => array(
Astra_Builder_Helper::$design_tab_config,
array(
'relation' => 'OR',
array(
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
'operator' => '==',
'value' => 'icon',
),
array(
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
'operator' => '==',
'value' => 'text',
),
array(
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
'operator' => '!=',
'value' => 'none',
),
),
),
),
/**
* Option: Toggle Button Color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-toggle-btn-color]',
'default' => astra_get_option( 'transparent-header-toggle-btn-color' ),
'type' => 'control',
'control' => 'ast-color',
'title' => __( 'Icon', 'astra' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 70,
'context' => Astra_Builder_Helper::$design_tab,
'divider' => array(
'ast_class' => 'ast-top-divider ast-top-dotted-divider',
'ast_title' => __( 'Toggle Color', 'astra' ),
),
),
/**
* Option: Toggle Button Bg Color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-toggle-btn-bg-color]',
'default' => astra_get_option( 'transparent-header-toggle-btn-bg-color' ),
'type' => 'control',
'control' => 'ast-color',
'title' => __( 'Background', 'astra' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 70,
'context' => Astra_Builder_Helper::$design_tab,
),
/**
* Option: Toggle Button Border Color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-toggle-border-color]',
'default' => astra_get_option( 'transparent-header-toggle-border-color' ),
'type' => 'control',
'control' => 'ast-color',
'title' => __( 'Border', 'astra' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 70,
'context' => Astra_Builder_Helper::$design_tab,
),
);
$widget_configs = array(
/**
* Option: Transparent Header Builder - Widget Elements configs.
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-link-colors-group]',
'default' => astra_get_option( 'transparent-header-widget-colors-group' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Link', 'astra' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 50,
'context' => Astra_Builder_Helper::$design_tab,
),
// Option: Widget Title Color.
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-title-color]',
'default' => astra_get_option( 'transparent-header-widget-title-color' ),
'type' => 'control',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 49,
'title' => __( 'Title', 'astra' ),
'context' => Astra_Builder_Helper::$design_tab,
'divider' => array(
'ast_class' => 'ast-top-divider',
'ast_title' => __( 'Widget Color', 'astra' ),
),
),
// Option: Widget Content Color.
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-content-color]',
'default' => astra_get_option( 'transparent-header-widget-content-color' ),
'type' => 'control',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 49,
'title' => __( 'Content', 'astra' ),
'context' => Astra_Builder_Helper::$design_tab,
),
// Option: Widget Link Color.
array(
'name' => 'transparent-header-widget-link-color',
'default' => astra_get_option( 'transparent-header-widget-link-color' ),
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-link-colors-group]',
'type' => 'sub-control',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 15,
'tab' => __( 'Normal', 'astra' ),
'title' => __( 'Normal', 'astra' ),
'context' => Astra_Builder_Helper::$general_tab,
),
// Option: Widget Link Hover Color.
array(
'name' => 'transparent-header-widget-link-h-color',
'default' => astra_get_option( 'transparent-header-widget-link-h-color' ),
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-widget-link-colors-group]',
'type' => 'sub-control',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'tab' => __( 'Hover', 'astra' ),
'priority' => 20,
'title' => __( 'Hover', 'astra' ),
'context' => Astra_Builder_Helper::$general_tab,
),
);
$_configs = array_merge( $_configs, $_hfb_configs );
} else {
$_old_content_configs = array(
/**
* Option: Content Section Text color.
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-content-section-text-color-responsive]',
'default' => astra_get_option( 'transparent-content-section-text-color-responsive' ),
'type' => 'control',
'priority' => 39,
'section' => $_section,
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'title' => __( 'Text', 'astra' ),
'responsive' => true,
'rgba' => true,
'divider' => array(
'ast_class' => 'ast-top-divider',
'ast_title' => __( 'Content', 'astra' ),
),
),
/**
* Option: Header Builder Tabs
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-content]',
'default' => astra_get_option( 'transparent-header-colors-content' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Link', 'astra' ),
'section' => $_section,
'transport' => 'postMessage',
'priority' => 39,
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
'responsive' => true,
),
);
$_configs = array_merge( $_configs, $_old_content_configs );
}
if ( defined( 'ASTRA_EXT_VER' ) && ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ) {
$pro_elements_transparent_config = array(
/**
* Search Box Background Color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-search-box-placeholder-color]',
'default' => astra_get_option( 'transparent-header-search-box-placeholder-color' ),
'type' => 'control',
'section' => 'section-transparent-header',
'priority' => 45,
'transport' => 'postMessage',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'title' => __( 'Text / Placeholder', 'astra' ),
'context' => array(
Astra_Builder_Helper::$design_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[header-search-box-type]',
'operator' => 'in',
'value' => array( 'slide-search', 'search-box' ),
),
),
),
/**
* Option: Transparent Header Builder - Divider Elements configs.
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-divider-color]',
'default' => astra_get_option( 'transparent-header-divider-color' ),
'type' => 'control',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'transport' => 'postMessage',
'priority' => 64,
'title' => __( 'Divider', 'astra' ),
'section' => 'section-transparent-header',
'context' => Astra_Builder_Helper::$design_tab,
'divider' => array( 'ast_class' => 'ast-top-divider ast-top-dotted-divider' ),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]',
'default' => astra_get_option( 'transparent-account-menu-colors' ),
'type' => 'control',
'control' => 'ast-settings-group',
'title' => __( 'Account Menu Color', 'astra' ),
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'priority' => 66,
'context' => array(
Astra_Builder_Helper::$design_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[header-account-action-type]',
'operator' => '==',
'value' => 'menu',
),
),
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
),
// Option: Menu Color.
array(
'name' => 'transparent-account-menu-color',
'default' => astra_get_option( 'transparent-account-menu-color' ),
'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]',
'type' => 'sub-control',
'control' => 'ast-color',
'transport' => 'postMessage',
'tab' => __( 'Normal', 'astra' ),
'section' => 'section-transparent-header',
'title' => __( 'Link / Text Color', 'astra' ),
'priority' => 7,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[header-account-action-type]',
'operator' => '==',
'value' => 'menu',
),
Astra_Builder_Helper::$design_tab,
),
),
// Option: Background Color.
array(
'name' => 'transparent-account-menu-bg-obj',
'default' => astra_get_option( 'transparent-account-menu-bg-obj' ),
'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]',
'type' => 'sub-control',
'control' => 'ast-color',
'transport' => 'postMessage',
'section' => 'section-transparent-header',
'title' => __( 'Background Color', 'astra' ),
'tab' => __( 'Normal', 'astra' ),
'priority' => 8,
'context' => Astra_Builder_Helper::$design_tab,
),
// Option: Menu Hover Color.
array(
'name' => 'transparent-account-menu-h-color',
'default' => astra_get_option( 'transparent-account-menu-h-color' ),
'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]',
'tab' => __( 'Hover', 'astra' ),
'type' => 'sub-control',
'control' => 'ast-color',
'transport' => 'postMessage',
'title' => __( 'Link Color', 'astra' ),
'section' => 'section-transparent-header',
'priority' => 19,
'context' => Astra_Builder_Helper::$design_tab,
),
// Option: Menu Hover Background Color.
array(
'name' => 'transparent-account-menu-h-bg-color',
'default' => astra_get_option( 'transparent-account-menu-h-bg-color' ),
'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]',
'type' => 'sub-control',
'title' => __( 'Background Color', 'astra' ),
'section' => 'section-transparent-header',
'control' => 'ast-color',
'transport' => 'postMessage',
'tab' => __( 'Hover', 'astra' ),
'priority' => 21,
'context' => Astra_Builder_Helper::$design_tab,
),
// Option: Active Menu Color.
array(
'name' => 'transparent-account-menu-a-color',
'default' => astra_get_option( 'transparent-account-menu-a-color' ),
'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]',
'type' => 'sub-control',
'section' => 'section-transparent-header',
'control' => 'ast-color',
'transport' => 'postMessage',
'tab' => __( 'Active', 'astra' ),
'title' => __( 'Link Color', 'astra' ),
'priority' => 31,
'context' => Astra_Builder_Helper::$design_tab,
),
// Option: Active Menu Background Color.
array(
'name' => 'transparent-account-menu-a-bg-color',
'default' => astra_get_option( 'transparent-account-menu-a-bg-color' ),
'parent' => ASTRA_THEME_SETTINGS . '[transparent-account-menu-colors]',
'type' => 'sub-control',
'control' => 'ast-color',
'transport' => 'postMessage',
'section' => 'section-transparent-header',
'title' => __( 'Background Color', 'astra' ),
'tab' => __( 'Active', 'astra' ),
'priority' => 33,
'context' => Astra_Builder_Helper::$design_tab,
),
);
$_configs = array_merge( $_configs, $pro_elements_transparent_config );
}
return array_merge( $configurations, $_configs );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
new Astra_Customizer_Transparent_Header_Configs();
PK $Z