is_header_footer_builder_active ) { /** * Footer - Copyright */ if ( Astra_Addon_Builder_Helper::is_component_loaded( 'copyright', 'footer' ) ) { $copyright_font_family = astra_get_option( 'font-family-section-footer-copyright' ); $copyright_font_weight = astra_get_option( 'font-weight-section-footer-copyright' ); Astra_Fonts::add_font( $copyright_font_family, $copyright_font_weight ); } /** * Header - Account */ if ( Astra_Addon_Builder_Helper::is_component_loaded( 'account', 'header' ) ) { $account_font_family = astra_get_option( 'font-family-section-header-account' ); $account_font_weight = astra_get_option( 'font-weight-section-header-account' ); Astra_Fonts::add_font( $account_font_family, $account_font_weight ); $account_menu_font_family = astra_get_option( 'section-header-account-menu-font-family' ); $account_menu_font_weight = astra_get_option( 'section-header-account-menu-font-weight' ); Astra_Fonts::add_font( $account_menu_font_family, $account_menu_font_weight ); } /** * Footer - HTML */ $num_of_footer_html = astra_addon_builder_helper()->num_of_footer_html; for ( $index = 1; $index <= $num_of_footer_html; $index++ ) { if ( ! Astra_Addon_Builder_Helper::is_component_loaded( 'html-' . $index, 'footer' ) ) { continue; } $_prefix = 'section-fb-html-' . $index; $html_font_family = astra_get_option( 'font-family-' . $_prefix ); $html_font_weight = astra_get_option( 'font-weight-' . $_prefix ); Astra_Fonts::add_font( $html_font_family, $html_font_weight ); } /** * Header - HTML */ $num_of_header_html = astra_addon_builder_helper()->num_of_header_html; for ( $index = 1; $index <= $num_of_header_html; $index++ ) { if ( ! Astra_Addon_Builder_Helper::is_component_loaded( 'html-' . $index, 'header' ) ) { continue; } $_prefix = 'section-hb-html-' . $index; $html_font_family = astra_get_option( 'font-family-' . $_prefix ); $html_font_weight = astra_get_option( 'font-weight-' . $_prefix ); Astra_Fonts::add_font( $html_font_family, $html_font_weight ); } /** * Footer - Social */ $num_of_footer_social_icons = astra_addon_builder_helper()->num_of_footer_social_icons; for ( $index = 1; $index <= $num_of_footer_social_icons; $index++ ) { if ( ! Astra_Addon_Builder_Helper::is_component_loaded( 'social-icons-' . $index, 'footer' ) ) { continue; } $_prefix = 'section-fb-social-icons-' . $index; $social_footer_font_family = astra_get_option( 'font-family-' . $_prefix ); $social_footer_font_weight = astra_get_option( 'font-weight-' . $_prefix ); Astra_Fonts::add_font( $social_footer_font_family, $social_footer_font_weight ); } /** * Header - Social */ $num_of_header_social_icons = astra_addon_builder_helper()->num_of_header_social_icons; for ( $index = 1; $index <= $num_of_header_social_icons; $index++ ) { if ( ! Astra_Addon_Builder_Helper::is_component_loaded( 'social-icons-' . $index, 'header' ) ) { continue; } $_prefix = 'section-hb-social-icons-' . $index; $social_header_font_family = astra_get_option( 'font-family-' . $_prefix ); $social_header_font_weight = astra_get_option( 'font-weight-' . $_prefix ); Astra_Fonts::add_font( $social_header_font_family, $social_header_font_weight ); } /** * Header - Widgets */ $num_of_header_widgets = astra_addon_builder_helper()->num_of_header_widgets; for ( $index = 1; $index <= $num_of_header_widgets; $index++ ) { if ( ! Astra_Addon_Builder_Helper::is_component_loaded( 'widget-' . $index, 'header' ) ) { continue; } $_prefix = 'widget-' . $index; $widget_font_family = astra_get_option( 'header-' . $_prefix . '-font-family' ); $widget_font_weight = astra_get_option( 'header-' . $_prefix . '-font-weight' ); Astra_Fonts::add_font( $widget_font_family, $widget_font_weight ); $widget_content_font_family = astra_get_option( 'header-' . $_prefix . '-content-font-family' ); $widget_content_font_weight = astra_get_option( 'header-' . $_prefix . '-content-font-weight' ); Astra_Fonts::add_font( $widget_content_font_family, $widget_content_font_weight ); } /** * Footer - Widgets */ $num_of_footer_widgets = astra_addon_builder_helper()->num_of_footer_widgets; for ( $index = 1; $index <= $num_of_footer_widgets; $index++ ) { if ( ! Astra_Addon_Builder_Helper::is_component_loaded( 'widget-' . $index, 'footer' ) ) { continue; } $_prefix = 'widget-' . $index; $widget_font_family = astra_get_option( 'footer-' . $_prefix . '-font-family' ); $widget_font_weight = astra_get_option( 'footer-' . $_prefix . '-font-weight' ); Astra_Fonts::add_font( $widget_font_family, $widget_font_weight ); $widget_content_font_family = astra_get_option( 'footer-' . $_prefix . '-content-font-family' ); $widget_content_font_weight = astra_get_option( 'footer-' . $_prefix . '-content-font-weight' ); Astra_Fonts::add_font( $widget_content_font_family, $widget_content_font_weight ); } /** * Mobile Trigger */ $header_menu_trigger_font_family = astra_get_option( 'mobile-header-label-font-family' ); $header_menu_trigger_font_weight = astra_get_option( 'mobile-header-label-font-weight' ); Astra_Fonts::add_font( $header_menu_trigger_font_family, $header_menu_trigger_font_weight ); /** * Header - Menu */ $component_limit = astra_addon_builder_helper()->component_limit; for ( $index = 1; $index <= $component_limit; $index++ ) { $_prefix = 'menu' . $index; $submenu_font_family = astra_get_option( 'header-font-family-' . $_prefix . '-sub-menu' ); $submenu_font_weight = astra_get_option( 'header-font-weight-' . $_prefix . '-sub-menu' ); Astra_Fonts::add_font( $submenu_font_family, $submenu_font_weight ); if ( 3 > $index ) { $megamenu_font_family = astra_get_option( 'header-' . $_prefix . '-megamenu-heading-font-family' ); $megamenu_font_weight = astra_get_option( 'header-' . $_prefix . '-megamenu-heading-font-weight' ); Astra_Fonts::add_font( $megamenu_font_family, $megamenu_font_weight ); } } /** * Footer Menu */ $footer_menu_font_family = astra_get_option( 'footer-menu-font-family' ); $footer_menu_font_weight = astra_get_option( 'footer-menu-font-weight' ); Astra_Fonts::add_font( $footer_menu_font_family, $footer_menu_font_weight ); /** * Mobile menu */ $submenu_font_family = astra_get_option( 'header-mobile-menu-sub-menu-font-family' ); $submenu_font_weight = astra_get_option( 'header-mobile-menu-sub-menu-font-weight' ); Astra_Fonts::add_font( $submenu_font_family, $submenu_font_weight ); /** * Header - Language Switcher */ $header_lang_switcher_font_family = astra_get_option( 'font-family-section-hb-language-switcher' ); $header_lang_switcher_font_weight = astra_get_option( 'font-weight-section-hb-language-switcher' ); Astra_Fonts::add_font( $header_lang_switcher_font_family, $header_lang_switcher_font_weight ); /** * Footer - Language Switcher */ $footer_lang_switcher_font_family = astra_get_option( 'font-family-section-fb-language-switcher' ); $footer_lang_switcher_font_weight = astra_get_option( 'font-weight-section-fb-language-switcher' ); Astra_Fonts::add_font( $footer_lang_switcher_font_family, $footer_lang_switcher_font_weight ); } } /** * Set Options Default Values * * @param array $defaults Astra options default value array. * @return array */ public function theme_defaults( $defaults ) { $astra_options = is_callable( 'Astra_Theme_Options::get_astra_options' ) ? Astra_Theme_Options::get_astra_options() : get_option( ASTRA_THEME_SETTINGS ); $apply_new_default_color_typo_values = is_callable( 'Astra_Dynamic_CSS::astra_check_default_color_typo' ) ? Astra_Dynamic_CSS::astra_check_default_color_typo() : false; $blog_improvements = astra_addon_4_6_0_compatibility(); // Header. $defaults['font-family-site-title'] = 'inherit'; $defaults['font-weight-site-title'] = 'inherit'; $defaults['font-extras-site-title'] = array( 'line-height' => ! isset( $astra_options['font-extras-site-title'] ) && isset( $astra_options['line-height-site-title'] ) ? $astra_options['line-height-site-title'] : '1.23', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['font-extras-site-title'] ) && isset( $astra_options['text-transform-site-title'] ) ? $astra_options['text-transform-site-title'] : '', 'text-decoration' => '', ); $defaults['font-family-site-tagline'] = 'inherit'; $defaults['font-weight-site-tagline'] = 'inherit'; $defaults['font-extras-site-tagline'] = array( 'line-height' => ! isset( $astra_options['font-extras-site-tagline'] ) && isset( $astra_options['line-height-site-tagline'] ) ? $astra_options['line-height-site-tagline'] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['font-extras-site-tagline'] ) && isset( $astra_options['text-transform-site-tagline'] ) ? $astra_options['text-transform-site-tagline'] : '', 'text-decoration' => '', ); // Primary Menu. $defaults['font-size-primary-menu'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['font-weight-primary-menu'] = 'inherit'; $defaults['font-family-primary-menu'] = 'inherit'; $defaults['text-transform-primary-menu'] = ''; $defaults['line-height-primary-menu'] = ''; // Primary Dropdown Menu. $defaults['font-size-primary-dropdown-menu'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['font-family-primary-dropdown-menu'] = 'inherit'; $defaults['font-weight-primary-dropdown-menu'] = 'inherit'; $defaults['text-transform-primary-dropdown-menu'] = ''; $defaults['line-height-primary-dropdown-menu'] = ''; // Archive Summary Box. $defaults['font-family-archive-summary-title'] = 'inherit'; $defaults['font-weight-archive-summary-title'] = 'inherit'; $defaults['font-extras-archive-summary-title'] = array( 'line-height' => ! isset( $astra_options['font-extras-archive-summary-title'] ) && isset( $astra_options['line-height-archive-summary-title'] ) ? $astra_options['line-height-archive-summary-title'] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['font-extras-archive-summary-title'] ) && isset( $astra_options['text-transform-archive-summary-title'] ) ? $astra_options['text-transform-archive-summary-title'] : '', 'text-decoration' => '', ); // Archive. $defaults['font-family-page-title'] = 'inherit'; $defaults['font-weight-page-title'] = $apply_new_default_color_typo_values ? '500' : 'inherit'; $defaults['font-extras-page-title'] = array( 'line-height' => ! isset( $astra_options['font-extras-page-title'] ) && isset( $astra_options['line-height-page-title'] ) ? $astra_options['line-height-page-title'] : '1.23', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['font-extras-page-title'] ) && isset( $astra_options['text-transform-page-title'] ) ? $astra_options['text-transform-page-title'] : '', 'text-decoration' => '', ); $defaults['font-family-post-meta'] = 'inherit'; $defaults['font-weight-post-meta'] = $blog_improvements ? '600' : 'inherit'; $defaults['font-extras-post-meta'] = array( 'line-height' => ! isset( $astra_options['font-extras-post-meta'] ) && isset( $astra_options['line-height-post-meta'] ) ? $astra_options['line-height-post-meta'] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['font-extras-post-meta'] ) && isset( $astra_options['text-transform-post-meta'] ) ? $astra_options['text-transform-post-meta'] : '', 'text-decoration' => '', ); // Blog Font Tax fonts. $defaults['font-family-post-tax'] = 'inherit'; $defaults['font-weight-post-tax'] = 'inherit'; $defaults['font-extras-post-tax'] = array( 'line-height' => '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => '', 'text-decoration' => '', ); // Blog Font Read More. $defaults['font-size-post-read-more'] = array( 'desktop' => $apply_new_default_color_typo_values ? 16 : '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['font-family-post-read-more'] = 'inherit'; $defaults['font-weight-post-read-more'] = 'inherit'; $defaults['font-extras-post-read-more'] = array( 'line-height' => '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => '', 'text-decoration' => '', ); // Blog Font Excerpt. $defaults['font-size-post-excerpt'] = array( 'desktop' => $apply_new_default_color_typo_values ? 16 : '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['font-family-post-excerpt'] = 'inherit'; $defaults['font-weight-post-excerpt'] = 'inherit'; $defaults['font-extras-post-excerpt'] = array( 'line-height' => '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => '', 'text-decoration' => '', ); $defaults['font-size-post-pagination'] = array( 'desktop' => $apply_new_default_color_typo_values ? 16 : '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['text-transform-post-pagination'] = ''; // Single. $defaults['font-family-entry-title'] = 'inherit'; $defaults['font-weight-entry-title'] = 'inherit'; $defaults['font-extras-entry-title'] = array( 'line-height' => ! isset( $astra_options['font-extras-entry-title'] ) && isset( $astra_options['line-height-entry-title'] ) ? $astra_options['line-height-entry-title'] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['font-extras-entry-title'] ) && isset( $astra_options['text-transform-entry-title'] ) ? $astra_options['text-transform-entry-title'] : '', 'text-decoration' => '', ); // Button. $defaults['font-size-button'] = array( 'desktop' => $apply_new_default_color_typo_values ? 16 : '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['font-weight-button'] = $apply_new_default_color_typo_values ? '500' : 'inherit'; $defaults['font-family-button'] = 'inherit'; // Sidebar. $defaults['font-size-widget-title'] = array( 'desktop' => $apply_new_default_color_typo_values ? 26 : '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['font-size-sidebar-title'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['font-family-widget-title'] = 'inherit'; $defaults['font-weight-widget-title'] = 'inherit'; $defaults['font-extras-widget-title'] = array( 'line-height' => ! isset( $astra_options['font-extras-widget-title'] ) && isset( $astra_options['line-height-widget-title'] ) ? $astra_options['line-height-widget-title'] : '1.23', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['font-extras-widget-title'] ) && isset( $astra_options['text-transform-widget-title'] ) ? $astra_options['text-transform-widget-title'] : '', 'text-decoration' => '', ); $defaults['font-size-widget-content'] = array( 'desktop' => $apply_new_default_color_typo_values ? 16 : '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['font-size-sidebar-content'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'em', 'tablet-unit' => 'em', 'mobile-unit' => 'em', ); $defaults['font-family-widget-content'] = 'inherit'; $defaults['font-weight-widget-content'] = 'inherit'; $defaults['line-height-widget-content'] = ''; $defaults['font-extras-widget-content'] = array( 'line-height' => ! isset( $astra_options['font-extras-widget-content'] ) && isset( $astra_options['line-height-widget-content'] ) ? $astra_options['line-height-widget-content'] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['font-extras-widget-content'] ) && isset( $astra_options['text-transform-widget-content'] ) ? $astra_options['text-transform-widget-content'] : '', 'text-decoration' => '', ); // Footer. $defaults['font-size-footer-content'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['font-family-footer-content'] = 'inherit'; $defaults['font-weight-footer-content'] = 'inherit'; $defaults['text-transform-footer-content'] = ''; $defaults['line-height-footer-content'] = ''; // Header