PK \bmD$ D$ class-astra-enqueue-scripts.phpnu W+A
tag in admin page
*
* @param String $classes body classes returned from the filter.
* @return String body classes to be added to
tag in admin page
*/
public function admin_body_class( $classes ) {
$content_layout = astra_get_content_layout();
if ( 'content-boxed-container' == $content_layout ) {
$classes .= ' ast-separate-container';
} elseif ( 'boxed-container' == $content_layout ) {
$classes .= ' ast-separate-container ast-two-container';
} elseif ( 'page-builder' == $content_layout ) {
$classes .= ' ast-page-builder-template';
} elseif ( 'plain-container' == $content_layout ) {
$classes .= ' ast-plain-container';
}
$classes .= ' ast-' . astra_page_layout();
return $classes;
}
/**
* List of all assets.
*
* @return array assets array.
*/
public static function theme_assets() {
$default_assets = array(
// handle => location ( in /assets/js/ ) ( without .js ext).
'js' => array(
'astra-theme-js' => 'style',
),
// handle => location ( in /assets/css/ ) ( without .css ext).
'css' => array(
'astra-theme-css' => 'style',
),
);
return apply_filters( 'astra_theme_assets', $default_assets );
}
/**
* Add Fonts
*/
public function add_fonts() {
$font_family = astra_get_option( 'body-font-family' );
$font_weight = astra_get_option( 'body-font-weight' );
$font_variant = astra_get_option( 'body-font-variant' );
Astra_Fonts::add_font( $font_family, $font_weight );
Astra_Fonts::add_font( $font_family, $font_variant );
// Render headings font.
$heading_font_family = astra_get_option( 'headings-font-family' );
$heading_font_weight = astra_get_option( 'headings-font-weight' );
$heading_font_variant = astra_get_option( 'headings-font-variant' );
Astra_Fonts::add_font( $heading_font_family, $heading_font_weight );
Astra_Fonts::add_font( $heading_font_family, $heading_font_variant );
}
/**
* Enqueue Scripts
*/
public function enqueue_scripts() {
if ( false === self::enqueue_theme_assets() ) {
return;
}
/* Directory and Extension */
$file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
$dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
$js_uri = ASTRA_THEME_URI . 'assets/js/' . $dir_name . '/';
$css_uri = ASTRA_THEME_URI . 'assets/css/' . $dir_name . '/';
/**
* IE Only Js and CSS Files.
*/
// Flexibility.js for flexbox IE10 support.
wp_enqueue_script( 'astra-flexibility', $js_uri . 'flexibility' . $file_prefix . '.js', array(), ASTRA_THEME_VERSION, false );
wp_add_inline_script( 'astra-flexibility', 'flexibility(document.documentElement);' );
wp_script_add_data( 'astra-flexibility', 'conditional', 'IE' );
// Polyfill for CustomEvent for IE.
wp_register_script( 'astra-customevent', $js_uri . 'custom-events-polyfill' . $file_prefix . '.js', array(), ASTRA_THEME_VERSION, false );
// All assets.
$all_assets = self::theme_assets();
$styles = $all_assets['css'];
$scripts = $all_assets['js'];
if ( is_array( $styles ) && ! empty( $styles ) ) {
// Register & Enqueue Styles.
foreach ( $styles as $key => $style ) {
$dependency = array();
// Add dynamic CSS dependency for all styles except for theme's style.css.
if ( 'astra-theme-css' !== $key && class_exists( 'Astra_Cache_Base' ) ) {
if ( ! Astra_Cache_Base::inline_assets() ) {
$dependency[] = 'astra-theme-dynamic';
}
}
// Generate CSS URL.
$css_file = $css_uri . $style . $file_prefix . '.css';
// Register.
wp_register_style( $key, $css_file, $dependency, ASTRA_THEME_VERSION, 'all' );
// Enqueue.
wp_enqueue_style( $key );
// RTL support.
wp_style_add_data( $key, 'rtl', 'replace' );
}
}
// Fonts - Render Fonts.
Astra_Fonts::render_fonts();
/**
* Inline styles
*/
add_filter( 'astra_dynamic_theme_css', array( 'Astra_Dynamic_CSS', 'return_output' ) );
add_filter( 'astra_dynamic_theme_css', array( 'Astra_Dynamic_CSS', 'return_meta_output' ) );
// Submenu Container Animation.
$menu_animation = astra_get_option( 'header-main-submenu-container-animation' );
$rtl = ( is_rtl() ) ? '-rtl' : '';
if ( ! empty( $menu_animation ) ) {
if ( class_exists( 'Astra_Cache' ) ) {
Astra_Cache::add_css_file( ASTRA_THEME_DIR . 'assets/css/' . $dir_name . '/menu-animation' . $rtl . $file_prefix . '.css' );
} else {
wp_register_style( 'astra-menu-animation', $css_uri . 'menu-animation' . $file_prefix . '.css', null, ASTRA_THEME_VERSION, 'all' );
wp_enqueue_style( 'astra-menu-animation' );
}
}
if ( ! class_exists( 'Astra_Cache' ) ) {
$theme_css_data = apply_filters( 'astra_dynamic_theme_css', '' );
wp_add_inline_style( 'astra-theme-css', $theme_css_data );
}
if ( astra_is_amp_endpoint() ) {
return;
}
// Comment assets.
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
if ( is_array( $scripts ) && ! empty( $scripts ) ) {
// Register & Enqueue Scripts.
foreach ( $scripts as $key => $script ) {
// Register.
wp_register_script( $key, $js_uri . $script . $file_prefix . '.js', array(), ASTRA_THEME_VERSION, true );
// Enqueue.
wp_enqueue_script( $key );
}
}
$astra_localize = array(
'break_point' => astra_header_break_point(), // Header Break Point.
'isRtl' => is_rtl(),
);
wp_localize_script( 'astra-theme-js', 'astra', apply_filters( 'astra_theme_js_localize', $astra_localize ) );
}
/**
* Trim CSS
*
* @since 1.0.0
* @param string $css CSS content to trim.
* @return string
*/
public static function trim_css( $css = '' ) {
// Trim white space for faster page loading.
if ( ! empty( $css ) ) {
$css = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css );
$css = str_replace( array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' ' ), '', $css );
$css = str_replace( ', ', ',', $css );
}
return $css;
}
/**
* Enqueue Gutenberg assets.
*
* @since 1.5.2
*
* @return void
*/
public function gutenberg_assets() {
/* Directory and Extension */
$rtl = '';
if ( is_rtl() ) {
$rtl = '-rtl';
}
$css_uri = ASTRA_THEME_URI . 'inc/assets/css/block-editor-styles' . $rtl . '.css';
wp_enqueue_style( 'astra-block-editor-styles', $css_uri, false, ASTRA_THEME_VERSION, 'all' );
// Render fonts in Gutenberg layout.
Astra_Fonts::render_fonts();
wp_add_inline_style( 'astra-block-editor-styles', apply_filters( 'astra_block_editor_dynamic_css', Gutenberg_Editor_CSS::get_css() ) );
}
/**
* Function to check if enqueuing of Astra assets are disabled.
*
* @since 2.1.0
* @return boolean
*/
public static function enqueue_theme_assets() {
return apply_filters( 'astra_enqueue_theme_assets', true );
}
}
new Astra_Enqueue_Scripts();
}
PK \C] 7 7 class-astra-theme-options.phpnu W+A array(
'single-image',
'single-title-meta',
),
'blog-single-width' => 'default',
'blog-single-max-width' => 1200,
'blog-single-meta' => array(
'comments',
'category',
'author',
),
// Blog.
'blog-post-structure' => array(
'image',
'title-meta',
),
'blog-width' => 'default',
'blog-max-width' => 1200,
'blog-post-content' => 'excerpt',
'blog-meta' => array(
'comments',
'category',
'author',
),
// Colors.
'text-color' => '#3a3a3a',
'link-color' => '#0274be',
'theme-color' => '#0274be',
'link-h-color' => '#3a3a3a',
// Footer Colors.
'footer-bg-obj' => array(
'background-color' => '',
'background-image' => '',
'background-repeat' => 'repeat',
'background-position' => 'center center',
'background-size' => 'auto',
'background-attachment' => 'scroll',
),
'footer-color' => '',
'footer-link-color' => '',
'footer-link-h-color' => '',
// Footer Widgets.
'footer-adv-bg-obj' => array(
'background-color' => '',
'background-image' => '',
'background-repeat' => 'repeat',
'background-position' => 'center center',
'background-size' => 'auto',
'background-attachment' => 'scroll',
),
'footer-adv-text-color' => '',
'footer-adv-link-color' => '',
'footer-adv-link-h-color' => '',
'footer-adv-wgt-title-color' => '',
// Buttons.
'button-color' => '',
'button-h-color' => '',
'button-bg-color' => '',
'button-bg-h-color' => '',
'theme-button-padding' => array(
'desktop' => array(
'top' => 10,
'right' => 40,
'bottom' => 10,
'left' => 40,
),
'tablet' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'mobile' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'button-radius' => 2,
'theme-button-border-group-border-size' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
// Footer - Small.
'footer-sml-layout' => 'footer-sml-layout-1',
'footer-sml-section-1' => 'custom',
'footer-sml-section-1-credit' => __( 'Copyright © [current_year] [site_title] | Powered by [theme_author]', 'astra' ),
'footer-sml-section-2' => '',
'footer-sml-section-2-credit' => __( 'Copyright © [current_year] [site_title] | Powered by [theme_author]', 'astra' ),
'footer-sml-dist-equal-align' => true,
'footer-sml-divider' => 1,
'footer-sml-divider-color' => '#7a7a7a',
'footer-layout-width' => 'content',
// General.
'ast-header-retina-logo' => '',
'ast-header-logo-width' => '',
'ast-header-responsive-logo-width' => array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
),
'display-site-title' => 1,
'display-site-tagline' => 0,
'logo-title-inline' => 1,
// Header - Primary.
'disable-primary-nav' => false,
'header-layouts' => 'header-main-layout-1',
'header-main-rt-section' => 'none',
'header-display-outside-menu' => false,
'header-main-rt-section-html' => '' . __( 'Contact Us', 'astra' ) . ' ',
'header-main-rt-section-button-text' => __( 'Button', 'astra' ),
'header-main-rt-section-button-link' => apply_filters( 'astra_site_url', 'https://www.wpastra.com' ),
'header-main-rt-section-button-link-option' => array(
'url' => apply_filters( 'astra_site_url', 'https://www.wpastra.com' ),
'new_tab' => false,
'link_rel' => '',
),
'header-main-rt-section-button-style' => 'theme-button',
'header-main-rt-section-button-text-color' => '',
'header-main-rt-section-button-back-color' => '',
'header-main-rt-section-button-text-h-color' => '',
'header-main-rt-section-button-back-h-color' => '',
'header-main-rt-section-button-padding' => array(
'desktop' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'tablet' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'mobile' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
),
'header-main-rt-section-button-border-size' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'header-main-sep' => 1,
'header-main-sep-color' => '',
'header-main-layout-width' => 'content',
// Header - Sub menu Border.
'primary-submenu-border' => array(
'top' => '2',
'right' => '0',
'bottom' => '0',
'left' => '0',
),
'primary-submenu-item-border' => false,
'primary-submenu-b-color' => '',
'primary-submenu-item-b-color' => '',
'header-main-menu-label' => '',
'header-main-menu-align' => 'inline',
'header-main-submenu-container-animation' => 'fade',
'mobile-header-breakpoint' => '',
'mobile-header-logo' => '',
'mobile-header-logo-width' => '',
// Site Layout.
'site-layout' => 'ast-full-width-layout',
'site-content-width' => 1200,
'site-layout-outside-bg-obj-responsive' => array(
'desktop' => array(
'background-color' => '',
'background-image' => '',
'background-repeat' => 'repeat',
'background-position' => 'center center',
'background-size' => 'auto',
'background-attachment' => 'scroll',
),
'tablet' => array(
'background-color' => '',
'background-image' => '',
'background-repeat' => 'repeat',
'background-position' => 'center center',
'background-size' => 'auto',
'background-attachment' => 'scroll',
),
'mobile' => array(
'background-color' => '',
'background-image' => '',
'background-repeat' => 'repeat',
'background-position' => 'center center',
'background-size' => 'auto',
'background-attachment' => 'scroll',
),
),
// Container.
'site-content-layout' => 'content-boxed-container',
'single-page-content-layout' => 'default',
'single-post-content-layout' => 'default',
'archive-post-content-layout' => 'default',
// Typography.
'body-font-family' => 'inherit',
'body-font-variant' => '',
'body-font-weight' => 'inherit',
'font-size-body' => array(
'desktop' => 15,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'body-line-height' => '',
'para-margin-bottom' => '',
'body-text-transform' => '',
'headings-font-family' => 'inherit',
'headings-font-weight' => 'inherit',
'headings-text-transform' => '',
'headings-line-height' => '',
'font-size-site-title' => array(
'desktop' => 35,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'font-size-site-tagline' => array(
'desktop' => 15,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'font-size-entry-title' => array(
'desktop' => 30,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'font-size-archive-summary-title' => array(
'desktop' => 40,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'font-size-page-title' => array(
'desktop' => 40,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'font-size-h1' => array(
'desktop' => 40,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'font-size-h2' => array(
'desktop' => 30,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'font-size-h3' => array(
'desktop' => 25,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'font-size-h4' => array(
'desktop' => 20,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'font-size-h5' => array(
'desktop' => 18,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
'font-size-h6' => array(
'desktop' => 15,
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
),
// Sidebar.
'site-sidebar-layout' => 'right-sidebar',
'site-sidebar-width' => 30,
'single-page-sidebar-layout' => 'default',
'single-post-sidebar-layout' => 'default',
'archive-post-sidebar-layout' => 'default',
// Sidebar.
'footer-adv' => 'disabled',
'footer-adv-border-width' => '',
'footer-adv-border-color' => '#7a7a7a',
// toogle menu style.
'mobile-header-toggle-btn-style' => 'minimal',
'hide-custom-menu-mobile' => 1,
// toogle menu target.
'mobile-header-toggle-target' => 'icon',
)
);
}
/**
* Get theme options from static array()
*
* @return array Return array of theme options.
*/
public static function get_options() {
return self::$db_options;
}
/**
* Update theme static option array.
*/
public static function refresh() {
self::$db_options = wp_parse_args(
self::get_db_options(),
self::defaults()
);
}
/**
* Get theme options from static array() from database
*
* @return array Return array of theme options from database.
*/
public static function get_db_options() {
self::$db_options_no_defaults = get_option( ASTRA_THEME_SETTINGS );
return self::$db_options_no_defaults;
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Theme_Options::get_instance();
PK \$M$
class-astra-attr.phpnu W+A astra_parse_attr( $context, $attributes, $args );
$output = '';
// Cycle through attributes, build tag attribute string.
foreach ( $attributes as $key => $value ) {
if ( ! $value ) {
continue;
}
if ( true === $value ) {
$output .= esc_html( $key ) . ' ';
} else {
$output .= sprintf( '%s="%s" ', esc_html( $key ), esc_attr( $value ) );
}
}
$output = apply_filters( "astra_attr_{$context}_output", $output, $attributes, $context, $args );
return trim( $output );
}
/**
* Merge array of attributes with defaults, and apply contextual filter on array.
*
* The contextual filter is of the form `astra_attr_{context}`.
*
* @since 1.6.2
*
* @param string $context The context, to build filter name.
* @param array $attributes Optional. Extra attributes to merge with defaults.
* @param array $args Optional. Custom data to pass to filter.
* @return array Merged and filtered attributes.
*/
public function astra_parse_attr( $context, $attributes = array(), $args = array() ) {
$defaults = array(
'class' => sanitize_html_class( $context ),
);
$attributes = wp_parse_args( $attributes, $defaults );
// Contextual filter.
return apply_filters( "astra_attr_{$context}", $attributes, $context, $args );
}
}
endif;
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Attr::get_instance();
PK \c" " theme-hooks.phpnu W+A
* // Declare support for all hook types
* add_theme_support( 'astra_hooks', array( 'all' ) );
*
* // Declare support for certain hook types only
* add_theme_support( 'astra_hooks', array( 'header', 'content', 'footer' ) );
*
*/
add_theme_support(
'astra_hooks',
array(
/**
* As a Theme developer, use the 'all' parameter, to declare support for all
* hook types.
* Please make sure you then actually reference all the hooks in this file,
* Plugin developers depend on it!
*/
'all',
/**
* Themes can also choose to only support certain hook types.
* Please make sure you then actually reference all the hooks in this type
* family.
*
* When the 'all' parameter was set, specific hook types do not need to be
* added explicitly.
*/
'html',
'body',
'head',
'header',
'content',
'entry',
'comments',
'sidebars',
'sidebar',
'footer',
/**
* If/when WordPress Core implements similar methodology, Themes and Plugins
* will be able to check whether the version of THA supplied by the theme
* supports Core hooks.
*/
)
);
/**
* Determines, whether the specific hook type is actually supported.
*
* Plugin developers should always check for the support of a specific
* hook type before hooking a callback function to a hook of this type.
*
* Example:
*
* if ( current_theme_supports( 'astra_hooks', 'header' ) )
* add_action( 'astra_head_top', 'prefix_header_top' );
*
*
* @param bool $bool true.
* @param array $args The hook type being checked.
* @param array $registered All registered hook types.
*
* @return bool
*/
function astra_current_theme_supports( $bool, $args, $registered ) {
return in_array( $args[0], $registered[0] ) || in_array( 'all', $registered[0] );
}
add_filter( 'current_theme_supports-astra_hooks', 'astra_current_theme_supports', 10, 3 );
/**
* HTML hook
* Special case, useful for , etc.
* $astra_supports[] = 'html;
*/
function astra_html_before() {
do_action( 'astra_html_before' );
}
/**
* HTML hooks
* $astra_supports[] = 'body';
*/
function astra_body_top() {
do_action( 'astra_body_top' );
}
/**
* Body Bottom
*/
function astra_body_bottom() {
do_action( 'astra_body_bottom' );
}
/**
* HTML hooks
*
* $astra_supports[] = 'head';
*/
function astra_head_top() {
do_action( 'astra_head_top' );
}
/**
* Head Bottom
*/
function astra_head_bottom() {
do_action( 'astra_head_bottom' );
}
/**
* Semantic hooks
*
* $astra_supports[] = 'header';
*/
function astra_header_before() {
do_action( 'astra_header_before' );
}
/**
* Site Header
*/
function astra_header() {
do_action( 'astra_header' );
}
/**
* Masthead Top
*/
function astra_masthead_top() {
do_action( 'astra_masthead_top' );
}
/**
* Masthead
*/
function astra_masthead() {
do_action( 'astra_masthead' );
}
/**
* Masthead Bottom
*/
function astra_masthead_bottom() {
do_action( 'astra_masthead_bottom' );
}
/**
* Header After
*/
function astra_header_after() {
do_action( 'astra_header_after' );
}
/**
* Main Header bar top
*/
function astra_main_header_bar_top() {
do_action( 'astra_main_header_bar_top' );
}
/**
* Main Header bar bottom
*/
function astra_main_header_bar_bottom() {
do_action( 'astra_main_header_bar_bottom' );
}
/**
* Main Header Content
*/
function astra_masthead_content() {
do_action( 'astra_masthead_content' );
}
/**
* Main toggle button before
*/
function astra_masthead_toggle_buttons_before() {
do_action( 'astra_masthead_toggle_buttons_before' );
}
/**
* Main toggle buttons
*/
function astra_masthead_toggle_buttons() {
do_action( 'astra_masthead_toggle_buttons' );
}
/**
* Main toggle button after
*/
function astra_masthead_toggle_buttons_after() {
do_action( 'astra_masthead_toggle_buttons_after' );
}
/**
* Semantic hooks
*
* $astra_supports[] = 'content';
*/
function astra_content_before() {
do_action( 'astra_content_before' );
}
/**
* Content after
*/
function astra_content_after() {
do_action( 'astra_content_after' );
}
/**
* Content top
*/
function astra_content_top() {
do_action( 'astra_content_top' );
}
/**
* Content bottom
*/
function astra_content_bottom() {
do_action( 'astra_content_bottom' );
}
/**
* Content while before
*/
function astra_content_while_before() {
do_action( 'astra_content_while_before' );
}
/**
* Content loop
*/
function astra_content_loop() {
do_action( 'astra_content_loop' );
}
/**
* Conten Page Loop.
*
* Called from page.php
*/
function astra_content_page_loop() {
do_action( 'astra_content_page_loop' );
}
/**
* Content while after
*/
function astra_content_while_after() {
do_action( 'astra_content_while_after' );
}
/**
* Semantic hooks
*
* $astra_supports[] = 'entry';
*/
function astra_entry_before() {
do_action( 'astra_entry_before' );
}
/**
* Entry after
*/
function astra_entry_after() {
do_action( 'astra_entry_after' );
}
/**
* Entry content before
*/
function astra_entry_content_before() {
do_action( 'astra_entry_content_before' );
}
/**
* Entry content after
*/
function astra_entry_content_after() {
do_action( 'astra_entry_content_after' );
}
/**
* Entry Top
*/
function astra_entry_top() {
do_action( 'astra_entry_top' );
}
/**
* Entry bottom
*/
function astra_entry_bottom() {
do_action( 'astra_entry_bottom' );
}
/**
* Single Post Header Before
*/
function astra_single_header_before() {
do_action( 'astra_single_header_before' );
}
/**
* Single Post Header After
*/
function astra_single_header_after() {
do_action( 'astra_single_header_after' );
}
/**
* Single Post Header Top
*/
function astra_single_header_top() {
do_action( 'astra_single_header_top' );
}
/**
* Single Post Header Bottom
*/
function astra_single_header_bottom() {
do_action( 'astra_single_header_bottom' );
}
/**
* Comments block hooks
*
* $astra_supports[] = 'comments';
*/
function astra_comments_before() {
do_action( 'astra_comments_before' );
}
/**
* Comments after.
*/
function astra_comments_after() {
do_action( 'astra_comments_after' );
}
/**
* Semantic hooks
*
* $astra_supports[] = 'sidebar';
*/
function astra_sidebars_before() {
do_action( 'astra_sidebars_before' );
}
/**
* Sidebars after
*/
function astra_sidebars_after() {
do_action( 'astra_sidebars_after' );
}
/**
* Semantic hooks
*
* $astra_supports[] = 'footer';
*/
function astra_footer() {
do_action( 'astra_footer' );
}
/**
* Footer before
*/
function astra_footer_before() {
do_action( 'astra_footer_before' );
}
/**
* Footer after
*/
function astra_footer_after() {
do_action( 'astra_footer_after' );
}
/**
* Footer top
*/
function astra_footer_content_top() {
do_action( 'astra_footer_content_top' );
}
/**
* Footer
*/
function astra_footer_content() {
do_action( 'astra_footer_content' );
}
/**
* Footer bottom
*/
function astra_footer_content_bottom() {
do_action( 'astra_footer_content_bottom' );
}
/**
* Archive header
*/
function astra_archive_header() {
do_action( 'astra_archive_header' );
}
/**
* Pagination
*/
function astra_pagination() {
do_action( 'astra_pagination' );
}
/**
* Entry content single
*/
function astra_entry_content_single() {
do_action( 'astra_entry_content_single' );
}
/**
* 404
*/
function astra_entry_content_404_page() {
do_action( 'astra_entry_content_404_page' );
}
/**
* Entry content blog
*/
function astra_entry_content_blog() {
do_action( 'astra_entry_content_blog' );
}
/**
* Blog featured post section
*/
function astra_blog_post_featured_format() {
do_action( 'astra_blog_post_featured_format' );
}
/**
* Primary Content Top
*/
function astra_primary_content_top() {
do_action( 'astra_primary_content_top' );
}
/**
* Primary Content Bottom
*/
function astra_primary_content_bottom() {
do_action( 'astra_primary_content_bottom' );
}
/**
* 404 Page content template action.
*/
function astra_404_content_template() {
do_action( 'astra_404_content_template' );
}
if ( ! function_exists( 'wp_body_open' ) ) {
/**
* Fire the wp_body_open action.
* Adds backward compatibility for WordPress versions < 5.2
*
* @since 1.8.7
*/
function wp_body_open() {
do_action( 'wp_body_open' );
}
}
PK \ڪy y view-general.phpnu W+A
PK \1 class-theme-strings.phpnu W+A __( 'Skip to content', 'astra' ),
// 404 Page Strings.
'string-404-sub-title' => __( 'It looks like the link pointing here was faulty. Maybe try searching?', 'astra' ),
// Search Page Strings.
'string-search-nothing-found' => __( 'Nothing Found', 'astra' ),
'string-search-nothing-found-message' => __( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'astra' ),
'string-full-width-search-message' => __( 'Start typing and press enter to search', 'astra' ),
'string-full-width-search-placeholder' => __( 'Search …', 'astra' ),
'string-header-cover-search-placeholder' => __( 'Search …', 'astra' ),
'string-search-input-placeholder' => __( 'Search …', 'astra' ),
// Comment Template Strings.
'string-comment-reply-link' => __( 'Reply', 'astra' ),
'string-comment-edit-link' => __( 'Edit', 'astra' ),
'string-comment-awaiting-moderation' => __( 'Your comment is awaiting moderation.', 'astra' ),
'string-comment-title-reply' => __( 'Leave a Comment', 'astra' ),
'string-comment-cancel-reply-link' => __( 'Cancel Reply', 'astra' ),
'string-comment-label-submit' => __( 'Post Comment »', 'astra' ),
'string-comment-label-message' => __( 'Type here..', 'astra' ),
'string-comment-label-name' => __( 'Name*', 'astra' ),
'string-comment-label-email' => __( 'Email*', 'astra' ),
'string-comment-label-website' => __( 'Website', 'astra' ),
'string-comment-closed' => __( 'Comments are closed.', 'astra' ),
'string-comment-navigation-title' => __( 'Comment navigation', 'astra' ),
'string-comment-navigation-next' => __( 'Newer Comments', 'astra' ),
'string-comment-navigation-previous' => __( 'Older Comments', 'astra' ),
// Blog Default Strings.
'string-blog-page-links-before' => __( 'Pages:', 'astra' ),
'string-blog-meta-author-by' => __( 'By ', 'astra' ),
'string-blog-meta-leave-a-comment' => __( 'Leave a Comment', 'astra' ),
'string-blog-meta-one-comment' => __( '1 Comment', 'astra' ),
'string-blog-meta-multiple-comment' => __( '% Comments', 'astra' ),
'string-blog-navigation-next' => __( 'Next Page', 'astra' ) . ' → ',
'string-blog-navigation-previous' => '← ' . __( 'Previous Page', 'astra' ),
// Single Post Default Strings.
'string-single-page-links-before' => __( 'Pages:', 'astra' ),
/* translators: 1: Post type label */
'string-single-navigation-next' => __( 'Next %s', 'astra' ) . ' → ',
/* translators: 1: Post type label */
'string-single-navigation-previous' => '← ' . __( 'Previous %s', 'astra' ),
// Content None.
'string-content-nothing-found-message' => __( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'astra' ),
)
);
if ( is_rtl() ) {
$defaults['string-blog-navigation-next'] = __( 'Next Page', 'astra' ) . ' ← ';
$defaults['string-blog-navigation-previous'] = '→ ' . __( 'Previous Page', 'astra' );
/* translators: 1: Post type label */
$defaults['string-single-navigation-next'] = __( 'Next %s', 'astra' ) . ' ← ';
/* translators: 1: Post type label */
$defaults['string-single-navigation-previous'] = '→ ' . __( 'Previous %s', 'astra' );
}
$output = isset( $defaults[ $key ] ) ? $defaults[ $key ] : '';
/**
* Print or return
*/
if ( $echo ) {
echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
return $output;
}
}
}
PK \}| }| class-gutenberg-editor-css.phpnu W+A array(
'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 6.25, '%' ),
),
'a' => array(
'color' => esc_attr( $link_color ),
),
// Global selection CSS.
'.block-editor-block-list__layout .block-editor-block-list__block ::selection,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .editor-block-list__block-edit:before' => array(
'background-color' => esc_attr( $theme_color ),
),
'.block-editor-block-list__layout .block-editor-block-list__block ::selection,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .editor-block-list__block-edit' => array(
'color' => esc_attr( $highlight_theme_color ),
),
'.ast-separate-container .edit-post-visual-editor, .ast-page-builder-template .edit-post-visual-editor, .ast-plain-container .edit-post-visual-editor, .ast-separate-container #wpwrap #editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $box_bg_obj, 'desktop' ),
'.editor-post-title__block,.editor-default-block-appender,.block-editor-block-list__block' => array(
'max-width' => astra_get_css_value( $site_content_width, 'px' ),
),
'.block-editor-block-list__block[data-align=wide]' => array(
'max-width' => astra_get_css_value( $site_content_width + 200, 'px' ),
),
'.editor-post-title__block .editor-post-title__input, .edit-post-visual-editor .block-editor-block-list__block h1, .edit-post-visual-editor .block-editor-block-list__block h2, .edit-post-visual-editor .block-editor-block-list__block h3, .edit-post-visual-editor .block-editor-block-list__block h4, .edit-post-visual-editor .block-editor-block-list__block h5, .edit-post-visual-editor .block-editor-block-list__block h6' => array(
'font-family' => astra_get_css_value( $headings_font_family, 'font' ),
'font-weight' => astra_get_css_value( $headings_font_weight, 'font' ),
'text-transform' => esc_attr( $headings_text_transform ),
),
'.edit-post-visual-editor h1, .edit-post-visual-editor h2, .edit-post-visual-editor h3, .edit-post-visual-editor h4, .edit-post-visual-editor h5, .edit-post-visual-editor h6' => array(
'line-height' => esc_attr( $headings_line_height ),
),
'.edit-post-visual-editor.editor-styles-wrapper p,.block-editor-block-list__block p, .block-editor-block-list__layout, .editor-post-title' => array(
'font-size' => astra_responsive_font( $body_font_size, 'desktop' ),
),
'.edit-post-visual-editor.editor-styles-wrapper p,.block-editor-block-list__block p, .wp-block-latest-posts a,.editor-default-block-appender textarea.editor-default-block-appender__content, .block-editor-block-list__block, .block-editor-block-list__block h1, .block-editor-block-list__block h2, .block-editor-block-list__block h3, .block-editor-block-list__block h4, .block-editor-block-list__block h5, .block-editor-block-list__block h6' => array(
'font-family' => astra_get_font_family( $body_font_family ),
'font-weight' => esc_attr( $body_font_weight ),
'font-size' => astra_responsive_font( $body_font_size, 'desktop' ),
'line-height' => esc_attr( $body_line_height ),
'text-transform' => esc_attr( $body_text_transform ),
'margin-bottom' => astra_get_css_value( $para_margin_bottom, 'em' ),
),
'.editor-post-title__block .editor-post-title__input' => array(
'font-family' => ( 'inherit' === $headings_font_family ) ? astra_get_font_family( $body_font_family ) : astra_get_font_family( $headings_font_family ),
'font-size' => astra_responsive_font( $single_post_title_font_size, 'desktop' ),
'font-weight' => 'normal',
),
'.block-editor-block-list__block' => array(
'color' => esc_attr( $text_color ),
),
/**
* Content base heading color.
*/
'.editor-post-title__block .editor-post-title__input, .wc-block-grid__product-title, .edit-post-visual-editor .block-editor-block-list__block h1, .edit-post-visual-editor .block-editor-block-list__block h2, .edit-post-visual-editor .block-editor-block-list__block h3, .edit-post-visual-editor .block-editor-block-list__block h4, .edit-post-visual-editor .block-editor-block-list__block h5, .edit-post-visual-editor .block-editor-block-list__block h6, .edit-post-visual-editor .wp-block-heading, .edit-post-visual-editor .wp-block-uagb-advanced-heading h1, .edit-post-visual-editor .wp-block-uagb-advanced-heading h2, .edit-post-visual-editor .wp-block-uagb-advanced-heading h3, .edit-post-visual-editor .wp-block-uagb-advanced-heading h4, .edit-post-visual-editor .wp-block-uagb-advanced-heading h5, .edit-post-visual-editor .wp-block-uagb-advanced-heading h6' => array(
'color' => esc_attr( $heading_base_color ),
),
// Blockquote Text Color.
'blockquote' => array(
'color' => astra_adjust_brightness( $text_color, 75, 'darken' ),
),
'blockquote .editor-rich-text__tinymce a' => array(
'color' => astra_hex_to_rgba( $link_color, 1 ),
),
'blockquote' => array(
'border-color' => astra_hex_to_rgba( $link_color, 0.05 ),
),
'.block-editor-block-list__block .wp-block-quote:not(.is-large):not(.is-style-large), .edit-post-visual-editor .wp-block-pullquote blockquote' => array(
'border-color' => astra_hex_to_rgba( $link_color, 0.15 ),
),
// Heading H1 - H6 font size.
'.edit-post-visual-editor .block-editor-block-list__block h1, .wp-block-heading h1, .wp-block-freeform.block-library-rich-text__tinymce h1, .edit-post-visual-editor .wp-block-heading h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1' => array(
'font-size' => astra_responsive_font( $heading_h1_font_size, 'desktop' ),
'font-family' => astra_get_css_value( $h1_font_family, 'font' ),
'font-weight' => astra_get_css_value( $h1_font_weight, 'font' ),
'line-height' => esc_attr( $h1_line_height ),
'text-transform' => esc_attr( $h1_text_transform ),
),
'.edit-post-visual-editor .block-editor-block-list__block h2, .wp-block-heading h2, .wp-block-freeform.block-library-rich-text__tinymce h2, .edit-post-visual-editor .wp-block-heading h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2' => array(
'font-size' => astra_responsive_font( $heading_h2_font_size, 'desktop' ),
'font-family' => astra_get_css_value( $h2_font_family, 'font' ),
'font-weight' => astra_get_css_value( $h2_font_weight, 'font' ),
'line-height' => esc_attr( $h2_line_height ),
'text-transform' => esc_attr( $h2_text_transform ),
),
'.edit-post-visual-editor .block-editor-block-list__block h3, .wp-block-heading h3, .wp-block-freeform.block-library-rich-text__tinymce h3, .edit-post-visual-editor .wp-block-heading h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3' => array(
'font-size' => astra_responsive_font( $heading_h3_font_size, 'desktop' ),
'font-family' => astra_get_css_value( $h3_font_family, 'font' ),
'font-weight' => astra_get_css_value( $h3_font_weight, 'font' ),
'line-height' => esc_attr( $h3_line_height ),
'text-transform' => esc_attr( $h3_text_transform ),
),
'.edit-post-visual-editor .block-editor-block-list__block h4, .wp-block-heading h4, .wp-block-freeform.block-library-rich-text__tinymce h4, .edit-post-visual-editor .wp-block-heading h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4' => array(
'font-size' => astra_responsive_font( $heading_h4_font_size, 'desktop' ),
'line-height' => esc_attr( $h4_line_height ),
),
'.edit-post-visual-editor .block-editor-block-list__block h5, .wp-block-heading h5, .wp-block-freeform.block-library-rich-text__tinymce h5, .edit-post-visual-editor .wp-block-heading h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5' => array(
'font-size' => astra_responsive_font( $heading_h5_font_size, 'desktop' ),
'line-height' => esc_attr( $h5_line_height ),
),
'.edit-post-visual-editor .block-editor-block-list__block h6, .wp-block-heading h6, .wp-block-freeform.block-library-rich-text__tinymce h6, .edit-post-visual-editor .wp-block-heading h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6' => array(
'font-size' => astra_responsive_font( $heading_h6_font_size, 'desktop' ),
'line-height' => esc_attr( $h6_line_height ),
),
/**
* WooCommerce Grid Products compatibility.
*/
'.wc-block-grid__product-title' => array(
'color' => esc_attr( $text_color ),
),
'.wc-block-grid__product .wc-block-grid__product-onsale' => array(
'background-color' => $theme_color,
'color' => astra_get_foreground_color( $theme_color ),
),
'.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wp-block-button__link, .wc-block-grid__product-onsale' => array(
'color' => $btn_color,
'border-color' => $btn_bg_color,
'background-color' => $btn_bg_color,
),
'.wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array(
'color' => $btn_h_color,
'border-color' => $btn_bg_h_color,
'background-color' => $btn_bg_h_color,
),
'.wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array(
'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ),
'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ),
'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ),
'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ),
'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ),
),
);
$css .= astra_parse_css( $desktop_css );
/**
* Global button CSS - Tablet.
*/
$css_prod_button_tablet = array(
'.wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array(
'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ),
'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ),
'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ),
'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ),
),
);
$css .= astra_parse_css( $css_prod_button_tablet, '', astra_get_tablet_breakpoint() );
/**
* Global button CSS - Mobile.
*/
$css_prod_button_mobile = array(
'.wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array(
'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ),
'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ),
'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ),
'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ),
),
);
$css .= astra_parse_css( $css_prod_button_mobile, '', astra_get_mobile_breakpoint() );
if ( Astra_Dynamic_CSS::page_builder_button_style_css() ) {
$button_desktop_css = array(
/**
* Gutenberg button compatibility for default styling.
*/
'.wp-block-button .wp-block-button__link' => array(
'border-style' => 'solid',
'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '1px',
'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '1px',
'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '1px',
'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '1px',
'color' => esc_attr( $btn_color ),
'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ),
'background-color' => esc_attr( $btn_bg_color ),
'font-family' => astra_get_font_family( $theme_btn_font_family ),
'font-weight' => esc_attr( $theme_btn_font_weight ),
'line-height' => esc_attr( $theme_btn_line_height ),
'text-transform' => esc_attr( $theme_btn_text_transform ),
'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ),
'font-size' => astra_responsive_font( $theme_btn_font_size, 'desktop' ),
'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ),
'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ),
'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ),
'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ),
'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ),
),
'.wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' => array(
'color' => esc_attr( $btn_h_color ),
'background-color' => esc_attr( $btn_bg_h_color ),
'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_h_color ) : esc_attr( $btn_border_h_color ),
),
);
$css .= astra_parse_css( $button_desktop_css );
/**
* Global button CSS - Tablet.
*/
$css_global_button_tablet = array(
'.wp-block-button .wp-block-button__link' => array(
'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ),
'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ),
'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ),
'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ),
),
);
$css .= astra_parse_css( $css_global_button_tablet, '', astra_get_tablet_breakpoint() );
/**
* Global button CSS - Mobile.
*/
$css_global_button_mobile = array(
'.wp-block-button .wp-block-button__link' => array(
'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ),
'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ),
'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ),
'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ),
),
);
$css .= astra_parse_css( $css_global_button_mobile, '', astra_get_mobile_breakpoint() );
}
$tablet_css = array(
'.editor-post-title__block .editor-post-title__input' => array(
'font-size' => astra_responsive_font( $single_post_title_font_size, 'tablet', 30 ),
),
// Heading H1 - H6 font size.
'.edit-post-visual-editor h1, .wp-block-heading h1, .wp-block-freeform.block-library-rich-text__tinymce h1, .edit-post-visual-editor .wp-block-heading h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1' => array(
'font-size' => astra_responsive_font( $heading_h1_font_size, 'tablet', 30 ),
),
'.edit-post-visual-editor h2, .wp-block-heading h2, .wp-block-freeform.block-library-rich-text__tinymce h2, .edit-post-visual-editor .wp-block-heading h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2' => array(
'font-size' => astra_responsive_font( $heading_h2_font_size, 'tablet', 25 ),
),
'.edit-post-visual-editor h3, .wp-block-heading h3, .wp-block-freeform.block-library-rich-text__tinymce h3, .edit-post-visual-editor .wp-block-heading h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3' => array(
'font-size' => astra_responsive_font( $heading_h3_font_size, 'tablet', 20 ),
),
'.edit-post-visual-editor h4, .wp-block-heading h4, .wp-block-freeform.block-library-rich-text__tinymce h4, .edit-post-visual-editor .wp-block-heading h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4' => array(
'font-size' => astra_responsive_font( $heading_h4_font_size, 'tablet' ),
),
'.edit-post-visual-editor h5, .wp-block-heading h5, .wp-block-freeform.block-library-rich-text__tinymce h5, .edit-post-visual-editor .wp-block-heading h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5' => array(
'font-size' => astra_responsive_font( $heading_h5_font_size, 'tablet' ),
),
'.edit-post-visual-editor h6, .wp-block-heading h6, .wp-block-freeform.block-library-rich-text__tinymce h6, .edit-post-visual-editor .wp-block-heading h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6' => array(
'font-size' => astra_responsive_font( $heading_h6_font_size, 'tablet' ),
),
'.ast-separate-container .edit-post-visual-editor, .ast-page-builder-template .edit-post-visual-editor, .ast-plain-container .edit-post-visual-editor, .ast-separate-container #wpwrap #editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $box_bg_obj, 'tablet' ),
);
$css .= astra_parse_css( $tablet_css, '', astra_get_tablet_breakpoint() );
$mobile_css = array(
'.editor-post-title__block .editor-post-title__input' => array(
'font-size' => astra_responsive_font( $single_post_title_font_size, 'mobile', 30 ),
),
// Heading H1 - H6 font size.
'.edit-post-visual-editor h1, .wp-block-heading h1, .wp-block-freeform.block-library-rich-text__tinymce h1, .edit-post-visual-editor .wp-block-heading h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1' => array(
'font-size' => astra_responsive_font( $heading_h1_font_size, 'mobile', 30 ),
),
'.edit-post-visual-editor h2, .wp-block-heading h2, .wp-block-freeform.block-library-rich-text__tinymce h2, .edit-post-visual-editor .wp-block-heading h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2' => array(
'font-size' => astra_responsive_font( $heading_h2_font_size, 'mobile', 25 ),
),
'.edit-post-visual-editor h3, .wp-block-heading h3, .wp-block-freeform.block-library-rich-text__tinymce h3, .edit-post-visual-editor .wp-block-heading h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3' => array(
'font-size' => astra_responsive_font( $heading_h3_font_size, 'mobile', 20 ),
),
'.edit-post-visual-editor h4, .wp-block-heading h4, .wp-block-freeform.block-library-rich-text__tinymce h4, .edit-post-visual-editor .wp-block-heading h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4' => array(
'font-size' => astra_responsive_font( $heading_h4_font_size, 'mobile' ),
),
'.edit-post-visual-editor h5, .wp-block-heading h5, .wp-block-freeform.block-library-rich-text__tinymce h5, .edit-post-visual-editor .wp-block-heading h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5' => array(
'font-size' => astra_responsive_font( $heading_h5_font_size, 'mobile' ),
),
'.edit-post-visual-editor h6, .wp-block-heading h6, .wp-block-freeform.block-library-rich-text__tinymce h6, .edit-post-visual-editor .wp-block-heading h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6' => array(
'font-size' => astra_responsive_font( $heading_h6_font_size, 'mobile' ),
),
'.ast-separate-container .edit-post-visual-editor, .ast-page-builder-template .edit-post-visual-editor, .ast-plain-container .edit-post-visual-editor, .ast-separate-container #wpwrap #editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $box_bg_obj, 'mobile' ),
);
$css .= astra_parse_css( $mobile_css, '', astra_get_mobile_breakpoint() );
if ( 'page-builder' === $container_layout ) {
$page_builder_css = array(
'.editor-post-title__block, .editor-default-block-appender, .block-editor-block-list__block' => array(
'width' => '100%',
'max-width' => '100%',
),
'.block-editor-block-list__layout' => array(
'padding-left' => 0,
'padding-right' => 0,
),
'.editor-block-list__block-edit .editor-block-list__block-edit' => array(
'padding-left' => '0',
'padding-right' => '0',
),
'.edit-post-visual-editor .block-editor-block-list__block' => array(
'padding-left' => '20px',
'padding-right' => '20px',
),
'.edit-post-visual-editor .wp-block .block-editor-block-list__block' => array(
'padding-left' => '0',
'padding-right' => '0',
),
);
$css .= astra_parse_css( $page_builder_css );
}
if ( 'page-builder' === $container_layout || 'plain-container' === $container_layout ) {
$aligned_full_content_css = array(
'.block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit' => array(
'margin-left' => '0',
'margin-right' => '0',
),
'.block-editor-block-list__layout .block-editor-block-list__block[data-align="full"]' => array(
'margin-left' => '0',
'margin-right' => '0',
),
);
$css .= astra_parse_css( $aligned_full_content_css );
}
if ( 'page-builder' === $container_layout ) {
$full_width_streched_css = array(
'.block-editor-block-list__layout' => array(
'margin-left' => '60px',
'margin-right' => '60px',
),
// WordPress 5.4 compatibility CSS.
'.wp-block .block-editor-block-list__layout' => array(
'margin-left' => '0px',
'margin-right' => '0px',
),
);
$css .= astra_parse_css( $full_width_streched_css );
}
if ( 'content-boxed-container' === $container_layout || 'boxed-container' === $container_layout ) {
$boxed_container = array(
'.block-editor-writing-flow' => array(
'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ),
'margin' => '0 auto',
'background-color' => '#fff',
),
'.gutenberg__editor' => array(
'background-color' => '#f5f5f5',
),
'.block-editor-block-list__layout, .editor-post-title' => array(
'padding-top' => 'calc( 5.34em - 19px)',
'padding-bottom' => '5.34em',
'padding-left' => 'calc( 6.67em - 28px )',
'padding-right' => 'calc( 6.67em - 28px )',
),
'.block-editor-block-list__layout' => array(
'padding-top' => '0',
),
'.editor-post-title' => array(
'padding-bottom' => '0',
),
'.block-editor-block-list__block' => array(
'max-width' => 'calc(' . astra_get_css_value( $site_content_width, 'px' ) . ' - 6.67em)',
),
'.block-editor-block-list__block[data-align=wide]' => array(
'margin-left' => '-20px',
'margin-right' => '-20px',
),
'.block-editor-block-list__block[data-align=full]' => array(
'margin-left' => '-6.67em',
'margin-right' => '-6.67em',
),
'.block-editor-block-list__layout .block-editor-block-list__block[data-align="full"], .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] > .editor-block-list__block-edit' => array(
'margin-left' => '0',
'margin-right' => '0',
),
);
$css .= astra_parse_css( $boxed_container );
}
return $css;
}
}
endif;
PK \0 common-functions.phpnu W+A 'unset',
'background-image' => 'linear-gradient(to right, ' . esc_attr( $bg_color ) . ', ' . esc_attr( $bg_color ) . '), url(' . esc_url( $bg_img ) . ')',
);
} elseif ( '' !== $bg_img ) {
$gen_bg_css = array( 'background-image' => 'url(' . esc_url( $bg_img ) . ')' );
} elseif ( '' !== $bg_color ) {
$gen_bg_css = array( 'background-color' => esc_attr( $bg_color ) );
}
if ( '' !== $bg_img ) {
if ( isset( $bg_obj['background-repeat'] ) ) {
$gen_bg_css['background-repeat'] = esc_attr( $bg_obj['background-repeat'] );
}
if ( isset( $bg_obj['background-position'] ) ) {
$gen_bg_css['background-position'] = esc_attr( $bg_obj['background-position'] );
}
if ( isset( $bg_obj['background-size'] ) ) {
$gen_bg_css['background-size'] = esc_attr( $bg_obj['background-size'] );
}
if ( isset( $bg_obj['background-attachment'] ) ) {
$gen_bg_css['background-attachment'] = esc_attr( $bg_obj['background-attachment'] );
}
}
return $gen_bg_css;
}
}
/**
* Parse CSS
*/
if ( ! function_exists( 'astra_parse_css' ) ) {
/**
* Parse CSS
*
* @param array $css_output Array of CSS.
* @param string $min_media Min Media breakpoint.
* @param string $max_media Max Media breakpoint.
* @return string Generated CSS.
*/
function astra_parse_css( $css_output = array(), $min_media = '', $max_media = '' ) {
$parse_css = '';
if ( is_array( $css_output ) && count( $css_output ) > 0 ) {
foreach ( $css_output as $selector => $properties ) {
if ( null === $properties ) {
break;
}
if ( ! count( $properties ) ) {
continue; }
$temp_parse_css = $selector . '{';
$properties_added = 0;
foreach ( $properties as $property => $value ) {
if ( '' === $value ) {
continue; }
$properties_added++;
$temp_parse_css .= $property . ':' . $value . ';';
}
$temp_parse_css .= '}';
if ( $properties_added > 0 ) {
$parse_css .= $temp_parse_css;
}
}
if ( '' != $parse_css && ( '' !== $min_media || '' !== $max_media ) ) {
$media_css = '@media ';
$min_media_css = '';
$max_media_css = '';
$media_separator = '';
if ( '' !== $min_media ) {
$min_media_css = '(min-width:' . $min_media . 'px)';
}
if ( '' !== $max_media ) {
$max_media_css = '(max-width:' . $max_media . 'px)';
}
if ( '' !== $min_media && '' !== $max_media ) {
$media_separator = ' and ';
}
$media_css .= $min_media_css . $media_separator . $max_media_css . '{' . $parse_css . '}';
return $media_css;
}
}
return $parse_css;
}
}
/**
* Return Theme options.
*/
if ( ! function_exists( 'astra_get_option' ) ) {
/**
* Return Theme options.
*
* @param string $option Option key.
* @param string $default Option default value.
* @param string $deprecated Option default value.
* @return Mixed Return option value.
*/
function astra_get_option( $option, $default = '', $deprecated = '' ) {
if ( '' != $deprecated ) {
$default = $deprecated;
}
$theme_options = Astra_Theme_Options::get_options();
/**
* Filter the options array for Astra Settings.
*
* @since 1.0.20
* @var Array
*/
$theme_options = apply_filters( 'astra_get_option_array', $theme_options, $option, $default );
$value = ( isset( $theme_options[ $option ] ) && '' !== $theme_options[ $option ] ) ? $theme_options[ $option ] : $default;
/**
* Dynamic filter astra_get_option_$option.
* $option is the name of the Astra Setting, Refer Astra_Theme_Options::defaults() for option names from the theme.
*
* @since 1.0.20
* @var Mixed.
*/
return apply_filters( "astra_get_option_{$option}", $value, $option, $default );
}
}
if ( ! function_exists( 'astra_update_option' ) ) {
/**
* Update Theme options.
*
* @param string $option option key.
* @param Mixed $value option value.
* @return void
*/
function astra_update_option( $option, $value ) {
do_action( "astra_before_update_option_{$option}", $value, $option );
// Get all customizer options.
$theme_options = get_option( ASTRA_THEME_SETTINGS );
// Update value in options array.
$theme_options[ $option ] = $value;
update_option( ASTRA_THEME_SETTINGS, $theme_options );
do_action( "astra_after_update_option_{$option}", $value, $option );
}
}
if ( ! function_exists( 'astra_delete_option' ) ) {
/**
* Update Theme options.
*
* @param string $option option key.
* @return void
*/
function astra_delete_option( $option ) {
do_action( "astra_before_delete_option_{$option}", $option );
// Get all customizer options.
$theme_options = get_option( ASTRA_THEME_SETTINGS );
// Update value in options array.
unset( $theme_options[ $option ] );
update_option( ASTRA_THEME_SETTINGS, $theme_options );
do_action( "astra_after_delete_option_{$option}", $option );
}
}
/**
* Return Theme options from postmeta.
*/
if ( ! function_exists( 'astra_get_option_meta' ) ) {
/**
* Return Theme options from postmeta.
*
* @param string $option_id Option ID.
* @param string $default Option default value.
* @param boolean $only_meta Get only meta value.
* @param string $extension Is value from extension.
* @param string $post_id Get value from specific post by post ID.
* @return Mixed Return option value.
*/
function astra_get_option_meta( $option_id, $default = '', $only_meta = false, $extension = '', $post_id = '' ) {
$post_id = ( '' != $post_id ) ? $post_id : astra_get_post_id();
$value = astra_get_option( $option_id, $default );
// Get value from option 'post-meta'.
if ( is_singular() || ( is_home() && ! is_front_page() ) ) {
$value = get_post_meta( $post_id, $option_id, true );
if ( empty( $value ) || 'default' == $value ) {
if ( true == $only_meta ) {
return false;
}
$value = astra_get_option( $option_id, $default );
}
}
/**
* Dynamic filter astra_get_option_meta_$option.
* $option_id is the name of the Astra Meta Setting.
*
* @since 1.0.20
* @var Mixed.
*/
return apply_filters( "astra_get_option_meta_{$option_id}", $value, $default, $default );
}
}
/**
* Helper function to get the current post id.
*/
if ( ! function_exists( 'astra_get_post_id' ) ) {
/**
* Get post ID.
*
* @param string $post_id_override Get override post ID.
* @return number Post ID.
*/
function astra_get_post_id( $post_id_override = '' ) {
if ( null == Astra_Theme_Options::$post_id ) {
global $post;
$post_id = 0;
if ( is_home() ) {
$post_id = get_option( 'page_for_posts' );
} elseif ( is_archive() ) {
global $wp_query;
$post_id = $wp_query->get_queried_object_id();
} elseif ( isset( $post->ID ) && ! is_search() && ! is_category() ) {
$post_id = $post->ID;
}
Astra_Theme_Options::$post_id = $post_id;
}
return apply_filters( 'astra_get_post_id', Astra_Theme_Options::$post_id, $post_id_override );
}
}
/**
* Display classes for primary div
*/
if ( ! function_exists( 'astra_primary_class' ) ) {
/**
* Display classes for primary div
*
* @param string|array $class One or more classes to add to the class list.
* @return void Echo classes.
*/
function astra_primary_class( $class = '' ) {
// Separates classes with a single space, collates classes for body element.
echo 'class="' . esc_attr( join( ' ', astra_get_primary_class( $class ) ) ) . '"';
}
}
/**
* Retrieve the classes for the primary element as an array.
*/
if ( ! function_exists( 'astra_get_primary_class' ) ) {
/**
* Retrieve the classes for the primary element as an array.
*
* @param string|array $class One or more classes to add to the class list.
* @return array Return array of classes.
*/
function astra_get_primary_class( $class = '' ) {
// array of class names.
$classes = array();
// default class for content area.
$classes[] = 'content-area';
// primary base class.
$classes[] = 'primary';
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
} else {
// Ensure that we always coerce class to being an array.
$class = array();
}
// Filter primary div class names.
$classes = apply_filters( 'astra_primary_class', $classes, $class );
$classes = array_map( 'sanitize_html_class', $classes );
return array_unique( $classes );
}
}
/**
* Display classes for secondary div
*/
if ( ! function_exists( 'astra_secondary_class' ) ) {
/**
* Retrieve the classes for the secondary element as an array.
*
* @param string|array $class One or more classes to add to the class list.
* @return void echo classes.
*/
function astra_secondary_class( $class = '' ) {
// Separates classes with a single space, collates classes for body element.
echo 'class="' . esc_attr( join( ' ', astra_get_secondary_class( $class ) ) ) . '"';
}
}
/**
* Retrieve the classes for the secondary element as an array.
*/
if ( ! function_exists( 'astra_get_secondary_class' ) ) {
/**
* Retrieve the classes for the secondary element as an array.
*
* @param string|array $class One or more classes to add to the class list.
* @return array Return array of classes.
*/
function astra_get_secondary_class( $class = '' ) {
// array of class names.
$classes = array();
// default class from widget area.
$classes[] = 'widget-area';
// secondary base class.
$classes[] = 'secondary';
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
} else {
// Ensure that we always coerce class to being an array.
$class = array();
}
// Filter secondary div class names.
$classes = apply_filters( 'astra_secondary_class', $classes, $class );
$classes = array_map( 'sanitize_html_class', $classes );
return array_unique( $classes );
}
}
/**
* Get post format
*/
if ( ! function_exists( 'astra_get_post_format' ) ) {
/**
* Get post format
*
* @param string $post_format_override Override post formate.
* @return string Return post format.
*/
function astra_get_post_format( $post_format_override = '' ) {
if ( ( is_home() ) || is_archive() ) {
$post_format = 'blog';
} else {
$post_format = get_post_format();
}
return apply_filters( 'astra_get_post_format', $post_format, $post_format_override );
}
}
/**
* Wrapper function for get_the_title() for blog post.
*/
if ( ! function_exists( 'astra_the_post_title' ) ) {
/**
* Wrapper function for get_the_title() for blog post.
*
* Displays title only if the page title bar is disabled.
*
* @since 1.0.15
* @param string $before Optional. Content to prepend to the title.
* @param string $after Optional. Content to append to the title.
* @param int $post_id Optional, default to 0. Post id.
* @param bool $echo Optional, default to true.Whether to display or return.
* @return string|void String if $echo parameter is false.
*/
function astra_the_post_title( $before = '', $after = '', $post_id = 0, $echo = true ) {
$enabled = apply_filters( 'astra_the_post_title_enabled', true );
if ( $enabled ) {
$title = astra_get_the_title( $post_id );
$before = apply_filters( 'astra_the_post_title_before', $before );
$after = apply_filters( 'astra_the_post_title_after', $after );
// This will work same as `the_title` function but with Custom Title if exits.
if ( $echo ) {
echo $before . $title . $after; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
return $before . $title . $after;
}
}
}
}
/**
* Wrapper function for the_title()
*/
if ( ! function_exists( 'astra_the_title' ) ) {
/**
* Wrapper function for the_title()
*
* Displays title only if the page title bar is disabled.
*
* @param string $before Optional. Content to prepend to the title.
* @param string $after Optional. Content to append to the title.
* @param int $post_id Optional, default to 0. Post id.
* @param bool $echo Optional, default to true.Whether to display or return.
* @return string|void String if $echo parameter is false.
*/
function astra_the_title( $before = '', $after = '', $post_id = 0, $echo = true ) {
$title = '';
$blog_post_title = astra_get_option( 'blog-post-structure' );
$single_post_title = astra_get_option( 'blog-single-post-structure' );
if ( ( ( ! is_singular() && in_array( 'title-meta', $blog_post_title ) ) || ( is_single() && in_array( 'single-title-meta', $single_post_title ) ) || is_page() ) ) {
if ( apply_filters( 'astra_the_title_enabled', true ) ) {
$title = astra_get_the_title( $post_id );
$before = apply_filters( 'astra_the_title_before', $before );
$after = apply_filters( 'astra_the_title_after', $after );
$title = $before . $title . $after;
}
}
// This will work same as `the_title` function but with Custom Title if exits.
if ( $echo ) {
echo $title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
return $title;
}
}
}
/**
* Wrapper function for get_the_title()
*/
if ( ! function_exists( 'astra_get_the_title' ) ) {
/**
* Wrapper function for get_the_title()
*
* Return title for Title Bar and Normal Title.
*
* @param int $post_id Optional, default to 0. Post id.
* @param bool $echo Optional, default to false. Whether to display or return.
* @return string|void String if $echo parameter is false.
*/
function astra_get_the_title( $post_id = 0, $echo = false ) {
$title = '';
if ( $post_id || is_singular() ) {
$title = get_the_title( $post_id );
} else {
if ( is_front_page() && is_home() ) {
// Default homepage.
$title = apply_filters( 'astra_the_default_home_page_title', esc_html__( 'Home', 'astra' ) );
} elseif ( is_home() ) {
// blog page.
$title = apply_filters( 'astra_the_blog_home_page_title', get_the_title( get_option( 'page_for_posts', true ) ) );
} elseif ( is_404() ) {
// for 404 page - title always display.
$title = apply_filters( 'astra_the_404_page_title', esc_html__( 'This page doesn\'t seem to exist.', 'astra' ) );
// for search page - title always display.
} elseif ( is_search() ) {
/* translators: 1: search string */
$title = apply_filters( 'astra_the_search_page_title', sprintf( __( 'Search Results for: %s', 'astra' ), '' . get_search_query() . ' ' ) );
} elseif ( class_exists( 'WooCommerce' ) && is_shop() ) {
$title = woocommerce_page_title( false );
} elseif ( is_archive() ) {
$title = get_the_archive_title();
}
}
$title = apply_filters( 'astra_the_title', $title, $post_id );
// This will work same as `get_the_title` function but with Custom Title if exits.
if ( $echo ) {
echo $title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
return $title;
}
}
}
/**
* Archive Page Title
*/
if ( ! function_exists( 'astra_archive_page_info' ) ) {
/**
* Wrapper function for the_title()
*
* Displays title only if the page title bar is disabled.
*/
function astra_archive_page_info() {
if ( apply_filters( 'astra_the_title_enabled', true ) ) {
// Author.
if ( is_author() ) { ?>
' . get_search_query() . '' ) );
?>
hexdec( substr( $hex, 0, 2 ) ),
'g' => hexdec( substr( $hex, 2, 2 ) ),
'b' => hexdec( substr( $hex, 4, 2 ) ),
);
// Should we darken the color?
if ( 'reverse' == $type && $shortcode_atts['r'] + $shortcode_atts['g'] + $shortcode_atts['b'] > 382 ) {
$steps = -$steps;
} elseif ( 'darken' == $type ) {
$steps = -$steps;
}
// Build the new color.
$steps = max( -255, min( 255, $steps ) );
$shortcode_atts['r'] = max( 0, min( 255, $shortcode_atts['r'] + $steps ) );
$shortcode_atts['g'] = max( 0, min( 255, $shortcode_atts['g'] + $steps ) );
$shortcode_atts['b'] = max( 0, min( 255, $shortcode_atts['b'] + $steps ) );
$r_hex = str_pad( dechex( $shortcode_atts['r'] ), 2, '0', STR_PAD_LEFT );
$g_hex = str_pad( dechex( $shortcode_atts['g'] ), 2, '0', STR_PAD_LEFT );
$b_hex = str_pad( dechex( $shortcode_atts['b'] ), 2, '0', STR_PAD_LEFT );
return '#' . $r_hex . $g_hex . $b_hex;
}
} // End if.
/**
* Convert colors from HEX to RGBA
*/
if ( ! function_exists( 'astra_hex_to_rgba' ) ) :
/**
* Convert colors from HEX to RGBA
*
* @param string $color Color code in HEX.
* @param boolean $opacity Color code opacity.
* @return string Color code in RGB or RGBA.
*/
function astra_hex_to_rgba( $color, $opacity = false ) {
$default = 'rgb(0,0,0)';
// Return default if no color provided.
if ( empty( $color ) ) {
return $default;
}
// Sanitize $color if "#" is provided.
if ( '#' == $color[0] ) {
$color = substr( $color, 1 );
}
// Check if color has 6 or 3 characters and get values.
if ( 6 == strlen( $color ) ) {
$hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
} elseif ( 3 == strlen( $color ) ) {
$hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );
} else {
return $default;
}
// Convert HEX to RGB.
$rgb = array_map( 'hexdec', $hex );
// Check if opacity is set(RGBA or RGB).
if ( $opacity ) {
if ( 1 < abs( $opacity ) ) {
$opacity = 1.0;
}
$output = 'rgba(' . implode( ',', $rgb ) . ',' . $opacity . ')';
} else {
$output = 'rgb(' . implode( ',', $rgb ) . ')';
}
// Return RGB(a) color string.
return $output;
}
endif;
if ( ! function_exists( 'astra_enable_page_builder_compatibility' ) ) :
/**
* Allow filter to enable/disable page builder compatibility.
*
* @see https://wpastra.com/docs/recommended-settings-beaver-builder-astra/
* @see https://wpastra.com/docs/recommended-settings-for-elementor/
*
* @since 1.2.2
* @return bool True - If the page builder compatibility is enabled. False - IF the page builder compatibility is disabled.
*/
function astra_enable_page_builder_compatibility() {
return apply_filters( 'astra_enable_page_builder_compatibility', true );
}
endif;
if ( ! function_exists( 'astra_get_pro_url' ) ) :
/**
* Returns an URL with utm tags
* the admin settings page.
*
* @param string $url URL fo the site.
* @param string $source utm source.
* @param string $medium utm medium.
* @param string $campaign utm campaign.
* @return mixed
*/
function astra_get_pro_url( $url, $source = '', $medium = '', $campaign = '' ) {
$astra_pro_url = trailingslashit( $url );
// Set up our URL if we have a source.
if ( isset( $source ) ) {
$astra_pro_url = add_query_arg( 'utm_source', sanitize_text_field( $source ), $url );
}
// Set up our URL if we have a medium.
if ( isset( $medium ) ) {
$astra_pro_url = add_query_arg( 'utm_medium', sanitize_text_field( $medium ), $url );
}
// Set up our URL if we have a campaign.
if ( isset( $campaign ) ) {
$astra_pro_url = add_query_arg( 'utm_campaign', sanitize_text_field( $campaign ), $url );
}
return esc_url( apply_filters( 'astra_get_pro_url', $astra_pro_url, $url ) );
}
endif;
/**
* Search Form
*/
if ( ! function_exists( 'astra_get_search_form' ) ) :
/**
* Display search form.
*
* @param bool $echo Default to echo and not return the form.
* @return string|void String when $echo is false.
*/
function astra_get_search_form( $echo = true ) {
$form = '';
/**
* Filters the HTML output of the search form.
*
* @param string $form The search form HTML output.
*/
$result = apply_filters( 'astra_get_search_form', $form );
if ( null === $result ) {
$result = $form;
}
if ( $echo ) {
echo $result; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
return $result;
}
}
endif;
/**
* Check if we're being delivered AMP
*
* @return bool
*/
function astra_is_amp_endpoint() {
return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint();
}
/*
* Get Responsive Spacing
*/
if ( ! function_exists( 'astra_responsive_spacing' ) ) {
/**
* Get Spacing value
*
* @param array $option CSS value.
* @param string $side top | bottom | left | right.
* @param string $device CSS device.
* @param string $default Default value.
* @param string $prefix Prefix value.
* @return mixed
*/
function astra_responsive_spacing( $option, $side = '', $device = 'desktop', $default = '', $prefix = '' ) {
if ( isset( $option[ $device ][ $side ] ) && isset( $option[ $device . '-unit' ] ) ) {
$spacing = astra_get_css_value( $option[ $device ][ $side ], $option[ $device . '-unit' ], $default );
} elseif ( is_numeric( $option ) ) {
$spacing = astra_get_css_value( $option );
} else {
$spacing = ( ! is_array( $option ) ) ? $option : '';
}
if ( '' !== $prefix && '' !== $spacing ) {
return $prefix . $spacing;
}
return $spacing;
}
}
/**
* Get the tablet breakpoint value.
*
* @param string $min min.
* @param string $max max.
*
* @since 2.4.0
*
* @return number $breakpoint.
*/
function astra_get_tablet_breakpoint( $min = '', $max = '' ) {
$update_breakpoint = astra_get_option( 'can-update-theme-tablet-breakpoint', true );
// Change default for new users.
$default = ( true === $update_breakpoint ) ? 921 : 768;
$header_breakpoint = apply_filters( 'astra_tablet_breakpoint', $default );
if ( '' !== $min ) {
$header_breakpoint = $header_breakpoint - $min;
} elseif ( '' !== $max ) {
$header_breakpoint = $header_breakpoint + $max;
}
return absint( $header_breakpoint );
}
/**
* Get the mobile breakpoint value.
*
* @param string $min min.
* @param string $max max.
*
* @since 2.4.0
*
* @return number header_breakpoint.
*/
function astra_get_mobile_breakpoint( $min = '', $max = '' ) {
$header_breakpoint = apply_filters( 'astra_mobile_breakpoint', 544 );
if ( '' !== $min ) {
$header_breakpoint = $header_breakpoint - $min;
} elseif ( '' !== $max ) {
$header_breakpoint = $header_breakpoint + $max;
}
return absint( $header_breakpoint );
}
/*
* Apply CSS for the element
*/
if ( ! function_exists( 'astra_color_responsive_css' ) ) {
/**
* Astra Responsive Colors
*
* @param array $setting Responsive colors.
* @param string $css_property CSS property.
* @param string $selector CSS selector.
* @return string Dynamic responsive CSS.
*/
function astra_color_responsive_css( $setting, $css_property, $selector ) {
$css = '';
if ( isset( $setting['desktop'] ) && ! empty( $setting['desktop'] ) ) {
$css .= $selector . '{' . $css_property . ':' . esc_attr( $setting['desktop'] ) . ';}';
}
if ( isset( $setting['tablet'] ) && ! empty( $setting['tablet'] ) ) {
$css .= '@media (max-width:' . astra_get_tablet_breakpoint() . 'px) {' . $selector . '{' . $css_property . ':' . esc_attr( $setting['tablet'] ) . ';} }';
}
if ( isset( $setting['mobile'] ) && ! empty( $setting['mobile'] ) ) {
$css .= '@media (max-width:' . astra_get_mobile_breakpoint() . 'px) {' . $selector . '{' . $css_property . ':' . esc_attr( $setting['mobile'] ) . ';} }';
}
return $css;
}
}
if ( ! function_exists( 'astra_check_is_bb_themer_layout' ) ) :
/**
* Check if layout is bb themer's layout
*/
function astra_check_is_bb_themer_layout() {
$is_layout = false;
$post_type = get_post_type();
$post_id = get_the_ID();
if ( 'fl-theme-layout' === $post_type && $post_id ) {
$is_layout = true;
}
return $is_layout;
}
endif;
if ( ! function_exists( 'astra_is_white_labelled' ) ) :
/**
* Check if white label option is enabled in astra pro plugin
*/
function astra_is_white_labelled() {
if ( is_callable( 'Astra_Ext_White_Label_Markup::show_branding' ) && ! Astra_Ext_White_Label_Markup::show_branding() ) {
return apply_filters( 'astra_is_white_labelled', true );
}
return apply_filters( 'astra_is_white_labelled', false );
}
endif;
/**
* Get the value for font-display property.
*
* @since 1.8.6
* @return string
*/
function astra_get_fonts_display_property() {
return apply_filters( 'astra_fonts_display_property', 'fallback' );
}
/**
* Return Theme options from database.
*
* @param string $option Option key.
* @param string $default Option default value.
* @param string $deprecated Option default value.
* @return Mixed Return option value.
*/
function astra_get_db_option( $option, $default = '', $deprecated = '' ) {
if ( '' != $deprecated ) {
$default = $deprecated;
}
$theme_options = Astra_Theme_Options::get_db_options();
/**
* Filter the options array for Astra Settings.
*
* @since 1.0.20
* @var Array
*/
$theme_options = apply_filters( 'astra_get_db_option_array', $theme_options, $option, $default );
$value = ( isset( $theme_options[ $option ] ) && '' !== $theme_options[ $option ] ) ? $theme_options[ $option ] : $default;
/**
* Dynamic filter astra_get_option_$option.
* $option is the name of the Astra Setting, Refer Astra_Theme_Options::defaults() for option names from the theme.
*
* @since 1.0.20
* @var Mixed.
*/
return apply_filters( "astra_get_db_option_{$option}", $value, $option, $default );
}
/**
* Add Responsive bacground CSS
*
* @param array $bg_obj_res Color array.
* @param array $device Device name.
*
* @return array Color code in HEX.
*/
function astra_get_responsive_background_obj( $bg_obj_res, $device ) {
$gen_bg_css = array();
if ( ! is_array( $bg_obj_res ) ) {
return;
}
$bg_obj = $bg_obj_res[ $device ];
$bg_img = isset( $bg_obj['background-image'] ) ? $bg_obj['background-image'] : '';
$bg_tab_img = isset( $bg_obj_res['tablet']['background-image'] ) ? $bg_obj_res['tablet']['background-image'] : '';
$bg_desk_img = isset( $bg_obj_res['desktop']['background-image'] ) ? $bg_obj_res['desktop']['background-image'] : '';
$bg_color = isset( $bg_obj['background-color'] ) ? $bg_obj['background-color'] : '';
$tablet_css = ( isset( $bg_obj_res['tablet']['background-image'] ) && $bg_obj_res['tablet']['background-image'] ) ? true : false;
$desktop_css = ( isset( $bg_obj_res['desktop']['background-image'] ) && $bg_obj_res['desktop']['background-image'] ) ? true : false;
if ( '' !== $bg_img && '' !== $bg_color ) {
$gen_bg_css = array(
'background-image' => 'linear-gradient(to right, ' . esc_attr( $bg_color ) . ', ' . esc_attr( $bg_color ) . '), url(' . esc_url( $bg_img ) . ')',
);
} elseif ( '' !== $bg_img ) {
$gen_bg_css = array( 'background-image' => 'url(' . esc_url( $bg_img ) . ')' );
} elseif ( '' !== $bg_color ) {
if ( 'mobile' === $device ) {
if ( true == $desktop_css && true == $tablet_css ) {
$gen_bg_css = array( 'background-image' => 'linear-gradient(to right, ' . esc_attr( $bg_color ) . ', ' . esc_attr( $bg_color ) . '), url(' . esc_attr( $bg_tab_img ) . ')' );
} elseif ( true == $desktop_css ) {
$gen_bg_css = array( 'background-image' => 'linear-gradient(to right, ' . esc_attr( $bg_color ) . ', ' . esc_attr( $bg_color ) . '), url(' . esc_attr( $bg_desk_img ) . ')' );
} elseif ( true == $tablet_css ) {
$gen_bg_css = array( 'background-image' => 'linear-gradient(to right, ' . esc_attr( $bg_color ) . ', ' . esc_attr( $bg_color ) . '), url(' . esc_attr( $bg_tab_img ) . ')' );
} else {
$gen_bg_css = array(
'background-color' => esc_attr( $bg_color ),
'background-image' => 'none',
);
}
} elseif ( 'tablet' === $device ) {
if ( true == $desktop_css ) {
$gen_bg_css = array( 'background-image' => 'linear-gradient(to right, ' . esc_attr( $bg_color ) . ', ' . esc_attr( $bg_color ) . '), url(' . esc_attr( $bg_desk_img ) . ')' );
} else {
$gen_bg_css = array(
'background-color' => esc_attr( $bg_color ),
'background-image' => 'none',
);
}
} else {
$gen_bg_css = array(
'background-color' => esc_attr( $bg_color ),
'background-image' => 'none',
);
}
}
if ( '' !== $bg_img ) {
if ( isset( $bg_obj['background-repeat'] ) ) {
$gen_bg_css['background-repeat'] = esc_attr( $bg_obj['background-repeat'] );
}
if ( isset( $bg_obj['background-position'] ) ) {
$gen_bg_css['background-position'] = esc_attr( $bg_obj['background-position'] );
}
if ( isset( $bg_obj['background-size'] ) ) {
$gen_bg_css['background-size'] = esc_attr( $bg_obj['background-size'] );
}
if ( isset( $bg_obj['background-attachment'] ) ) {
$gen_bg_css['background-attachment'] = esc_attr( $bg_obj['background-attachment'] );
}
}
return $gen_bg_css;
}
PK \ class-astra-walker-page.phpnu W+A {$n}";
$output = apply_filters( 'astra_caret_wrap_filter', $output, $args['sort_column'] );
}
/**
* Outputs the beginning of the current element in the tree.
*
* @see Walker::start_el()
* @since 1.7.2
*
* @param string $output Used to append additional content. Passed by reference.
* @param WP_Post $page Page data object.
* @param int $depth Optional. Depth of page. Used for padding. Default 0.
* @param array $args Optional. Array of arguments. Default empty array.
* @param int $current_page Optional. Page ID. Default 0.
*/
public function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) {
parent::start_el( $output, $page, $depth, $args, $current_page );
$output = apply_filters( 'astra_walker_nav_menu_start_el', $output, $page, $depth, $args );
}
}
}
PK \8-H H deprecated/deprecated-hooks.phpnu W+A = 4.6 */
do_action_deprecated( $tag, $args, $version, $replacement, $message );
} else {
do_action_ref_array( $tag, $args );
}
}
}
PK \cM # deprecated/deprecated-functions.phpnu W+A = 4.6 */
return apply_filters_deprecated( $tag, $args, $version, $replacement, $message );
} else {
return apply_filters_ref_array( $tag, $args );
}
}
}
PK \