ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç deprecated/deprecated-filters.php000064400000016321152266256010013133 0ustar00= 4.6 */ return apply_filters_deprecated( $tag, $args, $version, $replacement, $message ); } return apply_filters_ref_array( $tag, $args ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound } } // Deprecating ast_footer_bar_display filter. add_filter( 'astra_footer_bar_display', 'astra_deprecated_ast_footer_bar_display_filter', 10, 1 ); /** * Display footer builder markup. * * @since 3.7.4 * @param bool $display_footer true | false. * @return bool true for enabled | false for disable. */ function astra_deprecated_ast_footer_bar_display_filter( $display_footer ) { return astra_apply_filters_deprecated( 'ast_footer_bar_display', array( $display_footer ), '3.7.4', 'astra_footer_bar_display', '' ); } // Deprecating ast_main_header_display filter. add_filter( 'astra_main_header_display', 'astra_deprecated_ast_main_header_display_filter', 10, 1 ); /** * Display header builder markup. * * @since 3.7.4 * @param bool $display_header true | false. * @return bool true for enabled | false for disable. */ function astra_deprecated_ast_main_header_display_filter( $display_header ) { return astra_apply_filters_deprecated( 'ast_main_header_display', array( $display_header ), '3.7.4', 'astra_main_header_display', '' ); } // Deprecating secondary_submenu_border_class filter. add_filter( 'astra_secondary_submenu_border_class', 'astra_deprecated_secondary_submenu_border_class_filter', 10, 1 ); /** * Border class to secondary submenu * * @since 3.7.4 * @param string $class_selector custom class assigned to secondary submenu. * @return string $class_selector updated class selector. */ function astra_deprecated_secondary_submenu_border_class_filter( $class_selector ) { return astra_apply_filters_deprecated( 'secondary_submenu_border_class', array( $class_selector ), '3.7.4', 'astra_secondary_submenu_border_class', '' ); } // Deprecating gtn_image_group_css_comp filter. add_filter( 'astra_gutenberg_image_group_style_support', 'astra_deprecated_gtn_image_group_css_comp_filter', 10, 1 ); /** * Image, group compatibility support released in v2.4.4. * * @since 3.7.4 * @param bool $block_support true | false. * @return bool true for enabled | false for disable. */ function astra_deprecated_gtn_image_group_css_comp_filter( $block_support ) { return astra_apply_filters_deprecated( 'gtn_image_group_css_comp', array( $block_support ), '3.7.4', 'astra_gutenberg_image_group_style_support', '' ); } // Deprecating ast_footer_sml_layout filter. add_filter( 'astra_footer_sml_layout', 'astra_deprecated_ast_footer_sml_layout_filter', 10, 1 ); /** * Footer bar meta setting option. * * @since 3.7.4 * @param bool $display_footer_bar true | false. * @return bool true for enabled | false for disable. */ function astra_deprecated_ast_footer_sml_layout_filter( $display_footer_bar ) { return astra_apply_filters_deprecated( 'ast_footer_sml_layout', array( $display_footer_bar ), '3.7.4', 'astra_footer_sml_layout', '' ); } // Deprecating primary_submenu_border_class filter. add_filter( 'astra_primary_submenu_border_class', 'astra_deprecated_primary_submenu_border_class_filter', 10, 1 ); /** * Border class to primary submenu * * @since 3.7.4 * @param string $class_selector custom class assigned to primary submenu. * @return string $class_selector updated class selector. */ function astra_deprecated_primary_submenu_border_class_filter( $class_selector ) { return astra_apply_filters_deprecated( 'primary_submenu_border_class', array( $class_selector ), '3.7.4', 'astra_primary_submenu_border_class', '' ); } // Deprecating astra_single_banner_post_meta filter. add_filter( 'astra_single_post_meta', 'astra_deprecated_astra_single_banner_post_meta_filter', 10, 1 ); /** * Single meta markup filter. * * @since 4.0.2 * @param string $meta_markup Markup of meta. * @return string $meta_markup Markup of meta. */ function astra_deprecated_astra_single_banner_post_meta_filter( $meta_markup ) { return astra_apply_filters_deprecated( 'astra_single_banner_post_meta', array( $meta_markup ), '4.0.2', 'astra_single_post_meta', '' ); } // Deprecating astra_get_option_dynamic-blog-layouts filter. add_filter( 'astra_get_option_dynamic_blog_layouts', 'astra_deprecated_astra_get_option_dynamic_blog_layouts_filter', 10, 1 ); /** * Don't apply direct new layouts to legacy users. * * @since 4.1.0 * @param string $dynamic_blog_layout false if it is an existing user , true if not. * @return bool $dynamic_blog_layout false if it is an existing user , true if not. */ function astra_deprecated_astra_get_option_dynamic_blog_layouts_filter( $dynamic_blog_layout ) { return astra_apply_filters_deprecated( 'astra_get_option_dynamic-blog-layouts', array( $dynamic_blog_layout ), '4.1.0', 'astra_get_option_dynamic_blog_layouts', '' ); } deprecated/deprecated-hooks.php000064400000007140152266256010012605 0ustar00= 4.6 */ do_action_deprecated( $tag, $args, $version, $replacement, $message ); } else { do_action_ref_array( $tag, $args ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound } } } // Depreciating asta_register_admin_menu hook. add_action( 'astra_register_admin_menu', 'astra_deprecated_asta_register_admin_menu_hook', 10, 5 ); /** * Depreciating 'asta_register_admin_menu' action & replacing with 'astra_register_admin_menu'. * * @param string $parent_page Admin menu page. * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. * @param string $capability The capability required for this menu to be displayed to the user. * @param string $page_menu_slug The slug name to refer to this menu by (should be unique for this menu). * @param callable $page_menu_func The function to be called to output the content for this page. * * @since 3.7.4 */ function astra_deprecated_asta_register_admin_menu_hook( $parent_page, $page_title, $capability, $page_menu_slug, $page_menu_func ) { astra_do_action_deprecated( 'asta_register_admin_menu', array( $parent_page, $page_title, $capability, $page_menu_slug, $page_menu_func ), '3.7.4', 'astra_register_admin_menu' ); } /** * Actions which are deprecated in admin redesign phase. * * @since 4.0.0 */ function astra_show_deprecated_admin_hooks_warnings() { global $pagenow; $screen = get_current_screen(); if ( 'admin.php' === $pagenow && is_object( $screen ) && 'toplevel_page_' . Astra_Menu::get_theme_page_slug() === $screen->id ) { astra_do_action_deprecated( 'astra_welcome_page_content_before', array(), '4.0.0' ); astra_do_action_deprecated( 'astra_welcome_page_content', array(), '4.0.0' ); astra_do_action_deprecated( 'astra_welcome_page_content_after', array(), '4.0.0' ); astra_do_action_deprecated( 'astra_welcome_page_right_sidebar_before', array(), '4.0.0' ); astra_do_action_deprecated( 'astra_welcome_page_right_sidebar_content', array(), '4.0.0' ); astra_do_action_deprecated( 'astra_welcome_page_right_sidebar_after', array(), '4.0.0' ); astra_do_action_deprecated( 'astra_single_post_order_before', array(), '4.0.0' ); astra_do_action_deprecated( 'astra_single_post_title_before', array(), '4.0.0' ); astra_do_action_deprecated( 'astra_single_post_title_after', array(), '4.0.0' ); astra_do_action_deprecated( 'astra_single_post_meta_before', array(), '4.0.0' ); astra_do_action_deprecated( 'astra_single_post_meta_after', array(), '4.0.0' ); astra_do_action_deprecated( 'astra_single_post_order_after', array(), '4.0.0' ); } } // Depreciating legacy admin hooks. add_action( 'admin_notices', 'astra_show_deprecated_admin_hooks_warnings', 999 ); deprecated/deprecated-functions.php000064400000015304152266256010013473 0ustar00 '4.1.0', '4.0.2' => '4.0.0', '3.9.4' => '3.9.2', '3.9.1' => '3.9.0', '3.8.5' => '3.6.11', '3.8.4' => '3.6.10', '3.8.2' => '3.6.3', '3.7.4' => '3.6.2', '3.7.3' => '3.6.0', '3.6.9' => '3.5.8', '3.6.7' => '3.5.5', '3.6.4' => '3.5.0', '3.4.8' => '3.4.2', '3.4.2' => '3.4.0', '3.3.3' => '3.3.2', '3.3.2' => '3.3.1', '3.3.1' => '3.3.0', '3.2.0' => '3.1.0', '3.0.3' => '3.0.0', ); /** * Constructor */ public function __construct() { if ( ! is_admin() ) { return; } self::get_starter_templates_slug(); add_action( 'after_setup_theme', self::class . '::init_admin_settings', 99 ); } /** * Admin settings init */ public static function init_admin_settings() { add_action( 'admin_enqueue_scripts', self::class . '::register_scripts' ); add_action( 'customize_controls_enqueue_scripts', self::class . '::customizer_scripts' ); add_action( 'astra_notice_before_markup_astra-sites-on-active', self::class . '::load_astra_admin_script' ); add_action( 'admin_init', self::class . '::register_notices' ); add_action( 'astra_notice_before_markup', self::class . '::notice_assets' ); add_action( 'admin_init', self::class . '::minimum_addon_version_notice' ); add_action( 'admin_init', self::class . '::minimum_addon_supported_version_notice' ); if ( astra_showcase_upgrade_notices() ) { add_action( 'admin_init', self::class . '::upgrade_to_pro_wc_notice' ); add_action( 'wp_nav_menu_item_custom_fields', self::class . '::add_custom_fields', 10, 4 ); } } /** * Get the Astra onboarding link * if the Starter Templates plugin version is >= 4.4.36. * * @return string Onboarding link URL if condition matches, otherwise empty string. */ public static function get_astra_onboarding_link() { // Load plugin.php functions if not already available. if ( ! function_exists( 'get_plugins' ) ) { if ( ! defined( 'ABSPATH' ) ) { return ''; } require_once ABSPATH . '/wp-admin/includes/plugin.php'; } $onboarding_link = admin_url( 'admin.php?page=astra-onboarding' ); $st_version = ''; $all_plugins = get_plugins(); // First check Premium Starter Templates. if ( isset( $all_plugins['astra-pro-sites/astra-pro-sites.php'] ) ) { $st_version = isset( $all_plugins['astra-pro-sites/astra-pro-sites.php']['Version'] ) ? $all_plugins['astra-pro-sites/astra-pro-sites.php']['Version'] : ''; } // Otherwise check Starter Templates. elseif ( isset( $all_plugins['astra-sites/astra-sites.php'] ) ) { $st_version = isset( $all_plugins['astra-sites/astra-sites.php']['Version'] ) ? $all_plugins['astra-sites/astra-sites.php']['Version'] : ''; } // If version is lower than 4.4.38, return empty. if ( $st_version && version_compare( $st_version, '4.4.38', '<' ) ) { return ''; } return $onboarding_link; } /** * Add custom megamenu fields data to the menu. * * @param int $id menu item id. * @param object $item A single menu item. * @param int $depth menu item depth. * @param array $args menu item arguments. * @return void * * @since 3.9.4 */ public static function add_custom_fields( $id, $item, $depth, $args ) { ?>

admin_url( 'admin-ajax.php' ), 'astraSitesLink' => admin_url( 'themes.php?page=starter-templates' ), 'astraOnboardingLink' => self::get_astra_onboarding_link(), 'recommendedPluiginActivatingText' => __( 'Activating', 'astra' ) . '…', 'recommendedPluiginDeactivatingText' => __( 'Deactivating', 'astra' ) . '…', 'recommendedPluiginActivateText' => __( 'Activate', 'astra' ), 'recommendedPluiginDeactivateText' => __( 'Deactivate', 'astra' ), 'recommendedPluiginSettingsText' => __( 'Settings', 'astra' ), 'astraPluginManagerNonce' => wp_create_nonce( 'astra_plugin_manager_nonce' ), ); wp_localize_script( 'astra-admin-settings', 'astra', apply_filters( 'astra_theme_js_localize', $localize ) ); // Script. wp_enqueue_script( 'astra-admin-settings' ); } /** * Ask Theme Rating * * @since 1.4.0 */ public static function register_notices() { // Return if white labeled. /** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( astra_is_white_labelled() || ! ASTRA_THEME_ORG_VERSION || false === apply_filters( 'astra_showcase_starter_templates_notice', true ) || ! Astra_Menu::is_promoting_starter_templates() ) { /** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort return; } /** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $current_slug = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended /** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort // Force Astra welcome notice on theme activation. if ( current_user_can( 'install_plugins' ) && ! defined( 'ASTRA_SITES_NAME' ) && '1' == get_option( 'fresh_site' ) && ! in_array( $current_slug, array( 'astra-advanced-hook', 'astra_adv_header' ), true ) ) { // Do not display admin welcome banner notice on theme upload page. /** @psalm-suppress InvalidGlobal */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort global $pagenow; /** @psalm-suppress InvalidGlobal */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( isset( $pagenow ) && 'update.php' === $pagenow ) { return; } $image_path = ASTRA_THEME_URI . 'inc/assets/images/astra-banner.png'; $gb_image_path = ASTRA_THEME_URI . 'inc/assets/images/gb-logo.svg'; $ele_image_path = ASTRA_THEME_URI . 'inc/assets/images/ele-logo.svg'; $ai_image_path = ASTRA_THEME_URI . 'inc/assets/images/ai-logo.svg'; $ast_sites_notice_btn = self::astra_sites_notice_button(); $ast_sites_notice_btn['button_text'] = __( 'Start Building Now', 'astra' ); if ( file_exists( WP_PLUGIN_DIR . '/astra-sites/astra-sites.php' ) && is_plugin_inactive( 'astra-sites/astra-sites.php' ) && is_plugin_inactive( 'astra-pro-sites/astra-pro-sites.php' ) ) { $ast_sites_notice_btn['class'] .= ' button button-primary'; } elseif ( ! file_exists( WP_PLUGIN_DIR . '/astra-sites/astra-sites.php' ) && is_plugin_inactive( 'astra-pro-sites/astra-pro-sites.php' ) ) { $ast_sites_notice_btn['class'] .= ' button button-primary'; // Astra Premium Sites - Active. } else { $ast_sites_notice_btn['class'] = ' button button-primary astra-notice-close'; } $astra_sites_notice_args = array( 'id' => 'astra-sites-on-active', 'type' => 'info', 'message' => sprintf( '

%1$s

%2$s

%3$s

%13$s

Starter Templates
%14$s
', __( 'Thank you for choosing Astra!', 'astra' ), __( 'Your Website, Ready in Minutes - Let’s Start!', 'astra' ), __( 'No complicated setup, no waiting - just a smooth, hassle-free way to bring your website to life. Follow a few quick steps, and you’ll be up and running in no time!', 'astra' ), esc_attr( $ast_sites_notice_btn['class'] ), 'href="' . astra_get_prop( $ast_sites_notice_btn, 'link', '' ) . '"', 'data-slug="' . astra_get_prop( $ast_sites_notice_btn, 'data_slug', '' ) . '"', 'data-init="' . astra_get_prop( $ast_sites_notice_btn, 'data_init', '' ) . '"', 'data-settings-link-text="' . astra_get_prop( $ast_sites_notice_btn, 'data_settings_link_text', '' ) . '"', 'data-settings-link="' . astra_get_prop( $ast_sites_notice_btn, 'data_settings_link', '' ) . '"', 'data-activating-text="' . astra_get_prop( $ast_sites_notice_btn, 'activating_text', '' ) . '"', esc_html( $ast_sites_notice_btn['button_text'] ), $image_path, __( 'By clicking "Start Building Now," you agree to install and activate the Starter Templates plugin.', 'astra' ), __( '300+ Templates', 'astra' ), $gb_image_path, $ele_image_path, $ai_image_path ), 'priority' => 5, 'display-with-other-notices' => false, 'show_if' => class_exists( 'Astra_Ext_White_Label_Markup' ) ? Astra_Ext_White_Label_Markup::show_branding() : true, ); Astra_Notices::add_notice( $astra_sites_notice_args ); } } /** * Upgrade to Pro notice for Astra on WooCommerce pages. * * @since 3.9.4 */ public static function upgrade_to_pro_wc_notice() { /** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $current_slug = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended /** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( '' !== $current_slug && function_exists( 'WC' ) && in_array( $current_slug, array( 'wc-admin', 'wc-reports', 'wc-status', 'wc-addons', 'wc-settings' ), true ) ) { $image_path = ASTRA_THEME_URI . 'inc/assets/images/astra-logo.svg'; $astra_sites_notice_args = array( 'id' => 'astra-upgrade-pro-wc', 'type' => 'info', 'message' => sprintf( '

%2$s

%3$s

', $image_path, __( 'Astra Works Seamlessly with WooCommerce!', 'astra' ), __( 'Use every tool at your disposal to optimize your online store for conversion. All the advantages you need to make more profit!', 'astra' ), esc_attr( 'button button-primary' ), 'href="' . astra_get_pro_url( '/pricing/', 'free-theme', 'dashboard', 'woocommerce' ) . '" target="_blank"', __( 'Upgrade Now', 'astra' ) ), 'priority' => 5, 'show_if' => is_admin() ? true : false, 'display-with-other-notices' => false, ); Astra_Notices::add_notice( $astra_sites_notice_args ); } } /** * Display notice for minimun version for Astra addon. * * @since 2.0.0 */ public static function minimum_addon_version_notice() { if ( ! defined( 'ASTRA_EXT_VER' ) ) { return; } if ( version_compare( ASTRA_EXT_VER, ASTRA_EXT_MIN_VER ) < 0 ) { $message = sprintf( /* translators: %1$s: Theme Name, %2$s: Minimum Required version of the addon */ __( 'Please update the %1$s to version %2$s or higher. Ignore if already updated.', 'astra' ), astra_get_addon_name(), ASTRA_EXT_MIN_VER ); $min_version = get_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice-min-ver', true ); if ( ! $min_version ) { update_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice-min-ver', ASTRA_EXT_MIN_VER ); } if ( version_compare( $min_version, ASTRA_EXT_MIN_VER, '!=' ) ) { delete_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice' ); update_user_meta( get_current_user_id(), 'ast-minimum-addon-version-notice-min-ver', ASTRA_EXT_MIN_VER ); } $notice_args = array( 'id' => 'ast-minimum-addon-version-notice', 'type' => 'warning', 'message' => $message, 'show_if' => true, 'repeat-notice-after' => false, 'priority' => 18, 'display-with-other-notices' => true, ); Astra_Notices::add_notice( $notice_args ); } } /** * Get minimum supported version for Astra addon. * This function will be used to inform the user about incompatible version of Astra addon. * * @param string $input_version Input version of the addon. * * @since 4.3.0 */ public static function get_astra_addon_min_supported_version( $input_version ) { if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, ASTRA_EXT_MIN_VER ) < 0 ) { return ASTRA_EXT_MIN_VER; } $supported_version = ''; // First, check if the exact version is supported if ( isset( self::$astra_addon_supported_version_map[ $input_version ] ) ) { $supported_version = self::$astra_addon_supported_version_map[ $input_version ]; } else { foreach ( self::$astra_addon_supported_version_map as $index => $supported ) { /** @psalm-suppress TypeDoesNotContainType */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( '' !== $supported_version || version_compare( $input_version, $index ) > 0 ) { /** @psalm-suppress TypeDoesNotContainType */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $supported_version = $supported; break; } } } return $supported_version; } /** * This constant will be used to inform the user about incompatible version of Astra addon. * * @since 4.3.0 */ public static function minimum_addon_supported_version_notice() { if ( ! defined( 'ASTRA_EXT_VER' ) ) { return; } // ASTRA_EXT_MIN_VER < ASTRA_EXT_VER && ASTRA_EXT_VER < 4.0.0. if ( version_compare( ASTRA_EXT_VER, ASTRA_EXT_MIN_VER ) >= 0 || version_compare( '4.0.0', ASTRA_EXT_VER ) < 0 ) { return; } $astra_addon_supported_version = self::get_astra_addon_min_supported_version( ASTRA_EXT_VER ); $message = sprintf( /* translators: %1$s: Plugin Name, %2$s: Theme name, %3$s: Supported required version of the addon */ 'Your current version of %1$s plugin is incompatible with %2$s theme. Please update to at least version %3$s for optimal functionality.', astra_get_addon_name(), astra_get_theme_name(), $astra_addon_supported_version ); $ext_min_supported_version = get_user_meta( get_current_user_id(), 'ast-addon-supported-version-notice', true ); if ( ! $ext_min_supported_version ) { update_user_meta( get_current_user_id(), 'ast-addon-supported-version-notice', $astra_addon_supported_version ); } if ( version_compare( $ext_min_supported_version, $astra_addon_supported_version, '!=' ) ) { delete_user_meta( get_current_user_id(), 'ast-addon-minimum-supported-version-notice' ); update_user_meta( get_current_user_id(), 'ast-addon-supported-version-notice', $astra_addon_supported_version ); } $notice_args = array( 'id' => 'ast-addon-minimum-supported-version-notice', 'type' => 'warning', 'message' => $message, 'show_if' => true, 'repeat-notice-after' => false, 'priority' => 20, 'display-with-other-notices' => false, ); Astra_Notices::add_notice( $notice_args ); } /** * Enqueue Astra Notices CSS. * * @since 2.0.0 * * @return void */ public static function notice_assets() { if ( is_rtl() ) { wp_enqueue_style( 'astra-custom-notices-rtl', ASTRA_THEME_URI . 'inc/assets/css/astra-notices-rtl.css', array(), ASTRA_THEME_VERSION ); } else { wp_enqueue_style( 'astra-custom-notices', ASTRA_THEME_URI . 'inc/assets/css/astra-notices.css', array(), ASTRA_THEME_VERSION ); } } /** * Render button for Astra Site notices * * @since 1.6.5 * @return array $ast_sites_notice_btn Rendered button */ public static function astra_sites_notice_button() { $ast_sites_notice_btn = array(); // Any of the Starter Templtes plugin - Active. if ( is_plugin_active( 'astra-pro-sites/astra-pro-sites.php' ) || is_plugin_active( 'astra-sites/astra-sites.php' ) ) { $ast_sites_notice_btn['class'] = 'active'; $ast_sites_notice_btn['link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); return $ast_sites_notice_btn; } // Starter Templates PRO Plugin - Installed but Inactive. if ( file_exists( WP_PLUGIN_DIR . '/astra-pro-sites/astra-pro-sites.php' ) && is_plugin_inactive( 'astra-pro-sites/astra-pro-sites.php' ) ) { $ast_sites_notice_btn['class'] = 'astra-activate-recommended-plugin'; $ast_sites_notice_btn['data_slug'] = 'astra-pro-sites'; $ast_sites_notice_btn['data_init'] = '/astra-pro-sites/astra-pro-sites.php'; $ast_sites_notice_btn['data_settings_link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); $ast_sites_notice_btn['data_settings_link_text'] = __( 'See Library »', 'astra' ); $ast_sites_notice_btn['activating_text'] = __( 'Activating Importer Plugin ', 'astra' ) . '…'; return $ast_sites_notice_btn; } // Starter Templates FREE Plugin - Installed but Inactive. if ( file_exists( WP_PLUGIN_DIR . '/astra-sites/astra-sites.php' ) && is_plugin_inactive( 'astra-sites/astra-sites.php' ) ) { $ast_sites_notice_btn['class'] = 'astra-activate-recommended-plugin'; $ast_sites_notice_btn['data_slug'] = 'astra-sites'; $ast_sites_notice_btn['data_init'] = '/astra-sites/astra-sites.php'; $ast_sites_notice_btn['data_settings_link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); $ast_sites_notice_btn['data_settings_link_text'] = __( 'See Library »', 'astra' ); $ast_sites_notice_btn['activating_text'] = __( 'Activating Importer Plugin ', 'astra' ) . '…'; return $ast_sites_notice_btn; } // Any of the Starter Templates plugin not available. if ( ! file_exists( WP_PLUGIN_DIR . '/astra-sites/astra-sites.php' ) || ! file_exists( WP_PLUGIN_DIR . '/astra-pro-sites/astra-pro-sites.php' ) ) { $ast_sites_notice_btn['class'] = 'astra-install-recommended-plugin'; $ast_sites_notice_btn['data_slug'] = 'astra-sites'; $ast_sites_notice_btn['data_init'] = '/astra-sites/astra-sites.php'; $ast_sites_notice_btn['data_settings_link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); $ast_sites_notice_btn['data_settings_link_text'] = __( 'See Library »', 'astra' ); $ast_sites_notice_btn['detail_link_class'] = 'plugin-detail thickbox open-plugin-details-modal astra-starter-sites-detail-link'; $ast_sites_notice_btn['detail_link'] = network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=astra-sites&TB_iframe=true&width=772&height=400' ); $ast_sites_notice_btn['detail_link_text'] = __( 'Details »', 'astra' ); return $ast_sites_notice_btn; } $ast_sites_notice_btn['class'] = 'active'; $ast_sites_notice_btn['link'] = admin_url( 'themes.php?page=' . self::$starter_templates_slug ); return $ast_sites_notice_btn; } /** * Check if installed Starter Sites plugin is new. * * @since 2.3.2 */ public static function get_starter_templates_slug() { if ( defined( 'ASTRA_PRO_SITES_VER' ) && version_compare( ASTRA_PRO_SITES_VER, '2.0.0', '>=' ) ) { self::$starter_templates_slug = 'starter-templates'; } if ( defined( 'ASTRA_SITES_VER' ) && version_compare( ASTRA_SITES_VER, '2.0.0', '>=' ) ) { self::$starter_templates_slug = 'starter-templates'; } } /** * Load the scripts and styles in the customizer controls. * * @since 1.2.1 */ public static function customizer_scripts() { $color_palettes = wp_json_encode( astra_color_palette() ); wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $color_palettes . ';' ); } /** * Register admin scripts. * * @param String $hook Screen name where the hook is fired. * @return void */ public static function register_scripts( $hook ) { if ( in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) { $post_types = get_post_types( array( 'public' => true ) ); $screen = get_current_screen(); $post_type = $screen->id; // Check if block editor is enabled or not. if ( null !== $post_type && is_callable( 'use_block_editor_for_post_type' ) && use_block_editor_for_post_type( $post_type ) && in_array( $post_type, (array) $post_types ) ) { echo ''; /** * Register admin script for missing Layout option from nested Column Blocks inside Group/Cover blocks. * * @see https://github.com/WordPress/gutenberg/issues/33374 & https://gist.github.com/Luehrsen/c4aad3b33435058c19ea80f5f1c268e8 - Remove this once the issue is fixed. * * @since 3.7.9 */ wp_enqueue_script( 'astra-column-block-comp-js', ASTRA_THEME_URI . 'inc/assets/js/column-block-compatibility.js', array( 'wp-util', 'wp-hooks', 'wp-blocks', 'wp-data', 'wp-block-editor' ), ASTRA_THEME_VERSION, false ); } } } /** * Get and return page URL * * @param string $menu_slug Menu name. * @since 1.0 * @return string page url */ public static function get_page_url( $menu_slug ) { $parent_page = 'themes.php'; /** @psalm-suppress InvalidLiteralArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( strpos( $parent_page, '?' ) !== false ) { /** @psalm-suppress InvalidLiteralArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $query_var = '&page=' . Astra_Menu::get_theme_page_slug(); } else { $query_var = '?page=' . Astra_Menu::get_theme_page_slug(); } $parent_page_url = admin_url( $parent_page . $query_var ); $url = $parent_page_url . '&action=' . $menu_slug; return esc_url( $url ); } } new Astra_Admin_Settings(); } class-astra-attr.php000064400000005216152266256010010453 0ustar00astra_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 ); } } } /** * Kicking this off by calling 'get_instance()' method */ Astra_Attr::get_instance(); class-gutenberg-editor-css.php000064400000236623152266256010012435 0ustar00post_type : ''; // Checking if font weight is different in GB editor. if ( 'inherit' === $h1_font_weight ) { $h1_font_weight = 'normal'; } if ( 'inherit' === $h2_font_weight ) { $h2_font_weight = 'normal'; } if ( 'inherit' === $h3_font_weight ) { $h3_font_weight = 'normal'; } if ( 'inherit' === $h4_font_weight ) { $h4_font_weight = 'normal'; } if ( 'inherit' === $h5_font_weight ) { $h5_font_weight = 'normal'; } if ( 'inherit' === $h6_font_weight ) { $h6_font_weight = 'normal'; } $single_post_title = astra_get_option( 'ast-dynamic-single-post-structure', array( 'ast-dynamic-single-post-title', 'ast-dynamic-single-post-meta' ) ); $title_enabled_from_meta = get_post_meta( $post_id, 'site-post-title', true ); $is_widget_title_support_font_weight = Astra_Dynamic_CSS::support_font_css_to_widget_and_in_editor(); $font_weight_prop = $is_widget_title_support_font_weight ? 'inherit' : 'normal'; // Fallback for H1 - headings typography. if ( 'inherit' === $h1_font_family ) { $h1_font_family = $headings_font_family; } if ( $font_weight_prop === $h1_font_weight ) { $h1_font_weight = $headings_font_weight; } if ( '' == $h1_text_transform ) { $h1_text_transform = $headings_text_transform; } if ( '' == $h1_line_height ) { $h1_line_height = $headings_line_height; } // Fallback for H2 - headings typography. if ( 'inherit' === $h2_font_family ) { $h2_font_family = $headings_font_family; } if ( $font_weight_prop === $h2_font_weight ) { $h2_font_weight = $headings_font_weight; } if ( '' == $h2_text_transform ) { $h2_text_transform = $headings_text_transform; } if ( '' == $h2_line_height ) { $h2_line_height = $headings_line_height; } // Fallback for H3 - headings typography. if ( 'inherit' === $h3_font_family ) { $h3_font_family = $headings_font_family; } if ( $font_weight_prop === $h3_font_weight ) { $h3_font_weight = $headings_font_weight; } if ( '' == $h3_text_transform ) { $h3_text_transform = $headings_text_transform; } if ( '' == $h3_line_height ) { $h3_line_height = $headings_line_height; } // Fallback for H4 - headings typography. if ( 'inherit' === $h4_font_family ) { $h4_font_family = $headings_font_family; } if ( $font_weight_prop === $h4_font_weight ) { $h4_font_weight = $headings_font_weight; } if ( '' == $h4_text_transform ) { $h4_text_transform = $headings_text_transform; } if ( '' == $h4_line_height ) { $h4_line_height = $headings_line_height; } // Fallback for H5 - headings typography. if ( 'inherit' === $h5_font_family ) { $h5_font_family = $headings_font_family; } if ( $font_weight_prop === $h5_font_weight ) { $h5_font_weight = $headings_font_weight; } if ( '' == $h5_text_transform ) { $h5_text_transform = $headings_text_transform; } if ( '' == $h5_line_height ) { $h5_line_height = $headings_line_height; } // Fallback for H6 - headings typography. if ( 'inherit' === $h6_font_family ) { $h6_font_family = $headings_font_family; } if ( $font_weight_prop === $h6_font_weight ) { $h6_font_weight = $headings_font_weight; } if ( '' == $h6_text_transform ) { $h6_text_transform = $headings_text_transform; } if ( '' == $h6_line_height ) { $h6_line_height = $headings_line_height; } if ( empty( $btn_color ) ) { $btn_color = astra_get_foreground_color( $theme_color ); } if ( empty( $btn_h_color ) ) { $btn_h_color = astra_get_foreground_color( $link_h_color ); } if ( is_array( $body_font_size ) ) { $body_font_size_desktop = isset( $body_font_size['desktop'] ) && '' != $body_font_size['desktop'] ? $body_font_size['desktop'] : 15; // Convert to appropriate pixels if the unit is 'rem'. $body_font_size_desktop = ! empty( $body_font_size['desktop-unit'] ) && $body_font_size['desktop-unit'] === 'rem' ? $body_font_size_desktop * 16 : $body_font_size_desktop; } else { $body_font_size_desktop = '' != $body_font_size ? $body_font_size : 15; } // Site title (Page Title) on Block Editor. $post_type = astra_get_post_type(); $site_title_font_family = astra_get_option( 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-title-font-family' ); $site_title_font_weight = astra_get_option( 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-title-font-weight' ); $site_title_line_height = astra_get_option( 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-title-line-height' ); $site_title_font_size = astra_get_option( 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-title-font-size' ); $site_title_text_transform = astra_get_option( 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-title-text-transform', $headings_text_transform ); // Fallback for Site title (Page Title). if ( 'inherit' === $site_title_font_family ) { $site_title_font_family = $headings_font_family; } if ( $font_weight_prop === $site_title_font_weight ) { $site_title_font_weight = $headings_font_weight; } if ( '' == $site_title_text_transform ) { $site_title_text_transform = '' === $headings_text_transform ? astra_get_option( 'text-transform-h1' ) : $headings_text_transform; } if ( '' == $site_title_line_height ) { $site_title_line_height = $headings_line_height; } if ( 'inherit' === $site_title_font_weight || '' == $site_title_font_weight ) { $site_title_font_weight = 'normal'; } // check the selection color incase of empty/no theme color. $selection_text_color = 'transparent' === $highlight_theme_color ? '' : $highlight_theme_color; // Gutenberg editor improvement. /** @psalm-suppress InvalidScalarArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $improve_gb_ui = astra_get_option( 'improve-gb-editor-ui', true ); /** @psalm-suppress InvalidScalarArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $ast_content_width = apply_filters( 'astra_block_content_width', '910px' ); $color_palette_reorganize = Astra_Dynamic_CSS::astra_4_8_9_compatibility(); $primary_color = $color_palette_reorganize ? 'var(--ast-global-color-4)' : 'var(--ast-global-color-5)'; $secondary_color = $color_palette_reorganize ? 'var(--ast-global-color-5)' : 'var(--ast-global-color-4)'; $alternate_color = $color_palette_reorganize ? 'var(--ast-global-color-6)' : 'var(--ast-global-color-7)'; $subtle_color = $color_palette_reorganize ? 'var(--ast-global-color-7)' : 'var(--ast-global-color-6)'; $content_width_size = true === $improve_gb_ui ? $ast_content_width : '1200px'; $css = ':root{ --wp--custom--ast-content-width-size: ' . $content_width_size . '; --ast-global-color-primary: ' . $primary_color . '; --ast-global-color-secondary: ' . $secondary_color . '; --ast-global-color-alternate-background: ' . $alternate_color . '; --ast-global-color-subtle-background: ' . $subtle_color . '; }'; $css .= '.ast-narrow-container { --wp--custom--ast-content-width-size: ' . $ast_narrow_width . ' }'; $astra_apply_content_background = astra_apply_content_background_fullwidth_layouts(); $desktop_css = array( 'html' => array( 'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 6.25, '%' ), ), ':root' => Astra_Global_Palette::generate_global_palette_style(), '.block-editor-writing-flow a' => array( 'color' => esc_attr( $link_color ), ), // Global selection CSS. '.block-editor-block-list__layout .block-editor-block-list__block ::selection,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .editor-block-list__block-edit:before' => array( 'background-color' => esc_attr( $theme_color ), ), '.block-editor-block-list__layout .block-editor-block-list__block ::selection,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .editor-block-list__block-edit' => array( 'color' => esc_attr( $selection_text_color ), ), '.ast-separate-container .edit-post-visual-editor, .ast-page-builder-template .edit-post-visual-editor, .ast-plain-container .edit-post-visual-editor, .ast-separate-container #wpwrap #editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $box_bg_obj, 'desktop' ), '.editor-post-title__block .editor-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, .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( 'font-family' => astra_get_css_value( $headings_font_family, 'font' ), 'font-weight' => astra_get_css_value( $headings_font_weight, 'font' ), 'text-transform' => esc_attr( $headings_text_transform ), ), '.edit-post-visual-editor h1, .edit-post-visual-editor h2, .edit-post-visual-editor h3, .edit-post-visual-editor h4, .edit-post-visual-editor h5, .edit-post-visual-editor h6' => array( 'line-height' => esc_attr( $headings_line_height ), ), '.edit-post-visual-editor.editor-styles-wrapper p,.block-editor-block-list__block p, .block-editor-block-list__layout, .editor-post-title' => array( 'font-size' => astra_responsive_font( $body_font_size, 'desktop' ), ), '.edit-post-visual-editor.editor-styles-wrapper p,.block-editor-block-list__block p, .wp-block-latest-posts a,.editor-default-block-appender textarea.editor-default-block-appender__content, .block-editor-block-list__block, .block-editor-block-list__block h1, .block-editor-block-list__block h2, .block-editor-block-list__block h3, .block-editor-block-list__block h4, .block-editor-block-list__block h5, .block-editor-block-list__block h6, .edit-post-visual-editor .editor-styles-wrapper' => array( 'font-family' => astra_get_font_family( $body_font_family ), 'font-weight' => esc_attr( $body_font_weight ), 'font-size' => astra_responsive_font( $body_font_size, 'desktop' ), 'line-height' => esc_attr( $body_line_height ), 'text-transform' => esc_attr( $body_text_transform ), 'margin-bottom' => astra_get_css_value( $para_margin_bottom, 'em' ), ), '.editor-post-title__block .editor-post-title__input' => array( 'font-family' => 'inherit' === $headings_font_family ? astra_get_font_family( $body_font_family ) : astra_get_font_family( $headings_font_family ), 'font-weight' => 'normal', ), '.wp-block-post-content' => array( 'color' => esc_attr( $text_color ), ), /** * Content base heading color. */ '.editor-post-title__block .editor-post-title__input, .wc-block-grid__product-title, .editor-styles-wrapper .block-editor-block-list__block h1, .editor-styles-wrapper .block-editor-block-list__block h2, .editor-styles-wrapper .block-editor-block-list__block h3, .editor-styles-wrapper .block-editor-block-list__block h4, .editor-styles-wrapper .block-editor-block-list__block h5, .editor-styles-wrapper .block-editor-block-list__block h6, .editor-styles-wrapper .wp-block-heading, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6,.editor-styles-wrapper h1.block-editor-block-list__block, .editor-styles-wrapper h2.block-editor-block-list__block, .editor-styles-wrapper h3.block-editor-block-list__block, .editor-styles-wrapper h4.block-editor-block-list__block, .editor-styles-wrapper h5.block-editor-block-list__block, .editor-styles-wrapper h6.block-editor-block-list__block' => 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. '.editor-styles-wrapper .block-editor-block-list__block h1, .wp-block-heading h1, .wp-block-freeform.block-library-rich-text__tinymce h1, .editor-styles-wrapper .wp-block-heading h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1, .editor-styles-wrapper h1.block-editor-block-list__block' => array( 'font-size' => astra_responsive_font( $heading_h1_font_size, 'desktop' ), 'font-family' => astra_get_css_value( $h1_font_family, 'font' ), 'font-weight' => astra_get_css_value( $h1_font_weight, 'font' ), 'line-height' => esc_attr( $h1_line_height ), 'text-transform' => esc_attr( $h1_text_transform ), 'text-decoration' => esc_attr( $h1_text_decoration ), 'letter-spacing' => esc_attr( $h1_letter_spacing ), ), '.editor-styles-wrapper .block-editor-block-list__block h2, .wp-block-heading h2, .wp-block-freeform.block-library-rich-text__tinymce h2, .editor-styles-wrapper .wp-block-heading h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2, .editor-styles-wrapper h2.block-editor-block-list__block' => array( 'font-size' => astra_responsive_font( $heading_h2_font_size, 'desktop' ), 'font-family' => astra_get_css_value( $h2_font_family, 'font' ), 'font-weight' => astra_get_css_value( $h2_font_weight, 'font' ), 'line-height' => esc_attr( $h2_line_height ), 'text-transform' => esc_attr( $h2_text_transform ), 'text-decoration' => esc_attr( $h2_text_decoration ), 'letter-spacing' => esc_attr( $h2_letter_spacing ), ), '.editor-styles-wrapper .block-editor-block-list__block h3, .wp-block-heading h3, .wp-block-freeform.block-library-rich-text__tinymce h3, .editor-styles-wrapper .wp-block-heading h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3, .editor-styles-wrapper h3.block-editor-block-list__block' => array( 'font-size' => astra_responsive_font( $heading_h3_font_size, 'desktop' ), 'font-family' => astra_get_css_value( $h3_font_family, 'font' ), 'font-weight' => astra_get_css_value( $h3_font_weight, 'font' ), 'line-height' => esc_attr( $h3_line_height ), 'text-transform' => esc_attr( $h3_text_transform ), 'text-decoration' => esc_attr( $h3_text_decoration ), 'letter-spacing' => esc_attr( $h3_letter_spacing ), ), '.editor-styles-wrapper .block-editor-block-list__block h4, .wp-block-heading h4, .wp-block-freeform.block-library-rich-text__tinymce h4, .editor-styles-wrapper .wp-block-heading h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4, .editor-styles-wrapper h4.block-editor-block-list__block' => array( 'font-size' => astra_responsive_font( $heading_h4_font_size, 'desktop' ), 'font-family' => astra_get_css_value( $h4_font_family, 'font' ), 'font-weight' => astra_get_css_value( $h4_font_weight, 'font' ), 'line-height' => esc_attr( $h4_line_height ), 'text-transform' => esc_attr( $h4_text_transform ), 'text-decoration' => esc_attr( $h4_text_decoration ), 'letter-spacing' => esc_attr( $h4_letter_spacing ), ), '.editor-styles-wrapper .block-editor-block-list__block h5, .wp-block-heading h5, .wp-block-freeform.block-library-rich-text__tinymce h5, .editor-styles-wrapper .wp-block-heading h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5, .editor-styles-wrapper h5.block-editor-block-list__block' => array( 'font-size' => astra_responsive_font( $heading_h5_font_size, 'desktop' ), 'font-family' => astra_get_css_value( $h5_font_family, 'font' ), 'font-weight' => astra_get_css_value( $h5_font_weight, 'font' ), 'line-height' => esc_attr( $h5_line_height ), 'text-transform' => esc_attr( $h5_text_transform ), 'text-decoration' => esc_attr( $h5_text_decoration ), 'letter-spacing' => esc_attr( $h5_letter_spacing ), ), '.editor-styles-wrapper .block-editor-block-list__block h6, .wp-block-heading h6, .wp-block-freeform.block-library-rich-text__tinymce h6, .editor-styles-wrapper .wp-block-heading h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6, .editor-styles-wrapper h6.block-editor-block-list__block' => array( 'font-size' => astra_responsive_font( $heading_h6_font_size, 'desktop' ), 'font-family' => astra_get_css_value( $h6_font_family, 'font' ), 'font-weight' => astra_get_css_value( $h6_font_weight, 'font' ), 'line-height' => esc_attr( $h6_line_height ), 'text-transform' => esc_attr( $h6_text_transform ), 'text-decoration' => esc_attr( $h6_text_decoration ), 'letter-spacing' => esc_attr( $h6_letter_spacing ), ), /* Seperator block default width */ '.wp-block-separator:not(.is-style-wide):not(.is-style-dots)' => array( 'width' => '100px !important', ), /** * 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-top-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'top', 'desktop' ), 'border-top-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'right', 'desktop' ), 'border-bottom-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'bottom', 'desktop' ), 'border-bottom-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'left', 'desktop' ), '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' ), ), /** * Site title (Page Title) on Block Editor. */ 'body .edit-post-visual-editor__post-title-wrapper > h1:first-of-type' => array( 'font-size' => astra_responsive_font( $site_title_font_size, 'desktop' ), 'font-weight' => astra_get_css_value( $site_title_font_weight, 'font' ), 'font-family' => astra_get_css_value( $site_title_font_family, 'font', $body_font_family ), 'line-height' => esc_attr( $site_title_line_height ), 'text-transform' => esc_attr( $site_title_text_transform ), ), ); // Margin bottom same as applied on frontend. if ( 'post' === $post_type && apply_filters( 'astra_improvise_single_post_design', Astra_Dynamic_CSS::astra_4_6_0_compatibility() ) ) { $desktop_css['.editor-styles-wrapper :where(.is-root-container.block-editor-block-list__layout) > :is(.wp-block-heading, h1, h2, h3, h4, h5, h6)'] = array( 'margin-top' => '1.5em', 'margin-bottom' => 'calc(0.3em + 10px);', ); } else { $desktop_css['.editor-styles-wrapper .is-root-container.block-editor-block-list__layout > :is(.wp-block-heading, [class*="wp-block-spectra"]:where(h1, h2 ,h3 ,h4 ,h5 ,h6))'] = array( 'margin-bottom' => '20px', ); } if ( false === $improve_gb_ui ) { $desktop_css['.editor-post-title__block,.editor-default-block-appender,.block-editor-block-list__block'] = array( 'max-width' => astra_get_css_value( $site_content_width, 'px' ), ); $desktop_css['.block-editor-block-list__block[data-align=wide]'] = array( 'max-width' => astra_get_css_value( $site_content_width + 200, 'px' ), ); } $background_style_data = astra_get_responsive_background_obj( $box_bg_obj, 'desktop' ); if ( empty( $background_style_data ) ) { $background_style_data = array( 'background-color' => '#ffffff', ); } if ( astra_wp_version_compare( '5.7', '>=' ) ) { if ( true === $improve_gb_ui ) { $desktop_css['.editor-styles-wrapper > .block-editor-block-list__layout'] = array( 'width' => '100%', 'margin' => '0 auto', 'padding' => '0', ); $desktop_css['.ast-separate-container .edit-post-visual-editor'] = array( 'padding' => '20px', ); $desktop_css['.edit-post-visual-editor__post-title-wrapper .editor-post-title'] = array( 'margin' => '0', ); } else { $desktop_css['.edit-post-visual-editor'] = array( 'padding' => '20px', 'padding-top' => 'calc(2em + 20px)', ); $desktop_css['.edit-post-visual-editor .editor-styles-wrapper'] = array( 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), 'width' => '100%', 'margin' => '0 auto', 'padding' => '0', ); $desktop_css['.ast-page-builder-template .edit-post-visual-editor .editor-styles-wrapper'] = array( 'max-width' => '100%', ); $desktop_css['.ast-separate-container .edit-post-visual-editor .block-editor-block-list__layout .wp-block[data-align="full"] figure.wp-block-image, .ast-separate-container .edit-post-visual-editor .wp-block[data-align="full"] .wp-block-cover'] = array( 'margin-left' => 'calc(-4.8em - 10px)', 'margin-right' => 'calc(-4.8em - 10px)', ); $desktop_css['.ast-separate-container .editor-post-title'] = array( 'margin-top' => '0', ); } $desktop_css['.ast-page-builder-template .edit-post-visual-editor'] = array( 'padding' => '0', ); $desktop_css['.editor-styles-wrapper .block-editor-writing-flow'] = array( 'height' => '100%', 'padding' => '10px', ); $desktop_css['.ast-page-builder-template .editor-styles-wrapper .block-editor-writing-flow, .ast-plain-container .editor-styles-wrapper .block-editor-writing-flow, #editor .edit-post-visual-editor'] = $background_style_data; } if ( astra_wp_version_compare( '5.8', '>=' ) ) { $desktop_css['.edit-post-visual-editor__content-area > div'] = array( 'background' => 'inherit !important', ); $desktop_css['.wp-block[data-align=left]>*'] = array( 'float' => 'left', ); $desktop_css['.wp-block[data-align=right]>*'] = array( 'float' => 'right', ); $desktop_css['.wp-block[data-align=left], .wp-block[data-align=right]'] = array( 'float' => 'none !important', ); if ( false === $astra_apply_content_background ) { $desktop_css['.ast-page-builder-template .editor-styles-wrapper, .ast-plain-container .editor-styles-wrapper, .ast-narrow-container .editor-styles-wrapper'] = $background_style_data; } } if ( ( ( ! in_array( 'ast-dynamic-single-post-title', $single_post_title ) ) && ( 'post' === get_post_type() ) ) || ( 'disabled' === $title_enabled_from_meta ) ) { $destop_title_css = array( '.editor-post-title__block' => array( 'opacity' => '0.2', ), ); $css .= astra_parse_css( $destop_title_css ); } $content_links_underline = astra_get_option( 'underline-content-links' ); if ( $content_links_underline ) { $desktop_css['.edit-post-visual-editor a'] = array( 'text-decoration' => 'underline', ); $reset_underline_from_anchors = Astra_Dynamic_CSS::unset_builder_elements_underline(); $excluding_anchor_selectors = $reset_underline_from_anchors ? '.edit-post-visual-editor a.uagb-tabs-list, .edit-post-visual-editor .uagb-ifb-cta a, .edit-post-visual-editor a.uagb-marketing-btn__link, .edit-post-visual-editor .uagb-post-grid a, .edit-post-visual-editor .uagb-toc__wrap a, .edit-post-visual-editor .uagb-taxomony-box a, .edit-post-visual-editor .uagb_review_block a' : ''; $desktop_css[ $excluding_anchor_selectors ] = array( 'text-decoration' => 'none', ); } $css .= astra_parse_css( $desktop_css ); /** * Global button CSS - Tablet. */ $css_prod_button_tablet = array( '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), ), ); if ( astra_wp_version_compare( '5.7', '>=' ) ) { $css_prod_button_tablet['.ast-page-builder-template .editor-styles-wrapper .block-editor-writing-flow, .ast-plain-container .editor-styles-wrapper .block-editor-writing-flow'] = astra_get_responsive_background_obj( $box_bg_obj, 'tablet' ); } $css .= astra_parse_css( $css_prod_button_tablet, '', astra_get_tablet_breakpoint() ); /** * Global button CSS - Mobile. */ $css_prod_button_mobile = array( '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), ), ); if ( astra_wp_version_compare( '5.7', '>=' ) ) { $css_prod_button_mobile['.ast-page-builder-template .editor-styles-wrapper .block-editor-writing-flow, .ast-plain-container .editor-styles-wrapper .block-editor-writing-flow'] = astra_get_responsive_background_obj( $box_bg_obj, 'mobile' ); } $css .= astra_parse_css( $css_prod_button_mobile, '', astra_get_mobile_breakpoint() ); $theme_btn_top_border = isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '1px'; $theme_btn_right_border = isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '1px'; $theme_btn_left_border = isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '1px'; $theme_btn_bottom_border = isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '1px'; if ( Astra_Dynamic_CSS::page_builder_button_style_css() ) { $is_support_wp_5_8 = Astra_Dynamic_CSS::is_block_editor_support_enabled(); $search_button_selector = $is_support_wp_5_8 ? ', .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' : ''; $search_button_hover_selector = $is_support_wp_5_8 ? ', .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover, .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:focus' : ''; $file_block_button_selector = true === $improve_gb_ui ? ', .block-editor-writing-flow .wp-block-file .wp-block-file__button' : ''; $file_block_button_hover_selector = true === $improve_gb_ui ? ', .block-editor-writing-flow .wp-block-file .wp-block-file__button:hover, .block-editor-writing-flow .wp-block-file .wp-block-file__button:focus' : ''; $button_desktop_css = array( /** * Gutenberg button compatibility for default styling. */ '.editor-styles-wrapper .wp-block-button .wp-block-button__link' . $search_button_selector . $file_block_button_selector => array( 'border-style' => 'solid', 'border-top-width' => $theme_btn_top_border, 'border-right-width' => $theme_btn_right_border, 'border-left-width' => $theme_btn_left_border, 'border-bottom-width' => $theme_btn_bottom_border, 'color' => esc_attr( $btn_color ), 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), 'background-color' => esc_attr( $btn_bg_color ), 'font-family' => astra_get_font_family( $theme_btn_font_family ), 'font-weight' => esc_attr( $theme_btn_font_weight ), 'line-height' => esc_attr( $theme_btn_line_height ), 'text-transform' => esc_attr( $theme_btn_text_transform ), 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), 'text-decoration' => esc_attr( $theme_btn_text_decoration ), 'font-size' => astra_responsive_font( $theme_btn_font_size, 'desktop' ), 'border-top-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'top', 'desktop' ), 'border-top-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'right', 'desktop' ), 'border-bottom-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'bottom', 'desktop' ), 'border-bottom-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'left', 'desktop' ), 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ), 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ), ), '.wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' . $search_button_hover_selector . $file_block_button_hover_selector => array( 'color' => esc_attr( $btn_h_color ), 'background-color' => esc_attr( $btn_bg_h_color ), 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_h_color ) : esc_attr( $btn_border_h_color ), ), ); if ( true === $improve_gb_ui ) { $button_desktop_css['.block-editor-writing-flow .wp-block-file__content-wrapper'] = array( 'display' => 'flex', 'align-items' => 'center', 'flex-wrap' => 'wrap', 'justify-content' => 'space-between', ); } if ( $is_support_wp_5_8 ) { $button_desktop_css['.wp-block-search .wp-block-search__input, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper'] = array( 'border-color' => '#eaeaea', 'background' => '#fafafa', ); $button_desktop_css['.block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__input'] = array( 'padding' => '15px', ); $button_desktop_css['.wp-block-search__button svg'] = array( 'fill' => 'currentColor', ); } $css .= astra_parse_css( $button_desktop_css ); /** * Global button CSS - Tablet. */ $css_global_button_tablet = array( '.wp-block-button .wp-block-button__link' => array( 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ), 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ), ), ); $css .= astra_parse_css( $css_global_button_tablet, '', astra_get_tablet_breakpoint() ); /** * Global button CSS - Mobile. */ $css_global_button_mobile = array( '.wp-block-button .wp-block-button__link' => array( 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ), 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ), ), ); $css .= astra_parse_css( $css_global_button_mobile, '', astra_get_mobile_breakpoint() ); } if ( Astra_Dynamic_CSS::gutenberg_core_patterns_compat() ) { $link_hover_color = astra_get_option( 'link-h-color' ); $btn_text_hover_color = astra_get_option( 'button-h-color' ); if ( empty( $btn_text_hover_color ) ) { $btn_text_hover_color = astra_get_foreground_color( $link_hover_color ); } /** * When supporting GB button outline patterns in v3.3.0 we have given 2px as default border for GB outline button, where we restrict button border for flat type buttons. * But now while reverting this change there is no need of default border because whatever customizer border will set it should behave accordingly. Although it is empty ('') WP applying 2px as default border for outline buttons. * * @since 3.6.3 */ $default_border_size = '2px'; if ( ! astra_button_default_padding_updated() ) { $default_border_size = ''; } // Outline Gutenberg button compatibility CSS. $theme_btn_top_border = isset( $global_custom_button_border_size['top'] ) && ( '' !== $global_custom_button_border_size['top'] && '0' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : $default_border_size; $theme_btn_right_border = isset( $global_custom_button_border_size['right'] ) && ( '' !== $global_custom_button_border_size['right'] && '0' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : $default_border_size; $theme_btn_left_border = isset( $global_custom_button_border_size['left'] ) && ( '' !== $global_custom_button_border_size['left'] && '0' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : $default_border_size; $theme_btn_bottom_border = isset( $global_custom_button_border_size['bottom'] ) && ( '' !== $global_custom_button_border_size['bottom'] && '0' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : $default_border_size; // Added CSS compatibility support for Gutenberg pattern. $button_patterns_compat_css = array( '.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color), .wp-block-button.wp-block-button__link.is-style-outline:not(.has-text-color)' => array( 'color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), ), '.wp-block-button.is-style-outline .wp-block-button__link:hover, .wp-block-button.is-style-outline .wp-block-button__link:focus' => array( 'color' => esc_attr( $btn_text_hover_color ) . ' !important', ), '.wp-block-button.is-style-outline .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' => array( 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_h_color ) : esc_attr( $btn_border_h_color ), ), ); if ( ! astra_button_default_padding_updated() ) { $button_patterns_compat_css['.wp-block-button .wp-block-button__link'] = array( 'border' => 'none', 'padding' => '15px 30px', ); $button_patterns_compat_css['.wp-block-button.is-style-outline .wp-block-button__link'] = array( 'border-style' => 'solid', 'border-top-width' => esc_attr( $theme_btn_top_border ), 'border-right-width' => esc_attr( $theme_btn_right_border ), 'border-bottom-width' => esc_attr( $theme_btn_bottom_border ), 'border-left-width' => esc_attr( $theme_btn_left_border ), 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', ); } $css .= astra_parse_css( $button_patterns_compat_css ); if ( ! astra_button_default_padding_updated() ) { // Tablet CSS. $button_patterns_tablet_compat_css = array( '.wp-block-button .wp-block-button__link' => array( 'border' => 'none', 'padding' => '15px 30px', ), '.wp-block-button.is-style-outline .wp-block-button__link' => array( 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', ), ); $css .= astra_parse_css( $button_patterns_tablet_compat_css, '', astra_get_tablet_breakpoint() ); // Mobile CSS. $button_patterns_mobile_compat_css = array( '.wp-block-button .wp-block-button__link' => array( 'border' => 'none', 'padding' => '15px 30px', ), '.wp-block-button.is-style-outline .wp-block-button__link' => array( 'padding-top' => 'calc(15px - ' . (int) $theme_btn_top_border . 'px)', 'padding-right' => 'calc(30px - ' . (int) $theme_btn_right_border . 'px)', 'padding-bottom' => 'calc(15px - ' . (int) $theme_btn_bottom_border . 'px)', 'padding-left' => 'calc(30px - ' . (int) $theme_btn_left_border . 'px)', ), ); $css .= astra_parse_css( $button_patterns_mobile_compat_css, '', astra_get_mobile_breakpoint() ); } if ( $is_site_rtl ) { $gb_patterns_min_mobile_css = array( '.editor-styles-wrapper .alignleft' => array( 'margin-left' => '20px', ), '.editor-styles-wrapper .alignright' => array( 'margin-right' => '20px', ), ); } else { $gb_patterns_min_mobile_css = array( '.editor-styles-wrapper .alignleft' => array( 'margin-right' => '20px', ), '.editor-styles-wrapper .alignright' => array( 'margin-left' => '20px', ), ); } if ( ! astra_button_default_padding_updated() ) { $gb_patterns_min_mobile_css['.editor-styles-wrapper p.has-background'] = array( 'padding' => '20px', ); } /* Parse CSS from array() -> min-width: (mobile-breakpoint) px CSS */ $css .= astra_parse_css( $gb_patterns_min_mobile_css ); } if ( Astra_Dynamic_CSS::gutenberg_core_blocks_css_comp() ) { $desktop_screen_gb_css = array( '.wp-block-columns' => array( 'margin-bottom' => 'unset', ), 'figure.size-full' => array( 'margin' => '2rem 0', ), '.wp-block-gallery' => array( 'margin-bottom' => '1.6em', ), '.wp-block-group' => array( 'padding-top' => '4em', 'padding-bottom' => '4em', ), '.wp-block-group__inner-container:last-child, .wp-block-table table' => array( 'margin-bottom' => '0', ), '.blocks-gallery-grid' => array( 'width' => '100%', ), '.wp-block-navigation-link__content' => array( 'padding' => '5px 0', ), '.wp-block-group .wp-block-group .has-text-align-center, .wp-block-group .wp-block-column .has-text-align-center' => array( 'max-width' => '100%', ), '.has-text-align-center' => array( 'margin' => '0 auto', ), ); /* Parse CSS from array() -> Desktop CSS */ $css .= astra_parse_css( $desktop_screen_gb_css ); if ( false === $improve_gb_ui ) { $middle_screen_min_gb_css = array( '.wp-block-cover__inner-container, .alignwide .wp-block-group__inner-container, .alignfull .wp-block-group__inner-container' => array( 'max-width' => '1200px', 'margin' => '0 auto', ), '.wp-block-group.alignnone, .wp-block-group.aligncenter, .wp-block-group.alignleft, .wp-block-group.alignright, .wp-block-group.alignwide, .wp-block-columns.alignwide' => array( 'margin' => '2rem 0 1rem 0', ), ); /* Parse CSS from array() -> min-width: (1200)px CSS */ $css .= astra_parse_css( $middle_screen_min_gb_css, '1200' ); } $middle_screen_max_gb_css = array( '.wp-block-group' => array( 'padding' => '3em', ), '.wp-block-group .wp-block-group' => array( 'padding' => '1.5em', ), '.wp-block-columns, .wp-block-column' => array( 'margin' => '1rem 0', ), ); /* Parse CSS from array() -> max-width: (1200)px CSS */ $css .= astra_parse_css( $middle_screen_max_gb_css, '', '1200' ); $tablet_screen_min_gb_css = array( '.wp-block-columns .wp-block-group' => array( 'padding' => '2em', ), ); /* Parse CSS from array() -> min-width: (tablet-breakpoint)px CSS */ $css .= astra_parse_css( $tablet_screen_min_gb_css, astra_get_tablet_breakpoint() ); $mobile_screen_max_gb_css = array( '.wp-block-media-text .wp-block-media-text__content' => array( 'padding' => '3em 2em', ), '.wp-block-cover-image .wp-block-cover__inner-container, .wp-block-cover .wp-block-cover__inner-container' => array( 'width' => 'unset', ), '.wp-block-cover, .wp-block-cover-image' => array( 'padding' => '2em 0', ), '.wp-block-group, .wp-block-cover' => array( 'padding' => '2em', ), '.wp-block-media-text__media img, .wp-block-media-text__media video' => array( 'width' => 'unset', 'max-width' => '100%', ), '.wp-block-media-text.has-background .wp-block-media-text__content' => array( 'padding' => '1em', ), ); /* Parse CSS from array() -> max-width: (mobile-breakpoint)px CSS */ $css .= astra_parse_css( $mobile_screen_max_gb_css, '', astra_get_mobile_breakpoint() ); } if ( Astra_Dynamic_CSS::gutenberg_core_patterns_compat() ) { // Added CSS compatibility support for Gutenberg Editor's Media & Text block pattern. if ( $is_site_rtl ) { $gb_editor_block_pattern_css = array( '.wp-block-media-text .wp-block-media-text__content .wp-block-group__inner-container' => array( 'padding' => '0 8% 0 0', ), '.ast-separate-container .block-editor-block-list__layout .wp-block[data-align="full"] .wp-block[data-align="center"] > .wp-block-image' => array( 'margin-right' => 'auto', 'margin-left' => 'auto', ), ); } else { $gb_editor_block_pattern_css = array( '.wp-block-media-text .wp-block-media-text__content .wp-block-group__inner-container' => array( 'padding' => '0 0 0 8%', ), '.ast-separate-container .block-editor-block-list__layout .wp-block[data-align="full"] .wp-block[data-align="center"] > .wp-block-image' => array( 'margin-right' => 'auto', 'margin-left' => 'auto', ), ); } if ( false === $improve_gb_ui ) { $gb_editor_block_pattern_css['.block-editor-block-list__layout * .block-editor-block-list__block'] = array( 'padding-left' => '20px', 'padding-right' => '20px', ); } $css .= astra_parse_css( $gb_editor_block_pattern_css ); } /** * Updating core block layouts in editor as well. * * @since 3.7.4 */ if ( true === $improve_gb_ui ) { $gb_editor_core_blocks_ui_css = array( '.editor-styles-wrapper' => array( 'padding' => '0', ), '.block-editor-block-list__layout > .wp-block-cover, .block-editor-block-list__layout > .wp-block-group, .block-editor-block-list__layout > .wp-block-columns, .block-editor-block-list__layout > .wp-block-media-text' => array( 'max-width' => '910px', 'margin' => '0 auto', ), '.ast-page-builder-template .block-editor-block-list__layout.is-root-container > .wp-block:not(.wp-block-cover):not(.wp-block-group):not(.wp-block-columns):not(.wp-block-media-text):not([data-align=wide]):not([data-align=full]):not([data-align=left]):not([data-align=right]), .editor-styles-wrapper .wp-block.editor-post-title__block' => array( 'max-width' => '100%', ), '.edit-post-visual-editor .editor-post-title__input, p.wp-block-paragraph, .wp-block[data-align="wide"]' => array( 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), ), '.block-editor-block-list__layout > .wp-block-group, .block-editor-block-list__layout > .wp-block-cover, .wp-block[data-align=center] .wp-block-cover, .wp-block[data-align=center] .wp-block-group, .edit-post-visual-editor .editor-post-title__input' => array( 'margin' => '0 auto', ), '.block-editor-block-list__layout.is-root-container > .wp-block' => array( 'margin' => '28px auto', ), '.editor-styles-wrapper .block-editor-block-list__layout .wp-block [class*="__inner-container"] > .wp-block:not([data-align=wide]):not([data-align=full]):not([data-align=left]):not([data-align=right]):not(p.wp-block-paragraph)' => array( 'max-width' => '50rem', 'width' => '100%', ), '.block-editor-block-list__layout .wp-block-group, .block-editor-block-list__layout .wp-block-cover, .block-editor-block-list__layout .wp-block-columns.has-background' => array( 'padding' => '4em', ), '.block-editor-block-list__layout.is-root-container > .wp-block[data-align="wide"] > .wp-block-group, .block-editor-block-list__layout.is-root-container > .wp-block[data-align="full"] > .wp-block-group, .block-editor-block-list__layout.is-root-container > .wp-block[data-align="wide"] > .wp-block-cover, .block-editor-block-list__layout.is-root-container > .wp-block[data-align="full"] > .wp-block-cover, .block-editor-block-list__layout.is-root-container > .wp-block[data-align="wide"] > .wp-block-columns, .block-editor-block-list__layout.is-root-container > .wp-block[data-align="full"] > .wp-block-columns' => array( 'padding' => '6em 4em', ), '.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > .wp-block[data-align=full]' => array( 'margin-left' => '0', 'margin-right' => '0', ), '.ast-separate-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > .wp-block[data-align=full]' => array( 'margin-left' => '-20px', 'margin-right' => '-20px', ), '.editor-styles-wrapper .block-editor-default-block-appender__content' => array( 'margin-bottom' => '0', ), '.wp-block .wp-block:not(.wp-block-paragraph)' => array( 'margin-top' => '0', 'margin-bottom' => '0', ), '.block-editor-block-list__layout > .wp-block[data-align="wide"] .wp-block-group:not(.has-background), .block-editor-block-list__layout > .wp-block[data-align="full"] .wp-block-group:not(.has-background), .wp-block-group:not(.has-background)' => array( 'padding' => '2em', ), '.wp-block[data-align="left"] figure figcaption, .wp-block[data-align="right"] figure figcaption, .wp-block[data-align="center"] figure figcaption' => array( 'padding-left' => '20px', 'padding-right' => '20px', ), '.wp-block[data-align="right"] figure figcaption' => array( 'text-align' => 'right', ), '.wp-block-cover .wp-block-cover__inner-container .wp-block-heading' => array( 'color' => '#ffffff', ), ); $css .= astra_parse_css( $gb_editor_core_blocks_ui_css ); } else { $block_editor_padding_css = '.edit-post-visual-editor .block-editor-block-list__layout .block-editor-block-list__layout { padding: 0; } .editor-post-title__block { max-width: 1256px; }'; $css .= Astra_Enqueue_Scripts::trim_css( $block_editor_padding_css ); } $tablet_css = array( // 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( // Heading H1 - H6 font size. '.edit-post-visual-editor h1, .wp-block-heading h1, .wp-block-freeform.block-library-rich-text__tinymce h1, .edit-post-visual-editor .wp-block-heading h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1' => array( 'font-size' => astra_responsive_font( $heading_h1_font_size, 'mobile', 30 ), ), '.edit-post-visual-editor h2, .wp-block-heading h2, .wp-block-freeform.block-library-rich-text__tinymce h2, .edit-post-visual-editor .wp-block-heading h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2' => array( 'font-size' => astra_responsive_font( $heading_h2_font_size, 'mobile', 25 ), ), '.edit-post-visual-editor h3, .wp-block-heading h3, .wp-block-freeform.block-library-rich-text__tinymce h3, .edit-post-visual-editor .wp-block-heading h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3' => array( 'font-size' => astra_responsive_font( $heading_h3_font_size, 'mobile', 20 ), ), '.edit-post-visual-editor h4, .wp-block-heading h4, .wp-block-freeform.block-library-rich-text__tinymce h4, .edit-post-visual-editor .wp-block-heading h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4' => array( 'font-size' => astra_responsive_font( $heading_h4_font_size, 'mobile' ), ), '.edit-post-visual-editor h5, .wp-block-heading h5, .wp-block-freeform.block-library-rich-text__tinymce h5, .edit-post-visual-editor .wp-block-heading h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5' => array( 'font-size' => astra_responsive_font( $heading_h5_font_size, 'mobile' ), ), '.edit-post-visual-editor h6, .wp-block-heading h6, .wp-block-freeform.block-library-rich-text__tinymce h6, .edit-post-visual-editor .wp-block-heading h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6' => array( 'font-size' => astra_responsive_font( $heading_h6_font_size, 'mobile' ), ), '.ast-separate-container .edit-post-visual-editor, .ast-page-builder-template .edit-post-visual-editor, .ast-plain-container .edit-post-visual-editor, .ast-separate-container #wpwrap #editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $box_bg_obj, 'mobile' ), ); $css .= astra_parse_css( $mobile_css, '', astra_get_mobile_breakpoint() ); if ( is_callable( 'Astra_Woocommerce::astra_global_btn_woo_comp' ) && Astra_Woocommerce::astra_global_btn_woo_comp() ) { $woo_global_button_css = array( '.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array( 'border-top-width' => isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '0', 'border-right-width' => isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '0', 'border-left-width' => isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '0', 'border-bottom-width' => isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '0', 'border-color' => $btn_border_color ? $btn_border_color : $btn_bg_color, ), '.wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array( 'border-color' => $btn_bg_h_color, ), ); $css .= astra_parse_css( $woo_global_button_css ); } if ( astra_wp_version_compare( '5.4.99', '>=' ) ) { $page_builder_css = array( '.ast-page-builder-template .editor-post-title__block, .ast-page-builder-template .editor-default-block-appender' => array( 'width' => '100%', 'max-width' => '100%', ), '.ast-page-builder-template .wp-block[data-align="right"] > *' => array( 'max-width' => 'unset', 'width' => 'unset', ), '.ast-page-builder-template .block-editor-block-list__layout' => array( 'padding-left' => 0, 'padding-right' => 0, ), '.ast-page-builder-template .editor-block-list__block-edit' => array( 'padding-left' => '20px', 'padding-right' => '20px', ), '.ast-page-builder-template .editor-block-list__block-edit .editor-block-list__block-edit' => array( 'padding-left' => '0', 'padding-right' => '0', ), ); } else { $page_builder_css = array( '.ast-page-builder-template .editor-post-title__block, .ast-page-builder-template .editor-default-block-appender, .ast-page-builder-template .block-editor-block-list__block' => array( 'width' => '100%', 'max-width' => '100%', ), '.ast-page-builder-template .block-editor-block-list__layout' => array( 'padding-left' => 0, 'padding-right' => 0, ), '.ast-page-builder-template .editor-block-list__block-edit' => array( 'padding-left' => '20px', 'padding-right' => '20px', ), '.ast-page-builder-template .editor-block-list__block-edit .editor-block-list__block-edit' => array( 'padding-left' => '0', 'padding-right' => '0', ), ); } $css .= astra_parse_css( $page_builder_css ); $aligned_full_content_css = array( '.ast-page-builder-template .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit, .ast-plain-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit' => array( 'margin-left' => '0', 'margin-right' => '0', ), '.ast-page-builder-template .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"], .ast-plain-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"]' => array( 'margin-left' => '0', 'margin-right' => '0', ), ); $css .= astra_parse_css( $aligned_full_content_css ); $boxed_container = array( '.ast-separate-container .block-editor-writing-flow' => array( 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), 'margin' => '0 auto', 'background-color' => '#fff', ), '.ast-separate-container .gutenberg__editor, .ast-two-container .gutenberg__editor' => array( 'background-color' => '#f5f5f5', ), '.ast-separate-container .block-editor-block-list__layout, .ast-two-container .editor-block-list__layout' => array( 'padding-top' => '0', ), '.ast-two-container .editor-post-title, .ast-separate-container .block-editor-block-list__layout, .ast-two-container .editor-post-title' => array( 'padding-top' => 'calc( 5.34em - 19px)', 'padding-bottom' => '5.34em', 'padding-left' => 'calc( 6.67em - 28px )', 'padding-right' => 'calc( 6.67em - 28px )', ), '.ast-separate-container .block-editor-block-list__layout' => array( 'padding-top' => '0', 'padding-bottom' => '5.34em', 'padding-left' => 'calc( 6.67em - 28px )', 'padding-right' => 'calc( 6.67em - 28px )', ), '.ast-separate-container .editor-post-title' => array( 'padding-top' => '62px', 'padding-bottom' => '5.34em', 'padding-left' => '72px', 'padding-right' => '72px', ), '.ast-separate-container .editor-post-title, .ast-two-container .editor-post-title' => array( 'padding-bottom' => '0', ), '.ast-separate-container .editor-block-list__block, .ast-two-container .editor-block-list__block' => array( 'max-width' => 'calc(' . astra_get_css_value( $site_content_width, 'px' ) . ' - 6.67em)', ), '.ast-separate-container .editor-block-list__block[data-align=wide], .ast-two-container .editor-block-list__block[data-align=wide]' => array( 'margin-left' => '-20px', 'margin-right' => '-20px', ), '.ast-separate-container .editor-block-list__block[data-align=full], .ast-two-container .editor-block-list__block[data-align=full]' => array( 'margin-left' => '-6.67em', 'margin-right' => '-6.67em', ), '.ast-separate-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"], .ast-separate-container .block-editor-block-list__layout .editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit, .ast-two-container .block-editor-block-list__layout .editor-block-list__block[data-align="full"], .ast-two-container .block-editor-block-list__layout .editor-block-list__block[data-align="full"] > .block-editor-block-list__block-edit' => array( 'margin-left' => '0', 'margin-right' => '0', ), ); if ( true === $improve_gb_ui ) { $boxed_editor_content_area = '.ast-separate-container .block-editor-block-list__layout.is-root-container, .ast-max-width-layout.ast-plain-container .edit-post-visual-editor .block-editor-block-list__layout.is-root-container, .ast-separate-container .editor-post-title, .ast-two-container .editor-post-title'; $boxed_container = array(); } $boxed_container_tablet = array(); $boxed_container_mobile = array(); if ( astra_has_gcp_typo_preset_compatibility() ) { $boxed_editor_content_area = '.ast-separate-container .block-editor-writing-flow, .ast-max-width-layout.ast-plain-container .edit-post-visual-editor .block-editor-writing-flow'; $content_bg_obj = astra_get_option( 'content-bg-obj-responsive' ); $boxed_container_mobile = array(); $boxed_container_tablet = array(); $selector_for_content_background = true === $astra_apply_content_background ? '.edit-post-visual-editor .editor-styles-wrapper' : $boxed_editor_content_area; $boxed_container[ $selector_for_content_background ] = astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ); $boxed_container_tablet[ $selector_for_content_background ] = astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ); $boxed_container_mobile[ $selector_for_content_background ] = astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css .= astra_parse_css( $boxed_container_tablet, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css .= astra_parse_css( $boxed_container_mobile, '', astra_get_mobile_breakpoint() ); } $css .= astra_parse_css( $boxed_container ); // Manage the extra padding applied in the block inster preview of blocks. $block_inserter_css = array( '.ast-separate-container .block-editor-inserter__preview .block-editor-block-list__layout' => array( 'padding-top' => '0px', 'padding-bottom' => '0px', 'padding-left' => '0px', 'padding-right' => '0px', ), ); $css .= astra_parse_css( $block_inserter_css ); // WP 5.5 compatibility fix the extra padding applied for the block patterns in the editor view. if ( astra_wp_version_compare( '5.4.99', '>=' ) ) { $block_pattern_css = array( '.ast-separate-container .block-editor-inserter__panel-content .block-editor-block-list__layout' => array( 'padding-top' => '0px', 'padding-bottom' => '0px', 'padding-left' => '0px', 'padding-right' => '0px', ), '.block-editor-inserter__panel-content .block-editor-block-list__layout' => array( 'margin-left' => '60px', 'margin-right' => '60px', ), '.block-editor-inserter__panel-content .block-editor-block-list__layout .block-editor-block-list__layout' => array( 'margin-left' => '0px', 'margin-right' => '0px', ), '.ast-page-builder-template .block-editor-inserter__panel-content .block-editor-block-list__layout' => array( 'margin-left' => '0px', 'margin-right' => '0px', ), ); $css .= astra_parse_css( $block_pattern_css ); } else { $full_width_streched_css = array( '.ast-page-builder-template .block-editor-block-list__layout' => array( 'margin-left' => '60px', 'margin-right' => '60px', ), '.ast-page-builder-template .block-editor-block-list__layout .block-editor-block-list__layout' => array( 'margin-left' => '0px', 'margin-right' => '0px', ), ); $css .= astra_parse_css( $full_width_streched_css ); } $ast_gtn_mobile_css = array( '.ast-separate-container .editor-post-title' => array( 'padding-top' => '19px', 'padding-left' => '28px', 'padding-right' => '28px', ), '.ast-separate-container .block-editor-block-list__layout' => array( 'padding-bottom' => '2.34em', 'padding-left' => 'calc( 3.67em - 28px )', 'padding-right' => 'calc( 3.67em - 28px )', ), '.ast-page-builder-template .block-editor-block-list__layout' => array( 'margin-left' => '30px', 'margin-right' => '30px', ), '.ast-plain-container .block-editor-block-list__layout' => array( 'padding-left' => '30px', 'padding-right' => '30px', ), ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css .= astra_parse_css( $ast_gtn_mobile_css, '', astra_get_mobile_breakpoint() ); if ( astra_wp_version_compare( '5.4.99', '>=' ) ) { $gtn_full_wide_image_css = array( '.wp-block[data-align="left"], .wp-block[data-align="right"]' => array( 'max-width' => '100%', 'width' => '100%', ), ); if ( ! astra_wp_version_compare( '5.8', '>=' ) ) { $gtn_full_wide_image_css['.ast-separate-container .block-editor-block-list__layout .wp-block[data-align="full"] figure.wp-block-image'] = array( 'margin-left' => '-4.8em', 'margin-right' => '-4.81em', 'max-width' => 'unset', 'width' => 'unset', ); } if ( false === $improve_gb_ui ) { $gtn_full_wide_image_css['.ast-plain-container .wp-block[data-align="left"], .ast-plain-container .wp-block[data-align="right"], .ast-plain-container .wp-block[data-align="center"], .ast-plain-container .wp-block[data-align="full"]'] = array( 'max-width' => astra_get_css_value( $site_content_width, 'px' ), ); $gtn_full_wide_image_css['.wp-block[data-align="center"]'] = array( 'max-width' => '100%', 'width' => '100%', ); $gtn_full_wide_image_css['.ast-separate-container .wp-block[data-align="full"] .wp-block-cover'] = array( 'margin-left' => '-4.8em', 'margin-right' => '-4.81em', 'max-width' => 'unset', 'width' => 'unset', ); $gtn_full_wide_image_css['.ast-plain-container .wp-block[data-align="wide"]'] = array( 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), ); $gtn_full_wide_image_css['.ast-separate-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > .wp-block[data-align="full"], .ast-plain-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > .wp-block[data-align="full"]'] = array( 'margin-left' => 'auto', 'margin-right' => 'auto', ); } } else { $gtn_full_wide_image_css = array( '.ast-separate-container .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] figure.wp-block-image' => array( 'margin-left' => '-4.8em', 'margin-right' => '-4.81em', 'max-width' => 'unset', 'width' => 'unset', ), '.ast-separate-container .block-editor-block-list__block[data-align="full"] .wp-block-cover' => array( 'margin-left' => '-4.8em', 'margin-right' => '-4.81em', 'max-width' => 'unset', 'width' => 'unset', ), ); } $css .= astra_parse_css( $gtn_full_wide_image_css ); if ( true === $improve_gb_ui ) { $compatibility_css = ' .wp-block-cover__inner-container .wp-block { color: #ffffff; } .edit-post-visual-editor blockquote { padding: 0 1.2em 1.2em; } .editor-styles-wrapper .wp-block-pullquote blockquote::before { content: "\201D"; font-family: "Helvetica",sans-serif; display: flex; transform: rotate( 180deg ); font-size: 6rem; font-style: normal; line-height: 1; font-weight: bold; align-items: center; justify-content: center; } .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color blockquote { max-width: 100%; text-align: inherit; } ul.wp-block-categories__list, ul.wp-block-archives-list { list-style-type: none; }'; if ( $is_site_rtl ) { $compatibility_css .= ' .edit-post-visual-editor ul, .edit-post-visual-editor ol { margin-right: 20px; }'; } else { $compatibility_css .= ' .edit-post-visual-editor ul, .edit-post-visual-editor ol { margin-left: 20px; }'; } } else { $compatibility_css = ' .edit-post-visual-editor blockquote { padding: 1.2em; } '; } $css .= Astra_Enqueue_Scripts::trim_css( $compatibility_css ); if ( false === $improve_gb_ui && in_array( $pagenow, array( 'post-new.php' ) ) && ! isset( $post ) ) { $boxed_container = array( '.block-editor-writing-flow' => array( 'max-width' => astra_get_css_value( $site_content_width - 56, 'px' ), 'margin' => '0 auto', 'background-color' => '#fff', ), '.gutenberg__editor' => array( 'background-color' => '#f5f5f5', ), '.block-editor-block-list__layout, .editor-post-title' => array( 'padding-top' => 'calc( 5.34em - 19px)', 'padding-bottom' => '5.34em', 'padding-left' => 'calc( 6.67em - 28px )', 'padding-right' => 'calc( 6.67em - 28px )', ), '.block-editor-block-list__layout' => array( 'padding-top' => '0', ), '.editor-post-title' => array( 'padding-bottom' => '0', ), '.block-editor-block-list__block' => array( 'max-width' => 'calc(' . astra_get_css_value( $site_content_width, 'px' ) . ' - 6.67em)', ), '.block-editor-block-list__block[data-align=wide]' => array( 'margin-left' => '-20px', 'margin-right' => '-20px', ), '.block-editor-block-list__block[data-align=full]' => array( 'margin-left' => '-6.67em', 'margin-right' => '-6.67em', ), '.block-editor-block-list__layout .block-editor-block-list__block[data-align="full"], .block-editor-block-list__layout .block-editor-block-list__block[data-align="full"] > .editor-block-list__block-edit' => array( 'margin-left' => '0', 'margin-right' => '0', ), ); $css .= astra_parse_css( $boxed_container ); } /* Narrow Width Container CSS */ $narrow_container = array( // Visibility icon alignment. '.ast-narrow-container .edit-post-visual-editor__post-title-wrapper, .ast-stacked-title-visibility .edit-post-visual-editor__post-title-wrapper' => array( 'max-width' => 'var(--wp--custom--ast-content-width-size)', 'padding' => 0, ), ); return $css . astra_parse_css( $narrow_container ); } } } class-astra-wp-editor-css.php000064400000201472152266256010012203 0ustar00 array( 'top' => $desktop_top_block_space, 'right' => $desktop_right_block_space, 'bottom' => $desktop_bottom_block_space, 'left' => $desktop_left_block_space, ), 'tablet' => array( 'top' => $tablet_top_block_space, 'right' => $tablet_right_block_space, 'bottom' => $tablet_bottom_block_space, 'left' => $tablet_left_block_space, ), 'mobile' => array( 'top' => $mobile_top_block_space, 'right' => $mobile_right_block_space, 'bottom' => $mobile_bottom_block_space, 'left' => $mobile_left_block_space, ), ); } /** * Get dynamic CSS required for the block editor to make editing experience similar to how it looks on frontend. * * @return String CSS to be loaded in the editor interface. */ public static function get_css() { $ltr_left = is_rtl() ? 'right' : 'left'; $site_content_width = astra_get_option( 'site-content-width', 1200 ); $headings_font_family = astra_get_option( 'headings-font-family' ); $headings_font_weight = astra_get_option( 'headings-font-weight' ); $headings_text_transform = astra_get_font_extras( astra_get_option( 'headings-font-extras' ), 'text-transform' ); $headings_line_height = astra_get_font_extras( astra_get_option( 'headings-font-extras' ), 'line-height', 'line-height-unit' ); $body_font_family = astra_body_font_family(); $para_margin_bottom = astra_get_option( 'para-margin-bottom', '1.6' ); $theme_color = astra_get_option( 'theme-color' ); $heading_base_color = astra_get_option( 'heading-base-color' ); $highlight_theme_color = astra_get_foreground_color( $theme_color ); $body_font_weight = astra_get_option( 'body-font-weight' ); $body_font_size = astra_get_option( 'font-size-body' ); $body_line_height = astra_get_font_extras( astra_get_option( 'body-font-extras' ), 'line-height', 'line-height-unit' ); $body_text_transform = astra_get_font_extras( astra_get_option( 'body-font-extras' ), 'text-transform' ); $body_letter_spacing = astra_get_font_extras( astra_get_option( 'body-font-extras' ), 'letter-spacing', 'letter-spacing-unit' ); $body_text_decoration = astra_get_font_extras( astra_get_option( 'body-font-extras' ), 'text-decoration' ); $text_color = astra_get_option( 'text-color' ); $heading_h1_font_size = astra_get_option( 'font-size-h1' ); $heading_h2_font_size = astra_get_option( 'font-size-h2' ); $heading_h3_font_size = astra_get_option( 'font-size-h3' ); $heading_h4_font_size = astra_get_option( 'font-size-h4' ); $heading_h5_font_size = astra_get_option( 'font-size-h5' ); $heading_h6_font_size = astra_get_option( 'font-size-h6' ); $link_color = astra_get_option( 'link-color', $theme_color ); $link_h_color = astra_get_option( 'link-h-color' ); /** @psalm-suppress PossiblyNullPropertyFetch */ $post_type = get_current_screen() ? get_current_screen()->post_type : ''; /** * Button theme compatibility. */ $btn_color = astra_get_option( 'button-color' ); $btn_bg_color = astra_get_option( 'button-bg-color', '', $theme_color ); $btn_h_color = astra_get_option( 'button-h-color' ); $btn_bg_h_color = astra_get_option( 'button-bg-h-color', '', $link_h_color ); $btn_border_radius_fields = astra_get_option( 'button-radius-fields' ); $theme_btn_padding = astra_get_option( 'theme-button-padding' ); $btn_border_size = astra_get_option( 'theme-button-border-group-border-size' ); $btn_border_color = astra_get_option( 'theme-button-border-group-border-color' ); $btn_border_h_color = astra_get_option( 'theme-button-border-group-border-h-color' ); $theme_btn_font_family = astra_get_option( 'font-family-button' ); $theme_btn_font_size = astra_get_option( 'font-size-button' ); $theme_btn_font_weight = astra_get_option( 'font-weight-button' ); $theme_btn_text_transform = astra_get_font_extras( astra_get_option( 'font-extras-button' ), 'text-transform' ); $theme_btn_line_height = astra_get_font_extras( astra_get_option( 'font-extras-button' ), 'line-height', 'line-height-unit' ); $theme_btn_letter_spacing = astra_get_font_extras( astra_get_option( 'font-extras-button' ), 'letter-spacing', 'letter-spacing-unit' ); $theme_btn_text_decoration = astra_get_font_extras( astra_get_option( 'font-extras-button' ), 'text-decoration' ); $theme_btn_top_border = isset( $btn_border_size['top'] ) && ( '' !== $btn_border_size['top'] && '0' !== $btn_border_size['top'] ) ? astra_get_css_value( $btn_border_size['top'], 'px' ) : ''; $theme_btn_right_border = isset( $btn_border_size['right'] ) && ( '' !== $btn_border_size['right'] && '0' !== $btn_border_size['right'] ) ? astra_get_css_value( $btn_border_size['right'], 'px' ) : ''; $theme_btn_left_border = isset( $btn_border_size['left'] ) && ( '' !== $btn_border_size['left'] && '0' !== $btn_border_size['left'] ) ? astra_get_css_value( $btn_border_size['left'], 'px' ) : ''; $theme_btn_bottom_border = isset( $btn_border_size['bottom'] ) && ( '' !== $btn_border_size['bottom'] && '0' !== $btn_border_size['bottom'] ) ? astra_get_css_value( $btn_border_size['bottom'], 'px' ) : ''; /** * Headings typography. */ $h1_font_family = astra_get_option( 'font-family-h1' ); $h1_font_weight = astra_get_option( 'font-weight-h1' ); $h1_line_height = astra_get_font_extras( astra_get_option( 'font-extras-h1' ), 'line-height', 'line-height-unit' ); $h1_text_transform = astra_get_font_extras( astra_get_option( 'font-extras-h1' ), 'text-transform' ); $h1_letter_spacing = astra_get_font_extras( astra_get_option( 'font-extras-h1' ), 'letter-spacing', 'letter-spacing-unit' ); $h1_text_decoration = astra_get_font_extras( astra_get_option( 'font-extras-h1' ), 'text-decoration' ); $h2_font_family = astra_get_option( 'font-family-h2' ); $h2_font_weight = astra_get_option( 'font-weight-h2' ); $h2_line_height = astra_get_font_extras( astra_get_option( 'font-extras-h2' ), 'line-height', 'line-height-unit' ); $h2_text_transform = astra_get_font_extras( astra_get_option( 'font-extras-h2' ), 'text-transform' ); $h2_letter_spacing = astra_get_font_extras( astra_get_option( 'font-extras-h2' ), 'letter-spacing', 'letter-spacing-unit' ); $h2_text_decoration = astra_get_font_extras( astra_get_option( 'font-extras-h2' ), 'text-decoration' ); $h3_font_family = astra_get_option( 'font-family-h3' ); $h3_font_weight = astra_get_option( 'font-weight-h3' ); $h3_line_height = astra_get_font_extras( astra_get_option( 'font-extras-h3' ), 'line-height', 'line-height-unit' ); $h3_text_transform = astra_get_font_extras( astra_get_option( 'font-extras-h3' ), 'text-transform' ); $h3_letter_spacing = astra_get_font_extras( astra_get_option( 'font-extras-h3' ), 'letter-spacing', 'letter-spacing-unit' ); $h3_text_decoration = astra_get_font_extras( astra_get_option( 'font-extras-h3' ), 'text-decoration' ); $h4_font_family = astra_get_option( 'font-family-h4' ); $h4_font_weight = astra_get_option( 'font-weight-h4' ); $h4_line_height = astra_get_font_extras( astra_get_option( 'font-extras-h4' ), 'line-height', 'line-height-unit' ); $h4_text_transform = astra_get_font_extras( astra_get_option( 'font-extras-h4' ), 'text-transform' ); $h4_letter_spacing = astra_get_font_extras( astra_get_option( 'font-extras-h4' ), 'letter-spacing', 'letter-spacing-unit' ); $h4_text_decoration = astra_get_font_extras( astra_get_option( 'font-extras-h4' ), 'text-decoration' ); $h5_font_family = astra_get_option( 'font-family-h5' ); $h5_font_weight = astra_get_option( 'font-weight-h5' ); $h5_line_height = astra_get_font_extras( astra_get_option( 'font-extras-h5' ), 'line-height', 'line-height-unit' ); $h5_text_transform = astra_get_font_extras( astra_get_option( 'font-extras-h5' ), 'text-transform' ); $h5_letter_spacing = astra_get_font_extras( astra_get_option( 'font-extras-h5' ), 'letter-spacing', 'letter-spacing-unit' ); $h5_text_decoration = astra_get_font_extras( astra_get_option( 'font-extras-h5' ), 'text-decoration' ); $h6_font_family = astra_get_option( 'font-family-h6' ); $h6_font_weight = astra_get_option( 'font-weight-h6' ); $h6_line_height = astra_get_font_extras( astra_get_option( 'font-extras-h6' ), 'line-height', 'line-height-unit' ); $h6_text_transform = astra_get_font_extras( astra_get_option( 'font-extras-h6' ), 'text-transform' ); $h6_letter_spacing = astra_get_font_extras( astra_get_option( 'font-extras-h6' ), 'letter-spacing', 'letter-spacing-unit' ); $h6_text_decoration = astra_get_font_extras( astra_get_option( 'font-extras-h6' ), 'text-decoration' ); // Fallback for H1 - headings typography. if ( 'inherit' === $h1_font_family ) { $h1_font_family = $headings_font_family; } if ( 'inherit' === $h1_font_weight && 'inherit' === $headings_font_weight ) { $h1_font_weight = 'normal'; } if ( '' == $h1_text_transform ) { $h1_text_transform = $headings_text_transform; } if ( '' == $h1_line_height ) { $h1_line_height = $headings_line_height; } // Fallback for H2 - headings typography. if ( 'inherit' === $h2_font_family ) { $h2_font_family = $headings_font_family; } if ( 'inherit' === $h2_font_weight && 'inherit' === $headings_font_weight ) { $h2_font_weight = 'normal'; } if ( '' == $h2_text_transform ) { $h2_text_transform = $headings_text_transform; } if ( '' == $h2_line_height ) { $h2_line_height = $headings_line_height; } // Fallback for H3 - headings typography. if ( 'inherit' === $h3_font_family ) { $h3_font_family = $headings_font_family; } if ( 'inherit' === $h3_font_weight && 'inherit' === $headings_font_weight ) { $h3_font_weight = 'normal'; } if ( '' == $h3_text_transform ) { $h3_text_transform = $headings_text_transform; } if ( '' == $h3_line_height ) { $h3_line_height = $headings_line_height; } // Fallback for H4 - headings typography. if ( 'inherit' === $h4_font_family ) { $h4_font_family = $headings_font_family; } if ( 'inherit' === $h4_font_weight && 'inherit' === $headings_font_weight ) { $h4_font_weight = 'normal'; } if ( '' == $h4_text_transform ) { $h4_text_transform = $headings_text_transform; } if ( '' == $h4_line_height ) { $h4_line_height = $headings_line_height; } // Fallback for H5 - headings typography. if ( 'inherit' === $h5_font_family ) { $h5_font_family = $headings_font_family; } if ( 'inherit' === $h5_font_weight && 'inherit' === $headings_font_weight ) { $h5_font_weight = 'normal'; } if ( '' == $h5_text_transform ) { $h5_text_transform = $headings_text_transform; } if ( '' == $h5_line_height ) { $h5_line_height = $headings_line_height; } // Fallback for H6 - headings typography. if ( 'inherit' === $h6_font_family ) { $h6_font_family = $headings_font_family; } if ( 'inherit' === $h6_font_weight && 'inherit' === $headings_font_weight ) { $h6_font_weight = 'normal'; } if ( '' == $h6_text_transform ) { $h6_text_transform = $headings_text_transform; } if ( '' == $h6_line_height ) { $h6_line_height = $headings_line_height; } // Fallback for button settings. if ( empty( $btn_color ) ) { $btn_color = astra_get_foreground_color( $theme_color ); } if ( empty( $btn_h_color ) ) { $btn_h_color = astra_get_foreground_color( $link_h_color ); } if ( is_array( $body_font_size ) ) { $body_font_size_desktop = isset( $body_font_size['desktop'] ) && '' != $body_font_size['desktop'] ? $body_font_size['desktop'] : 15; // Convert to appropriate pixels if the unit is 'rem'. $body_font_size_desktop = ! empty( $body_font_size['desktop-unit'] ) && $body_font_size['desktop-unit'] === 'rem' ? $body_font_size_desktop * 16 : $body_font_size_desktop; } else { $body_font_size_desktop = '' != $body_font_size ? $body_font_size : 15; } $site_background = astra_get_option( 'site-layout-outside-bg-obj-responsive' ); $content_background = astra_get_option( 'content-bg-obj-responsive' ); $background_style_data = astra_get_responsive_background_obj( $site_background, 'desktop' ); if ( empty( $background_style_data ) || ( ( empty( $background_style_data['background-color'] ) || ';' === $background_style_data['background-color'] ) && ( empty( $background_style_data['background-image'] ) && 'none;' === $background_style_data['background-image'] ) ) ) { $background_style_data = array( 'background-color' => '#f5f5f5', ); } // Site title (Page Title) on Block Editor. $post_type = strval( get_post_type() ); $site_title_font_family = astra_get_option( 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title-font-family', astra_get_option( 'ast-dynamic-single-' . esc_attr( $post_type ) . '-text-font-family' ) ); $site_title_font_weight = astra_get_option( 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title-font-weight', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-weight' ) ); $site_title_font_size = astra_get_option( 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title-font-size', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-size' ) ); $site_title_font_extras = astra_get_option( 'ast-dynamic-single-' . esc_attr( $post_type ) . '-text-font-extras' ); $site_title_text_transform = astra_get_font_extras( astra_get_option( 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title-font-extras', $site_title_font_extras ), 'text-transform' ); $site_title_spacing = astra_get_font_extras( astra_get_option( 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title-font-extras', $site_title_font_extras ), 'letter-spacing', 'letter-spacing-unit' ); $site_title_decoration = astra_get_font_extras( astra_get_option( 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title-font-extras', $site_title_font_extras ), 'text-decoration' ); $is_widget_title_support_font_weight = Astra_Dynamic_CSS::support_font_css_to_widget_and_in_editor(); $font_weight_prop = $is_widget_title_support_font_weight ? 'inherit' : 'normal'; $btn_preset_style = astra_get_option( 'button-preset-style' ); $border_color = astra_get_option( 'border-color' ); $is_dark_palette = Astra_Global_Palette::is_dark_palette(); // Fallback for Site title (Page Title). if ( 'inherit' === $site_title_font_family ) { $site_title_font_family = $headings_font_family; } if ( $font_weight_prop === $site_title_font_weight ) { $site_title_font_weight = $headings_font_weight; } if ( '' == $site_title_text_transform ) { $site_title_text_transform = '' === $headings_text_transform ? astra_get_option( 'text-transform-h1' ) : $headings_text_transform; } if ( 'inherit' === $site_title_font_weight || '' == $site_title_font_weight ) { $site_title_font_weight = Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-weight' ); } // check the selection color in-case of empty/no theme color. $selection_text_color = 'transparent' === $highlight_theme_color ? '' : $highlight_theme_color; $astra_is_block_editor_v2_ui = astra_get_option( 'wp-blocks-v2-ui', true ); $astra_container_width = $site_content_width . 'px'; $block_appender_width = $astra_is_block_editor_v2_ui ? 'var(--wp--custom--ast-content-width-size)' : 'var(--wp--custom--ast-wide-width-size)'; $astra_wide_particular_selector = $astra_is_block_editor_v2_ui ? '.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .block-list-appender' : '.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > p, .editor-styles-wrapper .block-editor-block-list__layout.is-root-container .block-list-appender'; $blocks_spacings = self::astra_get_block_spacings(); $color_palette_reorganize = Astra_Dynamic_CSS::astra_4_8_9_compatibility(); $desktop_top_spacing = isset( $blocks_spacings['desktop']['top'] ) ? $blocks_spacings['desktop']['top'] : ''; $desktop_right_spacing = isset( $blocks_spacings['desktop']['right'] ) ? $blocks_spacings['desktop']['right'] : ''; $desktop_bottom_spacing = isset( $blocks_spacings['desktop']['bottom'] ) ? $blocks_spacings['desktop']['bottom'] : ''; $desktop_left_spacing = isset( $blocks_spacings['desktop']['left'] ) ? $blocks_spacings['desktop']['left'] : ''; $tablet_top_spacing = isset( $blocks_spacings['tablet']['top'] ) ? $blocks_spacings['tablet']['top'] : ''; $tablet_right_spacing = isset( $blocks_spacings['tablet']['right'] ) ? $blocks_spacings['tablet']['right'] : ''; $tablet_bottom_spacing = isset( $blocks_spacings['tablet']['bottom'] ) ? $blocks_spacings['tablet']['bottom'] : ''; $tablet_left_spacing = isset( $blocks_spacings['tablet']['left'] ) ? $blocks_spacings['tablet']['left'] : ''; $mobile_top_spacing = isset( $blocks_spacings['mobile']['top'] ) ? $blocks_spacings['mobile']['top'] : ''; $mobile_right_spacing = isset( $blocks_spacings['mobile']['right'] ) ? $blocks_spacings['mobile']['right'] : ''; $mobile_bottom_spacing = isset( $blocks_spacings['mobile']['bottom'] ) ? $blocks_spacings['mobile']['bottom'] : ''; $mobile_left_spacing = isset( $blocks_spacings['mobile']['left'] ) ? $blocks_spacings['mobile']['left'] : ''; $ast_content_width = apply_filters( 'astra_block_content_width', $astra_is_block_editor_v2_ui ? $astra_container_width : '910px' ); $ast_wide_width = apply_filters( 'astra_block_wide_width', $astra_is_block_editor_v2_ui ? 'calc(' . esc_attr( $astra_container_width ) . ' + var(--wp--custom--ast-default-block-left-padding) + var(--wp--custom--ast-default-block-right-padding))' : $astra_container_width ); $ast_narrow_width = astra_get_option( 'narrow-container-max-width', apply_filters( 'astra_narrow_container_width', 750 ) ) . 'px'; $primary_color = $color_palette_reorganize ? 'var(--ast-global-color-4)' : 'var(--ast-global-color-5)'; $secondary_color = $color_palette_reorganize ? 'var(--ast-global-color-5)' : 'var(--ast-global-color-4)'; $alternate_color = $color_palette_reorganize ? 'var(--ast-global-color-6)' : 'var(--ast-global-color-7)'; $subtle_color = $color_palette_reorganize ? 'var(--ast-global-color-7)' : 'var(--ast-global-color-6)'; $css = ':root, body .editor-styles-wrapper { --wp--custom--ast-default-block-top-padding: ' . $desktop_top_spacing . '; --wp--custom--ast-default-block-right-padding: ' . $desktop_right_spacing . '; --wp--custom--ast-default-block-bottom-padding: ' . $desktop_bottom_spacing . '; --wp--custom--ast-default-block-left-padding: ' . $desktop_left_spacing . '; --wp--custom--ast-content-width-size: ' . $ast_content_width . '; --wp--custom--ast-wide-width-size: ' . $ast_wide_width . '; --ast-global-color-primary: ' . $primary_color . '; --ast-global-color-secondary: ' . $secondary_color . '; --ast-global-color-alternate-background: ' . $alternate_color . '; --ast-global-color-subtle-background: ' . $subtle_color . '; }'; $css .= '.ast-narrow-container .editor-styles-wrapper { --wp--custom--ast-content-width-size: ' . $ast_narrow_width . '; }'; // Overriding the previous CSS vars in customizer because there is block editor in customizer widget, where if any container block is used in sidebar widgets then as customizer widget editor is already small (left panel) the blocks does not looks good. if ( is_customize_preview() ) { $css = ''; } /** @psalm-suppress InvalidScalarArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $html_font_size = astra_get_font_css_value( (int) $body_font_size_desktop * 6.25, '%' ); /** @psalm-suppress InvalidScalarArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** Primary button styles */ $theme_color = astra_get_option( 'theme-color' ); $btn_border_color = astra_get_option( 'theme-button-border-group-border-color' ); $btn_bg_color = astra_get_option( 'button-bg-color', $theme_color ); $btn_border_color = astra_get_option( 'theme-button-border-group-border-color' ); $btn_border_h_color = astra_get_option( 'theme-button-border-group-border-h-color' ); $link_hover_color = astra_get_option( 'link-h-color' ); $btn_bg_hover_color = astra_get_option( 'button-bg-h-color', $link_hover_color ); // Apply button 4-6 preset styles same as frontend. if ( 'button_04' === $btn_preset_style || 'button_05' === $btn_preset_style || 'button_06' === $btn_preset_style ) { if ( empty( $btn_border_color ) ) { $btn_border_color = $btn_bg_color; } if ( '' === astra_get_option( 'button-bg-color' ) && '' === astra_get_option( 'button-color' ) ) { $btn_color = $theme_color; } elseif ( '' === astra_get_option( 'button-color' ) ) { $btn_color = $btn_bg_color; } $btn_bg_color = 'transparent'; } /** * Apply text hover color depends on link hover color */ $btn_text_hover_color = astra_get_option( 'button-h-color' ); if ( empty( $btn_text_hover_color ) ) { $btn_text_hover_color = astra_get_foreground_color( $link_hover_color ); } $desktop_css = array( ':root' => Astra_Global_Palette::generate_global_palette_style(), 'html' => array( 'font-size' => $html_font_size, ), $astra_wide_particular_selector => array( 'max-width' => esc_attr( $block_appender_width ), 'margin' => '0 auto', ), '.editor-styles-wrapper a' => array( 'color' => esc_attr( $link_color ), ), '.wp-block-post-content' => array( 'color' => esc_attr( $text_color ), ), '.has-text-color .block-editor-block-list__block:not(:is(.wp-block-heading, .wp-block-button))' => array( 'color' => 'inherit', ), '.wp-block-cover:not(.has-text-color.has-link-color) .wp-block-cover__inner-container .block-editor-rich-text__editable.wp-block-paragraph' => array( 'color' => esc_attr( $text_color ), ), // Global selection CSS. '.block-editor-block-list__layout .block-editor-block-list__block ::selection,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .editor-block-list__block-edit:before' => array( 'background-color' => esc_attr( $theme_color ), ), '.block-editor-block-list__layout .block-editor-block-list__block ::selection, .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .editor-block-list__block-edit' => array( 'color' => esc_attr( $selection_text_color ), ), '#editor .edit-post-visual-editor' => $background_style_data, '.editor-styles-wrapper' => astra_get_responsive_background_obj( $content_background, 'desktop' ), '.editor-styles-wrapper, #customize-controls .editor-styles-wrapper' => array( 'font-family' => astra_get_font_family( $body_font_family ), 'font-weight' => esc_attr( $body_font_weight ), 'font-size' => astra_responsive_font( $body_font_size, 'desktop' ), 'line-height' => esc_attr( $body_line_height ), 'text-transform' => esc_attr( $body_text_transform ), 'text-decoration' => esc_attr( $body_text_decoration ), 'letter-spacing' => esc_attr( $body_letter_spacing ), ), '.editor-styles-wrapper h1, .editor-styles-wrapper h2, .editor-styles-wrapper h3, .editor-styles-wrapper h4, .editor-styles-wrapper h5, .editor-styles-wrapper h6' => astra_get_font_array_css( astra_get_option( 'headings-font-family' ), astra_get_option( 'headings-font-weight' ), array(), 'headings-font-extras', $heading_base_color ), ".wp-block-cover:not([class*='background-color']):not(.has-text-color.has-link-color):not(.wp-block-cover__inner-container .wp-block-cover ). block-editor-block-list__block" => astra_get_font_array_css( astra_get_option( 'headings-font-family' ), astra_get_option( 'headings-font-weight' ), array(), 'headings-font-extras', $heading_base_color ), // Headings H1 - H6 typography. '.editor-styles-wrapper 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 ), 'text-decoration' => esc_attr( $h1_text_decoration ), 'letter-spacing' => esc_attr( $h1_letter_spacing ), ), '.editor-styles-wrapper 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 ), 'text-decoration' => esc_attr( $h2_text_decoration ), 'letter-spacing' => esc_attr( $h2_letter_spacing ), ), '.editor-styles-wrapper h3, #customize-controls .editor-styles-wrapper 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 ), 'text-decoration' => esc_attr( $h3_text_decoration ), 'letter-spacing' => esc_attr( $h3_letter_spacing ), ), '.editor-styles-wrapper h4' => array( 'font-size' => astra_responsive_font( $heading_h4_font_size, 'desktop' ), 'font-family' => astra_get_css_value( $h4_font_family, 'font' ), 'font-weight' => astra_get_css_value( $h4_font_weight, 'font' ), 'line-height' => esc_attr( $h4_line_height ), 'text-transform' => esc_attr( $h4_text_transform ), 'text-decoration' => esc_attr( $h4_text_decoration ), 'letter-spacing' => esc_attr( $h4_letter_spacing ), ), '.editor-styles-wrapper h5' => array( 'font-size' => astra_responsive_font( $heading_h5_font_size, 'desktop' ), 'font-family' => astra_get_css_value( $h5_font_family, 'font' ), 'font-weight' => astra_get_css_value( $h5_font_weight, 'font' ), 'line-height' => esc_attr( $h5_line_height ), 'text-transform' => esc_attr( $h5_text_transform ), 'text-decoration' => esc_attr( $h5_text_decoration ), 'letter-spacing' => esc_attr( $h5_letter_spacing ), ), '.editor-styles-wrapper h6' => array( 'font-size' => astra_responsive_font( $heading_h6_font_size, 'desktop' ), 'font-family' => astra_get_css_value( $h6_font_family, 'font' ), 'font-weight' => astra_get_css_value( $h6_font_weight, 'font' ), 'line-height' => esc_attr( $h6_line_height ), 'text-transform' => esc_attr( $h6_text_transform ), 'text-decoration' => esc_attr( $h6_text_decoration ), 'letter-spacing' => esc_attr( $h6_letter_spacing ), ), '.editor-styles-wrapper .block-editor-block-list__layout.is-root-container p' => array( 'margin-bottom' => astra_get_css_value( $para_margin_bottom, 'em' ), ), '.editor-styles-wrapper .wp-block-quote:not(.has-text-align-right):not(.has-text-align-center)' => array( 'border-' . esc_attr( $ltr_left ) => '5px solid rgba(0, 0, 0, 0.05)', ), // Gutenberg button compatibility for default styling. ':where(.editor-styles-wrapper .wp-block-button:not(.is-style-outline)) :is(div, button).wp-block-button__link, .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button, .block-editor-writing-flow .wp-block-file .wp-block-file__button, .editor-styles-wrapper button.wc-block-components-button' => array( 'border-style' => $theme_btn_top_border || $theme_btn_right_border || $theme_btn_left_border || $theme_btn_bottom_border ? 'solid' : '', 'border-top-width' => $theme_btn_top_border, 'border-right-width' => $theme_btn_right_border, 'border-left-width' => $theme_btn_left_border, 'border-bottom-width' => $theme_btn_bottom_border, 'color' => esc_attr( $btn_color ), 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), 'background-color' => esc_attr( $btn_bg_color ), 'font-family' => astra_get_font_family( $theme_btn_font_family ), 'font-weight' => esc_attr( $theme_btn_font_weight ), 'line-height' => esc_attr( $theme_btn_line_height ), 'text-transform' => esc_attr( $theme_btn_text_transform ), 'letter-spacing' => astra_get_css_value( $theme_btn_letter_spacing, 'px' ), 'text-decoration' => esc_attr( $theme_btn_text_decoration ), 'font-size' => astra_responsive_font( $theme_btn_font_size, 'desktop' ), 'border-top-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'top', 'desktop' ), 'border-top-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'right', 'desktop' ), 'border-bottom-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'bottom', 'desktop' ), 'border-bottom-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'left', 'desktop' ), '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, .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover, .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:focus, .block-editor-writing-flow .wp-block-file .wp-block-file__button:hover, .block-editor-writing-flow .wp-block-file .wp-block-file__button: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 ), ), '.wp-block-button.is-style-outline > .wp-block-button__link:hover, .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color):hover' => array( 'color' => esc_attr( $btn_h_color ), 'background-color' => esc_attr( $btn_bg_h_color ), ), '.editor-styles-wrapper .block-editor-block-list__layout .is-layout-grid.wp-block-group-is-layout-grid p, .editor-styles-wrapper .block-editor-block-list__layout .is-layout-flex:is(.wp-block-group-is-layout-flex, [class*="wp-block-spectra-"]) p' => array( 'margin-bottom' => '0', ), '.wp-block-button.is-style-outline > .wp-block-button__link.has-text-color' => array( 'border-color' => 'initial', ), '.wp-block-button.is-style-outline > .wp-block-button__link' => array( 'padding' => '.667em 1.333em', ), '.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color)' => array( 'color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), ), ':where(.editor-styles-wrapper) p' => array( 'line-height' => esc_attr( $body_line_height ), ), ); // Margin bottom same as applied on frontend. if ( 'post' === $post_type && apply_filters( 'astra_improvise_single_post_design', Astra_Dynamic_CSS::astra_4_6_0_compatibility() ) ) { $desktop_css['.editor-styles-wrapper :where(.is-root-container.block-editor-block-list__layout) > :is(.wp-block-heading, h1, h2, h3, h4, h5, h6)'] = array( 'margin-top' => '1.5em', 'margin-bottom' => 'calc(0.3em + 10px);', ); } else { $desktop_css['.editor-styles-wrapper .is-root-container.block-editor-block-list__layout > :is(.wp-block-heading, [class*="wp-block-spectra"]:where(h1, h2 ,h3 ,h4 ,h5 ,h6))'] = array( 'margin-bottom' => '20px', ); } if ( Astra_Dynamic_CSS::astra_4_6_0_compatibility() && astra_get_option( 'single-content-images-shadow', false ) ) { $desktop_css['.wp-block-image img'] = array( 'box-shadow' => '0 0 30px 0 rgba(0,0,0,.15)', '-webkit-box-shadow' => '0 0 30px 0 rgba(0,0,0,.15)', '-moz-box-shadow' => '0 0 30px 0 rgba(0,0,0,.15)', ); // To apply the default button border radius in the editor to make the consistency with the frontend. $desktop_css[ 'button, .ast-button, .button, input[type="button"], input[type="reset"], input[type="submit"]' . ( astra_button_consistency_compatibility() ? ', .wp-block-button__link' : '' ) ] = array( 'border-radius' => '4px', ); } /** Pro Individual heading colors sync with editor */ if ( defined( 'ASTRA_EXT_VER' ) ) { /** Getting all individual heading colors */ $h1_color = astra_get_option( 'h1-color' ); $h2_color = astra_get_option( 'h2-color' ); $h3_color = astra_get_option( 'h3-color' ); $h4_color = astra_get_option( 'h4-color' ); $h5_color = astra_get_option( 'h5-color' ); $h6_color = astra_get_option( 'h6-color' ); $desktop_css['.editor-visual-editor .editor-styles-wrapper h1'] = array( 'color' => esc_attr( $h1_color ), ); $desktop_css['.editor-visual-editor .editor-styles-wrapper h2'] = array( 'color' => esc_attr( $h2_color ), ); $desktop_css['.editor-visual-editor .editor-styles-wrapper h3'] = array( 'color' => esc_attr( $h3_color ), ); $desktop_css['.editor-visual-editor .editor-styles-wrapper h4'] = array( 'color' => esc_attr( $h4_color ), ); $desktop_css['.editor-visual-editor .editor-styles-wrapper h5'] = array( 'color' => esc_attr( $h5_color ), ); $desktop_css['.editor-visual-editor .editor-styles-wrapper h6'] = array( 'color' => esc_attr( $h6_color ), ); } if ( Astra_Dynamic_CSS::astra_4_6_4_compatibility() ) { $desktop_css['.uagb-buttons-repeater.ast-outline-button'] = array( 'border-radius' => '9999px', ); } if ( $is_dark_palette ) { $desktop_css['.astra-dark-mode-enable #learndash_lessons, .astra-dark-mode-enable #learndash_quizzes, .astra-dark-mode-enable #learndash_profile, .astra-dark-mode-enable #learndash_lesson_topics_list > div, .astra-dark-mode-enable .learndash-wrapper .ld-table-list .ld-table-list-item .ld-table-list-title a, .astra-dark-mode-enable .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-name, .astra-dark-mode-enable .learndash-wrapper .ld-table-list .ld-table-list-header a, .astra-dark-mode-enable .learndash-wrapper .ld-table-list .ld-table-list-item-preview a'] = array( 'background' => 'var( --ast-global-color-primary, --ast-global-color-4 )', 'color' => 'var(--ast-global-color-2)', ); $desktop_css['.astra-dark-mode-enable #learndash_lessons #lesson_heading, .astra-dark-mode-enable #learndash_profile .learndash_profile_heading, .astra-dark-mode-enable #learndash_quizzes #quiz_heading, .astra-dark-mode-enable #learndash_lesson_topics_list div > strong '] = array( 'background' => 'var(--ast-global-color-0)', 'color' => 'var(--ast-global-color-2)', ); $desktop_css['.astra-dark-mode-enable #learndash_profile '] = array( 'color' => 'var(--ast-global-color-0)', ); $desktop_css['.astra-dark-mode-enable .learndash-wrapper .ld-item-list .ld-item-list-item, .astra-dark-mode-enable .learndash-wrapper .ld-table-list .ld-table-list-footer '] = array( 'background' => 'var( --ast-global-color-primary, --ast-global-color-4 )', 'color' => 'var(--ast-global-color-2)', 'border-color' => 'var(--ast-border-color)', ); $desktop_css['.astra-dark-mode-enable .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-list-item-expanded .ld-progress, .astra-dark-mode-enable .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-list-item-expanded:before '] = array( 'background' => 'var( --ast-global-color-alternate-background, --ast-global-color-6 )', ); $desktop_css[' html.astra-dark-mode-enable :where(.editor-styles-wrapper) '] = array( 'color' => 'var(--ast-global-color-2)', ); $desktop_css[' .astra-dark-mode-enable .post-type-sureforms_form .editor-styles-wrapper '] = array( 'background' => 'initial', ); } // Boxed, Content-Boxed, page title alignment with Spectra Container Blocks. $desktop_css['.ast-separate-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > :is(.uagb-is-root-container, .spectra-is-root-container)'] = array( 'max-width' => 'var(--wp--custom--ast-content-width-size)', ); // Full-Width Stretched Layout page title alignment. $desktop_css['.ast-page-builder-template .edit-post-visual-editor__post-title-wrapper'] = array( 'max-width' => 'calc( 100% - 5px ) !important', ); // Full-Width Contained Layout page title wrapper crops in stacked view fix. $desktop_css['.ast-plain-container .ast-stacked-title-visibility .edit-post-visual-editor__post-title-wrapper'] = array( 'padding-left' => '3px', 'padding-right' => '3px', ); // Core / Spectra blocks compatibility to occupy same width as narrow container. $desktop_css['.ast-narrow-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container'] = array( 'max-width' => 'var(--wp--custom--ast-content-width-size)', 'margin-left' => 'auto', 'margin-right' => 'auto', ); $desktop_css['.ast-narrow-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > *.wp-block, .ast-narrow-container .is-root-container > .alignfull > :where(:not(.alignleft):not(.alignright))'] = array( 'max-width' => 'var(--wp--custom--ast-content-width-size)', 'margin-left' => 'auto', 'margin-right' => 'auto', ); $desktop_css['.ast-narrow-container .is-root-container > .alignwide > :where(:not(.alignleft):not(.alignright))'] = array( 'max-width' => 'var(--wp--custom--ast-content-width-size)', 'margin-left' => 'auto', 'margin-right' => 'auto', ); $desktop_css['.ast-narrow-container .editor-styles-wrapper .is-root-container .wp-block-uagb-image--align-full .wp-block-uagb-image__figure'] = array( 'max-width' => '100%', 'margin-left' => 'auto', 'margin-right' => 'auto', ); /** * Desktop site title. */ $desktop_css['.editor-styles-wrapper .edit-post-visual-editor__post-title-wrapper > h1'] = array( 'font-size' => astra_responsive_font( $site_title_font_size, 'desktop' ), 'font-weight' => astra_get_css_value( $site_title_font_weight, 'font' ), 'font-family' => astra_get_css_value( $site_title_font_family, 'font', $body_font_family ), 'text-transform' => esc_attr( $site_title_text_transform ), 'letter-spacing' => esc_attr( $site_title_spacing ), 'text-decoration' => esc_attr( $site_title_decoration ), ); $desktop_css['.editor-styles-wrapper .wp-block-search__input'] = array( 'padding' => '0 10px', 'border-color' => esc_attr( $border_color ), ); $desktop_css['.wp-block-table figcaption'] = array( 'text-align' => esc_attr( $ltr_left ), ); $default_border_size = '2px'; if ( astra_button_default_padding_updated() ) { $default_border_size = ''; } // Secondary button editor compatibility. $scndry_btn_text_color = astra_get_option( 'secondary-button-color' ); $scndry_btn_border_color = astra_get_option( 'secondary-theme-button-border-group-border-color' ); $scndry_btn_border_h_color = astra_get_option( 'secondary-theme-button-border-group-border-h-color' ); $global_scndry_custom_button_border_size = astra_get_option( 'secondary-theme-button-border-group-border-size' ); $scndry_theme_btn_top_border = isset( $global_scndry_custom_button_border_size['top'] ) && ( '' !== $global_scndry_custom_button_border_size['top'] && '0' !== $global_scndry_custom_button_border_size['top'] ) ? astra_get_css_value( $global_scndry_custom_button_border_size['top'], 'px' ) : $default_border_size; $scndry_theme_btn_right_border = isset( $global_scndry_custom_button_border_size['right'] ) && ( '' !== $global_scndry_custom_button_border_size['right'] && '0' !== $global_scndry_custom_button_border_size['right'] ) ? astra_get_css_value( $global_scndry_custom_button_border_size['right'], 'px' ) : $default_border_size; $scndry_theme_btn_left_border = isset( $global_scndry_custom_button_border_size['left'] ) && ( '' !== $global_scndry_custom_button_border_size['left'] && '0' !== $global_scndry_custom_button_border_size['left'] ) ? astra_get_css_value( $global_scndry_custom_button_border_size['left'], 'px' ) : $default_border_size; $scndry_theme_btn_bottom_border = isset( $global_scndry_custom_button_border_size['bottom'] ) && ( '' !== $global_scndry_custom_button_border_size['bottom'] && '0' !== $global_scndry_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_scndry_custom_button_border_size['bottom'], 'px' ) : $default_border_size; $scndry_theme_btn_font_family = astra_get_option( 'secondary-font-family-button' ); $scndry_theme_btn_font_size = astra_get_option( 'secondary-font-size-button' ); $scndry_theme_btn_font_weight = astra_get_option( 'secondary-font-weight-button' ); $scndry_theme_btn_text_transform = astra_get_font_extras( astra_get_option( 'secondary-font-extras-button' ), 'text-transform' ); $scndry_theme_btn_line_height = astra_get_font_extras( astra_get_option( 'secondary-font-extras-button' ), 'line-height', 'line-height-unit' ); $scndry_theme_btn_letter_spacing = astra_get_font_extras( astra_get_option( 'secondary-font-extras-button' ), 'letter-spacing', 'letter-spacing-unit' ); $scndry_theme_btn_text_decoration = astra_get_font_extras( astra_get_option( 'secondary-font-extras-button' ), 'text-decoration' ); $scndry_theme_btn_padding = astra_get_option( 'secondary-theme-button-padding' ); $scndry_btn_border_radius_fields = astra_get_option( 'secondary-button-radius-fields' ); $scndry_btn_bg_color = astra_get_option( 'secondary-button-bg-color' ); $scndry_btn_bg_hover_color = astra_get_option( 'secondary-button-bg-h-color' ); $scndry_btn_text_hover_color = astra_get_option( 'secondary-button-h-color' ); $scndry_btn_border_radius_top = astra_responsive_spacing( $scndry_btn_border_radius_fields, 'top', 'desktop' ); $scndry_btn_border_radius_right = astra_responsive_spacing( $scndry_btn_border_radius_fields, 'right', 'desktop' ); $scndry_btn_border_radius_bottom = astra_responsive_spacing( $scndry_btn_border_radius_fields, 'bottom', 'desktop' ); $scndry_btn_border_radius_left = astra_responsive_spacing( $scndry_btn_border_radius_fields, 'left', 'desktop' ); // Secondary color. if ( empty( $scndry_btn_text_color ) ) { $btn_color_val = empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ); } else { $btn_color_val = $scndry_btn_text_color; } // Secondary border color. if ( empty( $scndry_btn_border_color ) && empty( $scndry_btn_bg_color ) ) { $btn_border_color_val = empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ); } else { $btn_border_color_val = empty( $scndry_btn_border_color ) ? esc_attr( $scndry_btn_bg_color ) : esc_attr( $scndry_btn_border_color ); } // Secondary border hover color. if ( empty( $scndry_btn_border_h_color ) ) { $btn_border_h_color_val = empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ); } else { $btn_border_h_color_val = $scndry_btn_border_h_color; } // Fallback to primary border radius if secondary border radius is not set. if ( empty( $scndry_btn_border_radius_top ) && empty( $scndry_btn_border_radius_right ) && empty( $scndry_btn_border_radius_bottom ) && empty( $scndry_btn_border_radius_left ) ) { $scndry_btn_border_radius_top = astra_responsive_spacing( $btn_border_radius_fields, 'top', 'desktop' ); $scndry_btn_border_radius_right = astra_responsive_spacing( $btn_border_radius_fields, 'right', 'desktop' ); $scndry_btn_border_radius_bottom = astra_responsive_spacing( $btn_border_radius_fields, 'bottom', 'desktop' ); $scndry_btn_border_radius_left = astra_responsive_spacing( $btn_border_radius_fields, 'left', 'desktop' ); } // Secondary button preset compatibility. $secondary_btn_preset_style = astra_get_option( 'secondary-button-preset-style' ); if ( 'button_04' === $secondary_btn_preset_style || 'button_05' === $secondary_btn_preset_style || 'button_06' === $secondary_btn_preset_style ) { if ( empty( $scndry_btn_border_color ) ) { $btn_border_color_val = $scndry_btn_bg_color; } if ( '' === astra_get_option( 'secondary-button-bg-color' ) && '' === astra_get_option( 'secondary-button-color' ) ) { $btn_color_val = $theme_color; } elseif ( '' === astra_get_option( 'secondary-button-color' ) ) { $btn_color_val = $scndry_btn_bg_color; } $scndry_btn_bg_color = 'transparent'; } /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $secondary_btn_desktop_font_size = is_array( $scndry_theme_btn_font_size ) && isset( $scndry_theme_btn_font_size['desktop'] ) && isset( $scndry_theme_btn_font_size['desktop-unit'] ) ? astra_get_font_css_value( $scndry_theme_btn_font_size['desktop'], $scndry_theme_btn_font_size['desktop-unit'] ) : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $outline_button_css_desktop = array( '.editor-styles-wrapper .wp-block-buttons .wp-block-button.is-style-outline .wp-block-button__link, .ast-outline-button' => array( 'border-color' => esc_attr( $btn_border_color_val ), 'border-top-width' => esc_attr( $scndry_theme_btn_top_border ), 'border-right-width' => esc_attr( $scndry_theme_btn_right_border ), 'border-bottom-width' => esc_attr( $scndry_theme_btn_bottom_border ), 'border-left-width' => esc_attr( $scndry_theme_btn_left_border ), 'font-family' => astra_get_font_family( $scndry_theme_btn_font_family ), 'font-weight' => esc_attr( $scndry_theme_btn_font_weight ), 'font-size' => esc_attr( $secondary_btn_desktop_font_size ), 'line-height' => esc_attr( $scndry_theme_btn_line_height ), 'text-transform' => esc_attr( $scndry_theme_btn_text_transform ), 'text-decoration' => esc_attr( $scndry_theme_btn_text_decoration ), 'letter-spacing' => esc_attr( $scndry_theme_btn_letter_spacing ), 'padding-top' => astra_responsive_spacing( $scndry_theme_btn_padding, 'top', 'desktop' ), 'padding-right' => astra_responsive_spacing( $scndry_theme_btn_padding, 'right', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $scndry_theme_btn_padding, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $scndry_theme_btn_padding, 'left', 'desktop' ), 'border-top-left-radius' => esc_attr( $scndry_btn_border_radius_top ), 'border-top-right-radius' => esc_attr( $scndry_btn_border_radius_right ), 'border-bottom-right-radius' => esc_attr( $scndry_btn_border_radius_bottom ), 'border-bottom-left-radius' => esc_attr( $scndry_btn_border_radius_left ), 'background-color' => empty( $scndry_btn_bg_color ) ? 'transparent' : esc_attr( $scndry_btn_bg_color ), ), '.editor-styles-wrapper .uagb-buttons-repeater.ast-outline-button' => array( 'border-top-left-radius' => esc_attr( $scndry_btn_border_radius_top ), 'border-top-right-radius' => esc_attr( $scndry_btn_border_radius_right ), 'border-bottom-right-radius' => esc_attr( $scndry_btn_border_radius_bottom ), 'border-bottom-left-radius' => esc_attr( $scndry_btn_border_radius_left ), ), '.editor-styles-wrapper .wp-block-buttons .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color), .wp-block-buttons .wp-block-button.wp-block-button__link.is-style-outline:not(.has-text-color), .ast-outline-button' => array( 'color' => esc_attr( $btn_color_val ), ), '.editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link:hover, .wp-block-buttons .wp-block-button.is-style-outline .wp-block-button__link:focus, .wp-block-buttons .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color):hover, .wp-block-buttons .wp-block-button.wp-block-button__link.is-style-outline:not(.has-text-color):hover, .ast-outline-button:hover, .ast-outline-button:focus, .editor-styles-wrapper .uagb-buttons-repeater.ast-outline-button:hover, .editor-styles-wrapper .uagb-buttons-repeater.ast-outline-button:focus' => array( 'color' => empty( $scndry_btn_text_hover_color ) ? esc_attr( $btn_text_hover_color ) : esc_attr( $scndry_btn_text_hover_color ), 'background-color' => empty( $scndry_btn_bg_hover_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $scndry_btn_bg_hover_color ), 'border-color' => esc_attr( $btn_border_h_color_val ), ), // Primary hover styles. ':where(.editor-styles-wrapper .wp-block-button):not(.is-style-outline) .wp-block-button__link:hover, .block-editor-writing-flow .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover, .block-editor-writing-flow .wp-block-file .wp-block-file__button:hover' => array( 'color' => esc_attr( $btn_text_hover_color ), 'background-color' => esc_attr( $btn_bg_hover_color ), 'border-color' => empty( $btn_border_h_color ) ? esc_attr( $btn_bg_hover_color ) : esc_attr( $btn_border_h_color ), ), ); // Secondary button preset compatibility. if ( 'button_01' === $secondary_btn_preset_style || 'button_02' === $secondary_btn_preset_style || 'button_03' === $secondary_btn_preset_style ) { if ( empty( $scndry_btn_text_color ) ) { $scndry_btn_text_color = astra_get_foreground_color( $theme_color ); } $outline_button_css_desktop['.wp-block-buttons .wp-block-button .wp-block-button__link.is-style-outline:not(.has-background), .wp-block-buttons .wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background)'] = array( 'background-color' => empty( $scndry_btn_bg_color ) ? esc_attr( $theme_color ) : esc_attr( $scndry_btn_bg_color ), 'color' => esc_attr( $scndry_btn_text_color ), ); } $desktop_css = array_merge( $desktop_css, $outline_button_css_desktop ); $content_links_underline = astra_get_option( 'underline-content-links' ); if ( $content_links_underline ) { $desktop_css['.editor-styles-wrapper .is-root-container a'] = array( 'text-decoration' => 'underline', ); $reset_underline_from_anchors = Astra_Dynamic_CSS::unset_builder_elements_underline(); $buttons_excluded_selectors = Astra_Dynamic_CSS::astra_4_6_4_compatibility() ? '.edit-post-visual-editor a.uagb-tabs-list, .edit-post-visual-editor .uagb-ifb-cta a, .edit-post-visual-editor a.uagb-marketing-btn__link, .edit-post-visual-editor .uagb-post-grid a, .edit-post-visual-editor .uagb-toc__wrap a, .edit-post-visual-editor .uagb-taxomony-box a, .edit-post-visual-editor .uagb_review_block a, .editor-styles-wrapper .uagb-blockquote a, .editor-styles-wrapper .is-root-container .wc-block-components-product-name, .editor-styles-wrapper .is-root-container .wc-block-components-totals-coupon-link' : '.edit-post-visual-editor a.uagb-tabs-list, .edit-post-visual-editor .uagb-ifb-cta a, .edit-post-visual-editor a.uagb-marketing-btn__link, .edit-post-visual-editor .uagb-post-grid a, .edit-post-visual-editor .uagb-toc__wrap a, .edit-post-visual-editor .uagb-taxomony-box a, .edit-post-visual-editor .uagb_review_block a, .editor-styles-wrapper .uagb-blockquote a, .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link, .editor-styles-wrapper .wp-block-buttons .wp-block-button.is-style-outline .wp-block-button__link, .ast-outline-button, .editor-styles-wrapper .is-root-container .wc-block-components-product-name, .editor-styles-wrapper .is-root-container .wc-block-components-totals-coupon-link'; $excluding_anchor_selectors = $reset_underline_from_anchors ? $buttons_excluded_selectors : ''; $desktop_css[ $excluding_anchor_selectors ] = array( 'text-decoration' => 'none', ); } if ( $astra_is_block_editor_v2_ui ) { $single_post_continer_spacing = astra_get_option( 'single-post-inside-spacing' ); $astra_continer_left_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_continer_spacing, 'left', 'desktop' ) ? astra_responsive_spacing( $single_post_continer_spacing, 'left', 'desktop' ) : '6.67em'; $astra_continer_right_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_continer_spacing, 'right', 'desktop', '6.67' ) ? astra_responsive_spacing( $single_post_continer_spacing, 'right', 'desktop', '6.67' ) : '6.67em'; $alignwide_left_negative_margin = $astra_continer_left_spacing ? 'calc(-1 * min(' . $astra_continer_left_spacing . ', 40px))' : '-40px'; $alignwide_right_negative_margin = $astra_continer_right_spacing ? 'calc(-1 * min(' . $astra_continer_right_spacing . ', 40px))' : '-40px'; $heading_width_comp = Astra_Dynamic_CSS::astra_4_8_0_compatibility() ? 'none' : 'var(--wp--custom--ast-content-width-size)'; $container_width_comp = Astra_Dynamic_CSS::astra_4_8_4_compatibility() ? 'var(--wp--custom--ast-content-width-size)' : ''; $desktop_css['.editor-styles-wrapper .wp-block-latest-posts > li > a'] = array( 'text-decoration' => 'none', 'font-size' => '1.25rem', ); $desktop_css['.ast-plain-container.ast-no-sidebar .editor-styles-wrapper .is-root-container.block-editor-block-list__layout > .alignwide:is(.uagb-is-root-container, .spectra-is-root-container)'] = array( 'max-width' => $container_width_comp, ); $desktop_css['.ast-separate-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container .alignwide, .ast-plain-container .editor-styles-wrapper .block-editor-block-list__layout.is-root-container .alignwide'] = array( 'margin-left' => $alignwide_left_negative_margin, 'margin-right' => $alignwide_right_negative_margin, ); $desktop_css['.ast-page-builder-template .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > *.wp-block, .ast-page-builder-template .is-root-container > .alignfull:not(.wp-block-group) > :where(:not(.alignleft):not(.alignright)), .editor-styles-wrapper .is-root-container > .wp-block-cover.alignfull .wp-block-cover__image-background'] = array( 'max-width' => 'none', ); $desktop_css['.ast-page-builder-template .is-root-container > .alignwide > :where(:not(.alignleft):not(.alignright)), .editor-styles-wrapper .is-root-container > .wp-block-cover.alignwide .wp-block-cover__image-background'] = array( 'max-width' => 'var(--wp--custom--ast-wide-width-size)', ); $desktop_css['.ast-page-builder-template .is-root-container > .inherit-container-width > *, .ast-page-builder-template .is-root-container > *:not(.wp-block-group) > :where(:not(.alignleft):not(.alignright)), .is-root-container .wp-block-cover .wp-block-cover__inner-container, .editor-styles-wrapper .is-root-container > .wp-block-cover .wp-block-cover__inner-container, .is-root-container > .wp-block-cover .wp-block-cover__image-background'] = array( 'max-width' => $heading_width_comp, // phpcs:ignore WordPress.Arrays.ArrayIndentation.ItemNotAligned 'margin-right' => 'auto', // phpcs:ignore WordPress.Arrays.ArrayIndentation.ItemNotAligned 'margin-left' => 'auto', // phpcs:ignore WordPress.Arrays.ArrayIndentation.ItemNotAligned ); // phpcs:ignore WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned } else { $desktop_css['.editor-styles-wrapper .wp-block-latest-posts > li > a'] = array( 'text-decoration' => 'none', 'color' => esc_attr( $heading_base_color ), ); } $tablet_css = array( ':root, body .editor-styles-wrapper' => array( '--wp--custom--ast-default-block-top-padding' => $tablet_top_spacing, '--wp--custom--ast-default-block-right-padding' => $tablet_right_spacing, '--wp--custom--ast-default-block-bottom-padding' => $tablet_bottom_spacing, '--wp--custom--ast-default-block-left-padding' => $tablet_left_spacing, ), // Heading H1 - H6 font size. '.editor-styles-wrapper h1' => array( 'font-size' => astra_responsive_font( $heading_h1_font_size, 'tablet', '30' ), ), '.editor-styles-wrapper h2' => array( 'font-size' => astra_responsive_font( $heading_h2_font_size, 'tablet', '25' ), ), '.editor-styles-wrapper h3' => array( 'font-size' => astra_responsive_font( $heading_h3_font_size, 'tablet', '20' ), ), '.editor-styles-wrapper h4' => array( 'font-size' => astra_responsive_font( $heading_h4_font_size, 'tablet' ), ), '.editor-styles-wrapper h5' => array( 'font-size' => astra_responsive_font( $heading_h5_font_size, 'tablet' ), ), '.editor-styles-wrapper h6' => array( 'font-size' => astra_responsive_font( $heading_h6_font_size, 'tablet' ), ), '.edit-post-visual-editor__post-title-wrapper' => array( 'margin-top' => '0', ), '#editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $site_background, 'tablet' ), '.editor-styles-wrapper' => astra_get_responsive_background_obj( $content_background, 'tablet' ), ); /** * Tablet site title. */ $tablet_css['.editor-styles-wrapper .edit-post-visual-editor__post-title-wrapper > h1'] = array( 'font-size' => astra_responsive_font( $site_title_font_size, 'tablet' ), ); $mobile_css = array( ':root, body .editor-styles-wrapper' => array( '--wp--custom--ast-default-block-top-padding' => $mobile_top_spacing, '--wp--custom--ast-default-block-right-padding' => $mobile_right_spacing, '--wp--custom--ast-default-block-bottom-padding' => $mobile_bottom_spacing, '--wp--custom--ast-default-block-left-padding' => $mobile_left_spacing, ), // Heading H1 - H6 font size. '.editor-styles-wrapper h1' => array( 'font-size' => astra_responsive_font( $heading_h1_font_size, 'mobile', '30' ), ), '.editor-styles-wrapper h2' => array( 'font-size' => astra_responsive_font( $heading_h2_font_size, 'mobile', '25' ), ), '.editor-styles-wrapper h3' => array( 'font-size' => astra_responsive_font( $heading_h3_font_size, 'mobile', '20' ), ), '.editor-styles-wrapper h4' => array( 'font-size' => astra_responsive_font( $heading_h4_font_size, 'mobile' ), ), '.editor-styles-wrapper h5' => array( 'font-size' => astra_responsive_font( $heading_h5_font_size, 'mobile' ), ), '.editor-styles-wrapper h6' => array( 'font-size' => astra_responsive_font( $heading_h6_font_size, 'mobile' ), ), '#editor .edit-post-visual-editor' => astra_get_responsive_background_obj( $site_background, 'mobile' ), '.editor-styles-wrapper' => astra_get_responsive_background_obj( $content_background, 'mobile' ), ); /** * Mobile site title. */ $mobile_css['.editor-styles-wrapper .edit-post-visual-editor__post-title-wrapper > h1'] = array( 'font-size' => astra_responsive_font( $site_title_font_size, 'mobile' ), ); /** * Core blocks custom spacing support. * Case :- Do not apply custom padding for custom layout group, cover & column blocks. */ if ( 'astra-advanced-hook' !== $post_type ) { $desktop_css['.block-editor-block-list__layout.is-root-container > .wp-block-group, .block-editor-block-list__layout.is-root-container > [data-align="wide"] > .wp-block-group, .block-editor-block-list__layout.is-root-container > [data-align="full"] > .wp-block-group, .block-editor-block-list__layout.is-root-container > .wp-block-cover, .block-editor-block-list__layout.is-root-container > [data-align="wide"] > .wp-block-cover, .block-editor-block-list__layout.is-root-container > [data-align="full"] > .wp-block-cover, .block-editor-block-list__layout.is-root-container > .wp-block-columns, .block-editor-block-list__layout.is-root-container > [data-align="wide"] > .wp-block-columns, .block-editor-block-list__layout.is-root-container > [data-align="full"] > .wp-block-columns'] = array( 'padding-top' => 'var(--wp--custom--ast-default-block-top-padding)', 'padding-right' => 'var(--wp--custom--ast-default-block-right-padding)', 'padding-bottom' => 'var(--wp--custom--ast-default-block-bottom-padding)', 'padding-left' => 'var(--wp--custom--ast-default-block-left-padding)', ); } $css .= astra_parse_css( $desktop_css ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css .= astra_parse_css( $tablet_css, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css .= astra_parse_css( $mobile_css, '', astra_get_mobile_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort return $css; } } builder/class-astra-builder-admin.php000064400000006467152266256010013654 0ustar00 array( 'popup_content' => array( 'mobile-menu' ) ), 'above' => array( 'above_left' => array(), 'above_left_center' => array(), 'above_center' => array(), 'above_right_center' => array(), 'above_right' => array(), ), 'primary' => array( 'primary_left' => array( 'logo' ), 'primary_left_center' => array(), 'primary_center' => array(), 'primary_right_center' => array(), 'primary_right' => array( 'menu-1' ), ), 'below' => array( 'below_left' => array(), 'below_left_center' => array(), 'below_center' => array(), 'below_right_center' => array(), 'below_right' => array(), ), ); /** * Header Builder - Mobile Defaults. */ $defaults['header-mobile-items'] = array( 'popup' => array( 'popup_content' => array( 'mobile-menu' ) ), 'above' => array( 'above_left' => array(), 'above_center' => array(), 'above_right' => array(), ), 'primary' => array( 'primary_left' => array( 'logo' ), 'primary_center' => array(), 'primary_right' => array( 'mobile-trigger' ), ), 'below' => array( 'below_left' => array(), 'below_center' => array(), 'below_right' => array(), ), ); /** * Primary Header Defaults. */ $defaults['hb-header-main-layout-width'] = 'content'; $defaults['hb-header-height'] = array( 'desktop' => false === astra_check_is_structural_setup() ? 70 : 80, 'tablet' => '', 'mobile' => '', ); $defaults['hb-stack'] = array( 'desktop' => 'stack', 'tablet' => 'stack', 'mobile' => 'stack', ); $defaults['hb-header-main-sep'] = 1; $defaults['hb-header-main-sep-color'] = 'var( --ast-global-color-subtle-background, --ast-global-color-7 )'; $defaults['hb-header-main-menu-align'] = 'inline'; $defaults['hb-header-bg-obj-responsive'] = array( 'desktop' => array( 'background-color' => 'var( --ast-global-color-primary, --ast-global-color-4 )', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'tablet' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), ); $defaults['hb-header-spacing'] = array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '1.5', 'right' => '', 'bottom' => '1.5', 'left' => '', ), 'mobile' => array( 'top' => '1', 'right' => '', 'bottom' => '1', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'em', 'mobile-unit' => 'em', ); /** * Above Header Defaults. */ $defaults['hba-header-layout'] = 'above-header-layout-1'; $defaults['hba-header-height'] = array( 'desktop' => 50, 'tablet' => '', 'mobile' => '', ); $defaults['hba-stack'] = array( 'desktop' => 'stack', 'tablet' => 'stack', 'mobile' => 'stack', ); $defaults['hba-header-separator'] = 1; $defaults['hba-header-bottom-border-color'] = 'var( --ast-global-color-subtle-background, --ast-global-color-7 )'; $defaults['hba-header-bg-obj-responsive'] = array( 'desktop' => array( 'background-color' => 'var( --ast-global-color-primary, --ast-global-color-4 )', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'tablet' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), ); $defaults['hba-header-text-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['hba-header-link-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['hba-header-link-h-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['hba-header-spacing'] = array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '0', 'right' => '', 'bottom' => '0', 'left' => '', ), 'mobile' => array( 'top' => '0.5', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'em', ); /** * Logo defaults. */ $defaults['ast-header-responsive-logo-width'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); /** * Below Header Defaults. */ $defaults['hbb-header-layout'] = 'below-header-layout-1'; $defaults['hbb-header-height'] = array( 'desktop' => 60, 'tablet' => '', 'mobile' => '', ); $defaults['hbb-stack'] = array( 'desktop' => 'stack', 'tablet' => 'stack', 'mobile' => 'stack', ); $defaults['hbb-header-separator'] = 1; $defaults['hbb-header-bottom-border-color'] = 'var( --ast-global-color-subtle-background, --ast-global-color-7 )'; $defaults['hbb-header-bg-obj-responsive'] = array( 'desktop' => array( 'background-color' => $is_dark_palette ? 'var( --ast-global-color-primary, --ast-global-color-4 )' : '#eeeeee', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'tablet' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), ); $defaults['hbb-header-spacing'] = array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '1', 'right' => '', 'bottom' => '1', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'em', 'mobile-unit' => 'px', ); $margin_defaults = array( 'section-footer-builder-layout-padding', 'section-footer-builder-layout-margin', 'section-above-header-builder-padding', 'section-above-header-builder-margin', 'section-below-header-builder-padding', 'section-below-header-builder-margin', 'section-header-mobile-trigger-margin', 'section-primary-header-builder-padding', 'section-primary-header-builder-margin', 'title_tagline-margin', 'section-header-search-margin', 'header-account-margin', 'header-mobile-menu-menu-spacing', 'section-header-mobile-menu-margin', 'section-above-footer-builder-padding', 'section-above-footer-builder-margin', 'section-below-footer-builder-margin', 'section-footer-copyright-margin', 'section-footer-menu-margin', 'section-primary-footer-builder-padding', 'section-primary-footer-builder-margin', 'section-header-woo-cart-padding', 'section-header-woo-cart-margin', ); foreach ( $margin_defaults as $margin_default ) { $defaults[ $margin_default ] = Astra_Builder_Helper::$default_responsive_spacing; } for ( $index = 1; $index <= Astra_Builder_Helper::$component_limit; $index++ ) { $defaults = astra_prepare_button_defaults( $defaults, absint( $index ) ); $defaults = astra_prepare_html_defaults( $defaults, absint( $index ) ); $defaults = astra_prepare_social_icon_defaults( $defaults, absint( $index ) ); $defaults = astra_prepare_widget_defaults( $defaults, absint( $index ) ); $defaults = astra_prepare_menu_defaults( $defaults, absint( $index ) ); $defaults = astra_prepare_divider_defaults( $defaults, absint( $index ) ); } /** * Header Types - Defaults */ $defaults['transparent-header-main-sep'] = false === astra_get_transparent_header_default_value() ? '' : 0; $defaults['transparent-header-main-sep-color'] = ''; $reorder_color_seq = Astra_Dynamic_CSS::astra_4_8_9_compatibility(); /** * Header > Sticky Defaults. */ $defaults['sticky-header-on-devices'] = 'desktop'; $defaults['sticky-header-style'] = 'none'; /** * Footer Builder - Desktop Defaults. */ $defaults['footer-desktop-items'] = array( 'above' => array( 'above_1' => array(), 'above_2' => array(), 'above_3' => array(), 'above_4' => array(), 'above_5' => array(), ), 'primary' => array( 'primary_1' => array(), 'primary_2' => array(), 'primary_3' => array(), 'primary_4' => array(), 'primary_5' => array(), ), 'below' => array( 'below_1' => array( 'copyright' ), 'below_2' => array(), 'below_3' => array(), 'below_4' => array(), 'below_5' => array(), ), ); /** * Above Footer Defaults. */ $defaults['hba-footer-height'] = 60; $defaults['hba-footer-column'] = '2'; $defaults['hba-footer-layout'] = array( 'desktop' => '2-equal', 'tablet' => '2-equal', 'mobile' => 'full', ); /** * Footer - Defaults */ $defaults['hba-footer-bg-obj-responsive'] = array( 'desktop' => array( 'background-color' => $is_dark_palette ? 'var( --ast-global-color-primary, --ast-global-color-4 )' : '#eeeeee', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'tablet' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), ); $defaults['hbb-footer-bg-obj-responsive'] = array( 'desktop' => array( 'background-color' => $apply_new_default_color_typo_values ? ( $reorder_color_seq ? 'var(--ast-global-color-4 )' : 'var(--ast-global-color-5)' ) : ( $astra_dark_mode ? '#eeeeee' : 'var( --ast-global-color-primary, --ast-global-color-4 )' ), 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'tablet' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), ); $defaults['hb-footer-bg-obj-responsive'] = array( 'desktop' => array( 'background-color' => $is_dark_palette ? 'var( --ast-global-color-primary, --ast-global-color-4 )' : '#f9f9f9', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'tablet' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), ); $defaults['hbb-footer-top-border-color'] = $blog_update ? 'var( --ast-global-color-subtle-background, --ast-global-color-7 )' : 'var(--ast-global-color-subtle-background, --ast-global-color-6)'; $defaults['hbb-footer-separator'] = 1; /** * Header Margin defaults. */ $defaults['section-header-builder-layout-margin'] = array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); /** * Below Footer Defaults. */ $defaults['hbb-footer-height'] = $astra_update_footer_row_vertical_alignment ? 60 : 80; $defaults['hbb-footer-column'] = '1'; $defaults['hbb-footer-layout'] = array( 'desktop' => 'full', 'tablet' => 'full', 'mobile' => 'full', ); /** * Primary Footer Default Height. */ $defaults['hb-primary-footer-height'] = ''; $defaults['hba-footer-layout-width'] = 'content'; $defaults['hb-footer-layout-width'] = 'content'; $defaults['hbb-footer-layout-width'] = 'content'; $defaults['hba-footer-vertical-alignment'] = 'flex-start'; $defaults['hb-footer-vertical-alignment'] = 'flex-start'; $defaults['hbb-footer-vertical-alignment'] = $astra_update_footer_row_vertical_alignment ? 'center' : 'flex-start'; $defaults['footer-bg-obj-responsive'] = array( 'desktop' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'tablet' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), ); /** * Primary Footer Defaults. */ $defaults['hb-footer-column'] = '3'; $defaults['hb-footer-separator'] = 1; $defaults['hb-footer-bottom-border-color'] = '#e6e6e6'; $defaults['hb-footer-layout'] = array( 'desktop' => '3-equal', 'tablet' => '3-equal', 'mobile' => 'full', ); $defaults['hb-footer-main-sep'] = 1; $defaults['hb-footer-main-sep-color'] = 'var( --ast-global-color-subtle-background, --ast-global-color-7 )'; $defaults['live-search-result-count'] = 5; /** * Footer Copyright. */ $defaults['footer-copyright-editor'] = __( 'Copyright [copyright] [current_year] [site_title] | Powered by [theme_author]', 'astra' ); $defaults['footer-copyright-color'] = $apply_new_default_color_typo_values ? 'var(--ast-global-color-3)' : ''; $defaults['line-height-section-footer-copyright'] = 2; $defaults['footer-copyright-alignment'] = array( 'desktop' => 'center', 'tablet' => 'center', 'mobile' => 'center', ); $defaults['font-size-section-footer-copyright'] = array( 'desktop' => $apply_new_default_color_typo_values ? 16 : '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['font-weight-section-footer-copyright'] = 'inherit'; $defaults['font-family-section-footer-copyright'] = 'inherit'; $defaults['font-extras-section-footer-copyright'] = array( 'line-height' => ! isset( $astra_options['font-extras-section-footer-copyright'] ) && isset( $astra_options['line-height-section-footer-copyright'] ) ? $astra_options['line-height-section-footer-copyright'] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['font-extras-section-footer-copyright'] ) && isset( $astra_options['text-transform-section-footer-copyright'] ) ? $astra_options['text-transform-section-footer-copyright'] : '', 'text-decoration' => '', ); $defaults['footer-menu-alignment'] = array( 'desktop' => 'center', 'tablet' => 'center', 'mobile' => 'center', ); /** * Footer Below Padding. */ $defaults['section-below-footer-builder-padding'] = array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); /** * Search. */ $defaults['header-search-icon-space'] = array( 'desktop' => 18, 'tablet' => 18, 'mobile' => 18, ); $defaults['header-search-icon-color'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); /** * Search Advanced. */ $defaults['header-search-width'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['live-search'] = false; $defaults['live-search-post-types'] = array( 'post' => 1, 'page' => 1, ); /** * Transparent Header > Component Configs */ $defaults['transparent-header-social-icons-color'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-header-social-icons-h-color'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-header-social-icons-bg-color'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-header-social-icons-bg-h-color'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-header-html-text-color'] = ''; $defaults['transparent-header-html-link-color'] = ''; $defaults['transparent-header-html-link-h-color'] = ''; $defaults['transparent-header-widget-title-color'] = ''; $defaults['transparent-header-widget-content-color'] = ''; $defaults['transparent-header-widget-link-color'] = ''; $defaults['transparent-header-widget-link-h-color'] = ''; $defaults['transparent-header-button-text-color'] = ''; $defaults['transparent-header-button-text-h-color'] = ''; $defaults['transparent-header-button-bg-color'] = ''; $defaults['transparent-header-button-bg-h-color'] = ''; /** * Off-Canvas defaults. */ $defaults['off-canvas-layout'] = 'side-panel'; $defaults['off-canvas-slide'] = 'right'; $defaults['header-builder-menu-toggle-target'] = 'icon'; $defaults['header-offcanvas-content-alignment'] = 'flex-start'; $defaults['off-canvas-background'] = array( 'background-color' => $is_dark_palette ? 'var( --ast-global-color-secondary, --ast-global-color-5 )' : '#ffffff', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ); $defaults['off-canvas-close-color'] = '#3a3a3a'; $defaults['mobile-header-type'] = 'dropdown'; $defaults['off-canvas-move-body'] = false; $defaults['off-canvas-inner-spacing'] = ''; $defaults['footer-menu-layout'] = array( 'desktop' => 'horizontal', 'tablet' => 'vertical', 'mobile' => 'vertical', ); $defaults['footer-menu-bg-obj-responsive'] = array( 'desktop' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'tablet' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), ); $defaults['footer-menu-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['footer-menu-h-bg-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['footer-menu-h-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['footer-menu-a-bg-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['footer-menu-a-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['footer-menu-font-size'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['footer-menu-font-weight'] = 'inherit'; $defaults['footer-menu-font-family'] = 'inherit'; $defaults['footer-menu-font-extras'] = array( 'line-height' => ! isset( $astra_options['footer-menu-font-extras'] ) && isset( $astra_options['footer-menu-line-height'] ) ? $astra_options['footer-menu-line-height'] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['footer-menu-font-extras'] ) && isset( $astra_options['footer-menu-text-transform'] ) ? $astra_options['footer-menu-text-transform'] : '', 'text-decoration' => '', ); $defaults['footer-main-menu-spacing'] = array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '0', 'right' => '20', 'bottom' => '0', 'left' => '20', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); // Mobile Trigger defaults. $defaults['header-trigger-icon'] = 'menu'; $defaults['mobile-header-toggle-icon-size'] = 20; $defaults['mobile-header-toggle-btn-style'] = 'minimal'; $defaults['mobile-header-toggle-btn-border-size'] = array( 'top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1, ); $defaults['mobile-header-toggle-border-radius'] = 2; $mobile_header_toggle_border_radius_fields = ! isset( $astra_options['mobile-header-toggle-border-radius-fields'] ) && isset( $astra_options['mobile-header-toggle-border-radius'] ) ? $astra_options['mobile-header-toggle-border-radius'] : ''; $defaults['mobile-header-toggle-border-radius-fields'] = array( 'desktop' => array( 'top' => $mobile_header_toggle_border_radius_fields, 'right' => $mobile_header_toggle_border_radius_fields, 'bottom' => $mobile_header_toggle_border_radius_fields, 'left' => $mobile_header_toggle_border_radius_fields, ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); /** * Mobile trigger - Label Typography. */ $defaults['mobile-header-label-font-family'] = 'inherit'; $defaults['mobile-header-label-font-weight'] = 'inherit'; $defaults['mobile-header-label-text-transform'] = ''; $defaults['mobile-header-label-line-height'] = ''; $defaults['mobile-header-label-font-size'] = ''; /** * Global Color Palette. */ $update_colors_for_starter_library = Astra_Dynamic_CSS::astra_4_4_0_compatibility(); $update_color_for_forms_ui = Astra_Dynamic_CSS::astra_4_6_0_compatibility(); $color_palette_reorganize = Astra_Dynamic_CSS::astra_4_8_9_compatibility(); if ( $update_color_for_forms_ui ) { $color_palette_7 = '#D1D5DB'; } else { $color_palette_7 = $update_colors_for_starter_library ? '#ADB6BE' : '#e2e8f0'; } $defaults['global-color-palette'] = $apply_new_default_color_typo_values ? array( 'palette' => array( '#046bd2', '#045cb4', '#1e293b', '#334155', $color_palette_reorganize ? '#FFFFFF' : ( $update_colors_for_starter_library ? '#F0F5FA' : '#f9fafb' ), $color_palette_reorganize ? ( $update_colors_for_starter_library ? '#F0F5FA' : '#f9fafb' ) : '#FFFFFF', $color_palette_reorganize ? ( $update_colors_for_starter_library ? '#111111' : '#cbd5e1' ) : $color_palette_7, $color_palette_reorganize ? $color_palette_7 : ( $update_colors_for_starter_library ? '#111111' : '#cbd5e1' ), $update_colors_for_starter_library ? '#111111' : '#94a3b8', ), ) : array( 'palette' => array( '#0170B9', '#3a3a3a', '#3a3a3a', '#4B4F58', $color_palette_reorganize ? '#FFFFFF' : '#F5F5F5', $color_palette_reorganize ? '#F5F5F5' : '#FFFFFF', $color_palette_reorganize ? '#424242' : '#E5E5E5', $color_palette_reorganize ? '#E5E5E5' : '#424242', '#000000', ), ); // Default global SVG values. $defaults['header-logo-color'] = ''; /** * Mobile Menu */ // Specify all the default values for Menu from here. $defaults['header-mobile-menu-bg-color'] = ''; $defaults['header-mobile-menu-color'] = ''; $defaults['header-mobile-menu-h-bg-color'] = ''; $defaults['header-mobile-menu-h-color'] = ''; $defaults['header-mobile-menu-a-bg-color'] = ''; $defaults['header-mobile-menu-a-color'] = ''; $defaults['header-mobile-menu-bg-obj-responsive'] = array( 'desktop' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'tablet' => array( 'background-color' => $apply_new_default_color_typo_values ? ( $reorder_color_seq ? 'var(--ast-global-color-4)' : 'var(--ast-global-color-5)' ) : '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), ); $defaults['header-mobile-menu-color-responsive'] = array( 'desktop' => $apply_new_default_color_typo_values ? 'var(--ast-global-color-3)' : '', 'tablet' => $apply_new_default_color_typo_values ? 'var(--ast-global-color-3)' : '', 'mobile' => '', ); $defaults['header-mobile-menu-h-color-responsive'] = array( 'desktop' => $apply_new_default_color_typo_values ? 'var(--ast-global-color-1)' : '', 'tablet' => $apply_new_default_color_typo_values ? 'var(--ast-global-color-1)' : '', 'mobile' => '', ); $defaults['header-mobile-menu-a-color-responsive'] = array( 'desktop' => $apply_new_default_color_typo_values ? 'var(--ast-global-color-1)' : '', 'tablet' => $apply_new_default_color_typo_values ? 'var(--ast-global-color-1)' : '', 'mobile' => '', ); $defaults['header-mobile-menu-h-bg-color-responsive'] = array( 'desktop' => '', 'tablet' => $apply_new_default_color_typo_values ? ( $reorder_color_seq ? 'var(--ast-global-color-5)' : 'var(--ast-global-color-4)' ) : '', 'mobile' => '', ); $defaults['header-mobile-menu-a-bg-color-responsive'] = array( 'desktop' => '', 'tablet' => $apply_new_default_color_typo_values ? ( $reorder_color_seq ? 'var(--ast-global-color-5)' : 'var(--ast-global-color-4)' ) : '', 'mobile' => '', ); $defaults['header-mobile-menu-submenu-container-animation'] = 'fade'; /** * Submenu */ $defaults['header-mobile-menu-submenu-item-border'] = false; $defaults['header-mobile-menu-submenu-item-b-size'] = '1'; $defaults['header-mobile-menu-submenu-item-b-color'] = '#eaeaea'; $defaults['header-mobile-menu-submenu-border'] = array( 'top' => 2, 'bottom' => 0, 'left' => 0, 'right' => 0, ); /** * Menu - Typography. */ $defaults['header-mobile-menu-font-size'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['font-extras-header-mobile-menu'] = array( 'line-height' => ! isset( $astra_options['font-extras-header-mobile-menu'] ) && isset( $astra_options['header-mobile-menu-line-height'] ) ? $astra_options['header-mobile-menu-line-height'] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['font-extras-header-mobile-menu'] ) && isset( $astra_options['header-mobile-menu-text-transform'] ) ? $astra_options['header-mobile-menu-text-transform'] : '', 'text-decoration' => '', ); /** * Woo-Cart. */ $defaults['woo-header-cart-click-action'] = 'default'; $defaults['responsive-cart-click-action'] = 'flyout'; $defaults['woo-slide-in-cart-width'] = array( 'desktop' => 35, 'tablet' => '', 'mobile' => '', 'desktop-unit' => '%', 'tablet-unit' => '%', 'mobile-unit' => '%', ); $defaults['woo-header-cart-icon-total-label-position'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['header-woo-cart-icon-size'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['woo-header-cart-icon'] = 'default'; $defaults['woo-header-cart-icon-style'] = 'outline'; $defaults['woo-header-cart-product-count-color-group'] = 'var( --ast-global-color-secondary, --ast-global-color-5 )'; $defaults['woo-desktop-cart-flyout-direction'] = 'right'; $defaults['header-woo-cart-icon-color'] = ''; $defaults['transparent-header-woo-cart-icon-color'] = ''; $defaults['header-woo-cart-icon-hover-color'] = ''; $defaults['woo-header-cart-border-width'] = 2; $woo_header_cart_border_radius = ! isset( $astra_options['woo-header-cart-icon-radius-fields'] ) && isset( $astra_options['woo-header-cart-icon-radius'] ) ? $astra_options['woo-header-cart-icon-radius'] : ''; $defaults['woo-header-cart-icon-radius-fields'] = array( 'desktop' => array( 'top' => $woo_header_cart_border_radius, 'right' => $woo_header_cart_border_radius, 'bottom' => $woo_header_cart_border_radius, 'left' => $woo_header_cart_border_radius, ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['woo-header-cart-badge-display'] = true; // Woo Cart - Dynamic label default value. $defaults['woo-header-cart-label-display'] = ''; // Cart tray > General Color styles. $defaults['header-woo-cart-text-color'] = ''; $defaults['header-woo-cart-link-color'] = ''; $defaults['header-woo-cart-background-color'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['header-woo-cart-background-hover-color'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['header-woo-cart-separator-color'] = ''; $defaults['header-woo-cart-link-hover-color'] = ''; // Cart tray > Cart Button styles. $defaults['header-woo-cart-btn-text-color'] = ''; $defaults['header-woo-cart-btn-background-color'] = ''; $defaults['header-woo-cart-btn-text-hover-color'] = ''; $defaults['header-woo-cart-btn-bg-hover-color'] = ''; // Cart tray > Checkout Button styles. $defaults['header-woo-checkout-btn-text-color'] = ''; $defaults['header-woo-checkout-btn-background-color'] = ''; $defaults['header-woo-checkout-btn-text-hover-color'] = ''; $defaults['header-woo-checkout-btn-bg-hover-color'] = ''; /** * EDD-Cart. */ $defaults['edd-header-cart-icon-style'] = 'outline'; $defaults['edd-header-cart-icon-color'] = ''; $defaults['edd-header-cart-icon-radius'] = 3; $defaults['transparent-header-edd-cart-icon-color'] = ''; $defaults['edd-header-cart-total-display'] = true; $defaults['edd-header-cart-title-display'] = true; // Cart tray > General Color styles. $defaults['header-edd-cart-text-color'] = ''; $defaults['header-edd-cart-link-color'] = ''; $defaults['header-edd-cart-background-color'] = ''; $defaults['header-edd-cart-separator-color'] = ''; // Cart tray > Checkout Button styles. $defaults['header-edd-checkout-btn-text-color'] = ''; $defaults['header-edd-checkout-btn-background-color'] = ''; $defaults['header-edd-checkout-btn-text-hover-color'] = ''; $defaults['header-edd-checkout-btn-bg-hover-color'] = ''; /** * Account element. */ $defaults['header-account-type'] = 'default'; $defaults['header-account-login-style'] = 'icon'; $defaults['header-account-login-style-extend-text-profile-type'] = 'default'; $defaults['header-account-action-type'] = 'link'; $defaults['header-account-link-type'] = 'default'; $defaults['header-account-logout-style'] = 'icon'; $defaults['header-account-logout-style-extend-text-profile-type'] = 'default'; $defaults['header-account-logged-out-text'] = __( 'Log In', 'astra' ); $defaults['header-account-logged-in-text'] = __( 'My Account', 'astra' ); $defaults['header-account-logout-action'] = 'link'; $defaults['header-account-image-width'] = array( 'desktop' => '40', 'tablet' => '', 'mobile' => '', ); $defaults['header-account-icon-size'] = array( 'desktop' => 18, 'tablet' => 18, 'mobile' => 18, ); $defaults['header-account-icon-color'] = 'var(--ast-global-color-2)'; $defaults['header-account-login-link'] = array( 'url' => '', 'new_tab' => false, 'link_rel' => '', ); $defaults['header-account-logout-link'] = array( 'url' => esc_url( wp_login_url() ), 'new_tab' => false, 'link_rel' => '', ); $defaults['font-size-section-header-account'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['header-account-type-text-color'] = ''; $defaults['header-account-woo-menu'] = false; $defaults['cloned-component-track'] = Astra_Builder_Helper::$component_count_array; return $defaults; } /** * Prepare Divider Defaults. * * @param array $defaults defaults. * @param int $index index. */ function astra_prepare_divider_defaults( $defaults, $index ) { $defaults[ 'section-hb-divider-' . $index . '-margin' ] = Astra_Builder_Helper::$default_responsive_spacing; $defaults[ 'section-fb-divider-' . $index . '-margin' ] = Astra_Builder_Helper::$default_responsive_spacing; return $defaults; } /** * Prepare Button Defaults. * * @param array $defaults defaults. * @param int $index index. */ function astra_prepare_button_defaults( $defaults, $index ) { /** * Update Astra default color and typography values. To not update directly on existing users site, added backwards. * * @since 4.0.0 */ $apply_new_default_color_typo_values = Astra_Dynamic_CSS::astra_check_default_color_typo(); $astra_options = Astra_Theme_Options::get_astra_options(); $_prefix = 'button' . $index; $defaults[ 'header-' . $_prefix . '-text' ] = __( 'Button', 'astra' ); $defaults[ 'header-' . $_prefix . '-link-option' ] = array( 'url' => apply_filters( 'astra_site_url', 'https://www.wpastra.com' ), 'new_tab' => false, 'link_rel' => '', ); $defaults[ 'header-' . $_prefix . '-font-family' ] = 'inherit'; $defaults[ 'header-' . $_prefix . '-font-weight' ] = 'inherit'; $defaults[ 'header-' . $_prefix . '-font-extras' ] = array( 'line-height' => ! isset( $astra_options[ 'header-' . $_prefix . '-font-extras' ] ) && isset( $astra_options[ 'header-' . $_prefix . '-line-height' ] ) ? $astra_options[ 'header-' . $_prefix . '-line-height' ] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options[ 'header-' . $_prefix . '-font-extras' ] ) && isset( $astra_options[ 'header-' . $_prefix . '-text-transform' ] ) ? $astra_options[ 'header-' . $_prefix . '-text-transform' ] : '', 'text-decoration' => '', ); $defaults[ 'header-' . $_prefix . '-font-size' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'header-' . $_prefix . '-text-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-' . $_prefix . '-back-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-' . $_prefix . '-text-h-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-' . $_prefix . '-back-h-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-' . $_prefix . '-padding' ] = array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'header-' . $_prefix . '-border-size' ] = array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ); $defaults[ 'header-' . $_prefix . '-border-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $header_button_border_radius_fields = ! isset( $astra_options[ 'header-' . $_prefix . '-border-radius-fields' ] ) && isset( $astra_options[ 'header-' . $_prefix . '-border-radius' ] ) ? $astra_options[ 'header-' . $_prefix . '-border-radius' ] : ''; $defaults[ 'header-' . $_prefix . '-border-radius-fields' ] = array( 'desktop' => array( 'top' => $header_button_border_radius_fields, 'right' => $header_button_border_radius_fields, 'bottom' => $header_button_border_radius_fields, 'left' => $header_button_border_radius_fields, ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'header-' . $_prefix . '-border-radius' ] = ''; $astra_4_6_4_compatibility = Astra_Dynamic_CSS::astra_4_6_4_compatibility(); $legacy_hb_button_padding = $apply_new_default_color_typo_values ? Astra_Builder_Helper::$default_button_responsive_spacing : Astra_Builder_Helper::$default_responsive_spacing; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $builder_button_top_padding = isset( $astra_options[ 'section-hb-button-' . $index . '-padding' ]['desktop']['top'] ) ? $astra_options[ 'section-hb-button-' . $index . '-padding' ]['desktop']['top'] : $legacy_hb_button_padding['desktop']['top']; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $builder_button_right_padding = isset( $astra_options[ 'section-hb-button-' . $index . '-padding' ]['desktop']['right'] ) ? $astra_options[ 'section-hb-button-' . $index . '-padding' ]['desktop']['right'] : $legacy_hb_button_padding['desktop']['right']; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $builder_button_bottom_padding = isset( $astra_options[ 'section-hb-button-' . $index . '-padding' ]['desktop']['bottom'] ) ? $astra_options[ 'section-hb-button-' . $index . '-padding' ]['desktop']['bottom'] : $legacy_hb_button_padding['desktop']['bottom']; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $builder_button_left_padding = isset( $astra_options[ 'section-hb-button-' . $index . '-padding' ]['desktop']['left'] ) ? $astra_options[ 'section-hb-button-' . $index . '-padding' ]['desktop']['left'] : $legacy_hb_button_padding['desktop']['left']; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $defaults[ 'section-hb-button-' . $index . '-padding' ] = array( 'desktop' => array( 'top' => $astra_4_6_4_compatibility ? 15 : $builder_button_top_padding, 'right' => $astra_4_6_4_compatibility ? 30 : $builder_button_right_padding, 'bottom' => $astra_4_6_4_compatibility ? 15 : $builder_button_bottom_padding, 'left' => $astra_4_6_4_compatibility ? 30 : $builder_button_left_padding, ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'header-button' . $index . '-border-radius-fields' ] = array( 'desktop' => array( 'top' => $astra_4_6_4_compatibility ? 40 : '', 'right' => $astra_4_6_4_compatibility ? 40 : '', 'bottom' => $astra_4_6_4_compatibility ? 40 : '', 'left' => $astra_4_6_4_compatibility ? 40 : '', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'section-hb-button-' . $index . '-margin' ] = Astra_Builder_Helper::$default_responsive_spacing; $defaults[ 'sticky-header-button' . $index . '-padding' ] = Astra_Builder_Helper::$default_responsive_spacing; $_prefix = 'button' . $index; $defaults[ 'footer-' . $_prefix . '-text' ] = __( 'Button', 'astra' ); $defaults[ 'footer-' . $_prefix . '-link-option' ] = array( 'url' => apply_filters( 'astra_site_url', 'https://www.wpastra.com' ), 'new_tab' => false, 'link_rel' => '', ); $defaults[ 'footer-' . $_prefix . '-font-family' ] = 'inherit'; $defaults[ 'footer-' . $_prefix . '-font-weight' ] = 'inherit'; $defaults[ 'footer-' . $_prefix . '-text-transform' ] = ''; $defaults[ 'footer-' . $_prefix . '-line-height' ] = ''; $defaults[ 'footer-' . $_prefix . '-font-size' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'footer-' . $_prefix . '-text-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'footer-' . $_prefix . '-back-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'footer-' . $_prefix . '-text-h-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'footer-' . $_prefix . '-back-h-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'footer-' . $_prefix . '-padding' ] = array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'footer-' . $_prefix . '-border-size' ] = array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ); $defaults[ 'footer-' . $_prefix . '-border-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $footer_button_border_radius_fields = ! isset( $astra_options[ 'footer-' . $_prefix . '-border-radius-fields' ] ) && isset( $astra_options[ 'footer-' . $_prefix . '-border-radius' ] ) ? $astra_options[ 'footer-' . $_prefix . '-border-radius' ] : ''; $defaults[ 'footer-' . $_prefix . '-border-radius-fields' ] = array( 'desktop' => array( 'top' => $footer_button_border_radius_fields, 'right' => $footer_button_border_radius_fields, 'bottom' => $footer_button_border_radius_fields, 'left' => $footer_button_border_radius_fields, ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'footer-button-' . $index . '-alignment' ] = array( 'desktop' => 'center', 'tablet' => 'center', 'mobile' => 'center', ); $legacy_fb_button_padding = Astra_Builder_Helper::$default_responsive_spacing; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $builder_button_top_padding = isset( $astra_options[ 'section-fb-button-' . $index . '-padding' ]['desktop']['top'] ) ? $astra_options[ 'section-fb-button-' . $index . '-padding' ]['desktop']['top'] : $legacy_fb_button_padding['desktop']['top']; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $builder_button_right_padding = isset( $astra_options[ 'section-fb-button-' . $index . '-padding' ]['desktop']['right'] ) ? $astra_options[ 'section-fb-button-' . $index . '-padding' ]['desktop']['right'] : $legacy_fb_button_padding['desktop']['right']; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $builder_button_bottom_padding = isset( $astra_options[ 'section-fb-button-' . $index . '-padding' ]['desktop']['bottom'] ) ? $astra_options[ 'section-fb-button-' . $index . '-padding' ]['desktop']['bottom'] : $legacy_fb_button_padding['desktop']['bottom']; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $builder_button_left_padding = isset( $astra_options[ 'section-fb-button-' . $index . '-padding' ]['desktop']['left'] ) ? $astra_options[ 'section-fb-button-' . $index . '-padding' ]['desktop']['left'] : $legacy_fb_button_padding['desktop']['left']; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $defaults[ 'section-fb-button-' . $index . '-padding' ] = array( 'desktop' => array( 'top' => $astra_4_6_4_compatibility ? 15 : $builder_button_top_padding, 'right' => $astra_4_6_4_compatibility ? 30 : $builder_button_right_padding, 'bottom' => $astra_4_6_4_compatibility ? 15 : $builder_button_bottom_padding, 'left' => $astra_4_6_4_compatibility ? 30 : $builder_button_left_padding, ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'section-fb-button-' . $index . '-margin' ] = Astra_Builder_Helper::$default_responsive_spacing; $defaults[ 'footer-button' . $index . '-border-radius-fields' ] = array( 'desktop' => array( 'top' => $astra_4_6_4_compatibility ? 40 : '', 'right' => $astra_4_6_4_compatibility ? 40 : '', 'bottom' => $astra_4_6_4_compatibility ? 40 : '', 'left' => $astra_4_6_4_compatibility ? 40 : '', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); return $defaults; } /** * Prepare HTML Defaults. * * @param array $defaults defaults. * @param int $index index. */ function astra_prepare_html_defaults( $defaults, $index ) { $astra_options = Astra_Theme_Options::get_astra_options(); $_section = 'section-hb-html-' . $index; $defaults[ 'header-html-' . $index ] = __( 'Insert HTML text here.', 'astra' ); $defaults[ 'header-html-' . $index . 'color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-html-' . $index . 'link-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-html-' . $index . 'link-h-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'font-size-' . $_section ] = array( 'desktop' => 15, 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'font-weight-' . $_section ] = 'inherit'; $defaults[ 'font-family-' . $_section ] = 'inherit'; $defaults[ 'font-extras-' . $_section ] = array( 'line-height' => ! isset( $astra_options[ 'font-extras-' . $_section ] ) && isset( $astra_options[ 'line-height-' . $_section ] ) ? $astra_options[ 'line-height-' . $_section ] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options[ 'font-extras-' . $_section ] ) && isset( $astra_options[ 'text-transform-' . $_section ] ) ? $astra_options[ 'text-transform-' . $_section ] : '', 'text-decoration' => '', ); $defaults[ 'section-hb-html-' . $index . '-margin' ] = Astra_Builder_Helper::$default_responsive_spacing; $_section = 'section-fb-html-' . $index; $defaults[ 'footer-html-' . $index ] = __( 'Insert HTML text here.', 'astra' ); $defaults[ 'footer-html-' . $index . 'color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'footer-html-' . $index . 'link-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'footer-html-' . $index . 'link-h-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'font-size-' . $_section ] = array( 'desktop' => 15, 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'footer-html-' . $index . '-alignment' ] = array( 'desktop' => 'center', 'tablet' => 'center', 'mobile' => 'center', ); $defaults[ 'font-size-' . $_section ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'font-weight-' . $_section ] = 'inherit'; $defaults[ 'font-family-' . $_section ] = 'inherit'; $defaults[ 'font-extras-' . $_section ] = array( 'line-height' => ! isset( $astra_options[ 'font-extras-' . $_section ] ) && isset( $astra_options[ 'line-height-' . $_section ] ) ? $astra_options[ 'line-height-' . $_section ] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options[ 'font-extras-' . $_section ] ) && isset( $astra_options[ 'text-transform-' . $_section ] ) ? $astra_options[ 'text-transform-' . $_section ] : '', 'text-decoration' => '', ); $defaults[ 'section-fb-html-' . $index . '-margin' ] = Astra_Builder_Helper::$default_responsive_spacing; return $defaults; } /** * Prepare Social Icon Defaults. * * @param array $defaults defaults. * @param int $index index. */ function astra_prepare_social_icon_defaults( $defaults, $index ) { $astra_options = Astra_Theme_Options::get_astra_options(); $defaults[ 'header-social-' . $index . '-space' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-social-' . $index . '-bg-space' ] = ''; $defaults[ 'header-social-' . $index . '-size' ] = array( 'desktop' => 18, 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-social-' . $index . '-radius-fields' ] = array( 'desktop' => array( 'top' => ! isset( $astra_options[ 'header-social-' . $index . '-radius' ] ) ? '' : $astra_options[ 'header-social-' . $index . '-radius' ], 'right' => ! isset( $astra_options[ 'header-social-' . $index . '-radius' ] ) ? '' : $astra_options[ 'header-social-' . $index . '-radius' ], 'bottom' => ! isset( $astra_options[ 'header-social-' . $index . '-radius' ] ) ? '' : $astra_options[ 'header-social-' . $index . '-radius' ], 'left' => ! isset( $astra_options[ 'header-social-' . $index . '-radius' ] ) ? '' : $astra_options[ 'header-social-' . $index . '-radius' ], ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'header-social-' . $index . '-color' ] = ''; $defaults[ 'header-social-' . $index . '-h-color' ] = ''; $defaults[ 'header-social-' . $index . '-bg-color' ] = ''; $defaults[ 'header-social-' . $index . '-bg-h-color' ] = ''; $defaults[ 'header-social-' . $index . '-label-toggle' ] = false; $defaults[ 'header-social-' . $index . '-color-type' ] = 'custom'; $defaults[ 'header-social-' . $index . '-brand-hover-toggle' ] = false; $defaults[ 'font-size-section-hb-social-icons-' . $index ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'header-social-icons-' . $index ] = array( 'items' => array( array( 'id' => 'facebook', 'enabled' => true, 'source' => 'icon', 'url' => '', 'color' => '#557dbc', 'background' => 'transparent', 'icon' => 'facebook', 'label' => 'Facebook', ), array( 'id' => 'twitter', 'enabled' => true, 'source' => 'icon', 'url' => '', 'color' => '#7acdee', 'background' => 'transparent', 'icon' => 'twitter', 'label' => 'Twitter', ), array( 'id' => 'instagram', 'enabled' => true, 'source' => 'icon', 'url' => '', 'color' => '#8a3ab9', 'background' => 'transparent', 'icon' => 'instagram', 'label' => 'Instagram', ), ), ); $defaults[ 'section-hb-social-icons-' . $index . '-margin' ] = Astra_Builder_Helper::$default_responsive_spacing; $defaults[ 'footer-social-' . $index . '-space' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'footer-social-' . $index . '-bg-space' ] = ''; $defaults[ 'footer-social-' . $index . '-size' ] = array( 'desktop' => 18, 'tablet' => '', 'mobile' => '', ); $defaults[ 'footer-social-' . $index . '-radius' ] = ''; $defaults[ 'footer-social-' . $index . '-color' ] = ''; $defaults[ 'footer-social-' . $index . '-h-color' ] = ''; $defaults[ 'footer-social-' . $index . '-bg-color' ] = ''; $defaults[ 'footer-social-' . $index . '-bg-h-color' ] = ''; $defaults[ 'footer-social-' . $index . '-label-toggle' ] = false; $defaults[ 'footer-social-' . $index . '-color-type' ] = 'custom'; $defaults[ 'footer-social-' . $index . '-brand-color' ] = ''; $defaults[ 'footer-social-' . $index . '-brand-label-color' ] = ''; $defaults[ 'footer-social-' . $index . '-brand-hover-toggle' ] = false; $defaults[ 'font-size-section-fb-social-icons-' . $index ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'footer-social-icons-' . $index ] = array( 'items' => array( array( 'id' => 'facebook', 'enabled' => true, 'source' => 'icon', 'url' => '', 'color' => '#557dbc', 'background' => 'transparent', 'icon' => 'facebook', 'label' => 'Facebook', ), array( 'id' => 'twitter', 'enabled' => true, 'source' => 'icon', 'url' => '', 'color' => '#7acdee', 'background' => 'transparent', 'icon' => 'twitter', 'label' => 'Twitter', ), array( 'id' => 'instagram', 'enabled' => true, 'source' => 'icon', 'url' => '', 'color' => '#8a3ab9', 'background' => 'transparent', 'icon' => 'instagram', 'label' => 'Instagram', ), ), ); $defaults[ 'footer-social-' . $index . '-alignment' ] = array( 'desktop' => 'center', 'tablet' => 'center', 'mobile' => 'center', ); $defaults[ 'section-fb-social-icons-' . $index . '-margin' ] = Astra_Builder_Helper::$default_responsive_spacing; return $defaults; } /** * Prepare Widget Defaults. * * @param array $defaults defaults. * @param int $index index. */ function astra_prepare_widget_defaults( $defaults, $index ) { $astra_options = Astra_Theme_Options::get_astra_options(); $apply_new_default_color_typo_values = Astra_Dynamic_CSS::astra_check_default_color_typo(); // Widget Header defaults. // Colors. $defaults[ 'header-widget-' . $index . '-title-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-widget-' . $index . '-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-widget-' . $index . '-link-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-widget-' . $index . '-link-h-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); // Title Typography. $defaults[ 'header-widget-' . $index . '-font-family' ] = 'inherit'; $defaults[ 'header-widget-' . $index . '-font-weight' ] = 'inherit'; $defaults[ 'header-widget-' . $index . '-font-size' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'header-widget-' . $index . '-font-extras' ] = array( 'line-height' => ! isset( $astra_options[ 'header-widget-' . $index . '-font-extras' ] ) && isset( $astra_options[ 'header-widget-' . $index . '-line-height' ] ) ? $astra_options[ 'header-widget-' . $index . '-line-height' ] : '', 'line-height-unit' => 'em', 'letter-spacing' => ! isset( $astra_options[ 'header-widget-' . $index . '-font-extras' ] ) && isset( $astra_options[ 'header-widget-' . $index . '-letter-spacing' ] ) ? $astra_options[ 'header-widget-' . $index . '-letter-spacing' ] : '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options[ 'header-widget-' . $index . '-font-extras' ] ) && isset( $astra_options[ 'header-widget-' . $index . '-text-transform' ] ) ? $astra_options[ 'header-widget-' . $index . '-text-transform' ] : '', 'text-decoration' => '', ); // Content Typography. $defaults[ 'header-widget-' . $index . '-content-font-family' ] = 'inherit'; $defaults[ 'header-widget-' . $index . '-content-font-weight' ] = 'inherit'; $defaults[ 'header-widget-' . $index . '-content-font-size' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'header-widget-' . $index . '-content-font-extras' ] = array( 'line-height' => ! isset( $astra_options[ 'header-widget-' . $index . '-content-font-extras' ] ) && isset( $astra_options[ 'header-widget-' . $index . '-content-line-height' ] ) ? $astra_options[ 'header-widget-' . $index . '-content-line-height' ] : '', 'line-height-unit' => 'em', 'letter-spacing' => ! isset( $astra_options[ 'header-widget-' . $index . '-content-font-extras' ] ) && isset( $astra_options[ 'header-widget-' . $index . '-content-letter-spacing' ] ) ? $astra_options[ 'header-widget-' . $index . '-content-letter-spacing' ] : '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options[ 'header-widget-' . $index . '-content-font-extras' ] ) && isset( $astra_options[ 'header-widget-' . $index . '-content-transform' ] ) ? $astra_options[ 'header-widget-' . $index . '-content-transform' ] : '', 'text-decoration' => '', ); $defaults[ 'sidebar-widgets-header-widget-' . $index . '-margin' ] = Astra_Builder_Helper::$default_responsive_spacing; // Widget Footer defaults. // Colors. $defaults[ 'footer-widget-' . $index . '-title-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'footer-widget-' . $index . '-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'footer-widget-' . $index . '-link-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'footer-widget-' . $index . '-link-h-color' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); // Title Typography. $defaults[ 'footer-widget-' . $index . '-font-family' ] = 'inherit'; $defaults[ 'footer-widget-' . $index . '-font-weight' ] = 'inherit'; $defaults[ 'footer-widget-' . $index . '-text-transform' ] = ''; $defaults[ 'footer-widget-' . $index . '-line-height' ] = ''; $defaults[ 'footer-widget-' . $index . '-font-size' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); // Content Typography. $defaults[ 'footer-widget-' . $index . '-content-font-family' ] = 'inherit'; $defaults[ 'footer-widget-' . $index . '-content-font-weight' ] = 'inherit'; $defaults[ 'footer-widget-' . $index . '-content-font-extras' ] = array( 'line-height' => ! isset( $astra_options[ 'footer-widget-' . $index . '-content-font-extras' ] ) && isset( $astra_options[ 'footer-widget-' . $index . '-content-line-height' ] ) ? $astra_options[ 'footer-widget-' . $index . '-content-line-height' ] : '', 'line-height-unit' => 'em', 'letter-spacing' => ! isset( $astra_options[ 'footer-widget-' . $index . '-content-font-extras' ] ) && isset( $astra_options[ 'footer-widget-' . $index . '-content-letter-spacing' ] ) ? $astra_options[ 'footer-widget-' . $index . '-content-letter-spacing' ] : '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options[ 'footer-widget-' . $index . '-content-font-extras' ] ) && isset( $astra_options[ 'footer-widget-' . $index . '-content-transform' ] ) ? $astra_options[ 'footer-widget-' . $index . '-content-transform' ] : '', 'text-decoration' => '', ); $defaults[ 'footer-widget-' . $index . '-content-font-size' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'footer-widget-alignment-' . $index ] = array( 'desktop' => is_rtl() ? 'right' : 'left', 'tablet' => $apply_new_default_color_typo_values ? '' : 'center', 'mobile' => $apply_new_default_color_typo_values ? '' : 'center', ); $defaults[ 'sidebar-widgets-footer-widget-' . $index . '-margin' ] = Astra_Builder_Helper::$default_responsive_spacing; return $defaults; } /** * Prepare menu Defaults. * * @param array $defaults defaults. * @param int $index index. */ function astra_prepare_menu_defaults( $defaults, $index ) { /** * Update Astra default color and typography values. To not update directly on existing users site, added backwards. * * @since 4.0.0 */ $apply_new_default_color_typo_values = Astra_Dynamic_CSS::astra_check_default_color_typo(); $astra_options = Astra_Theme_Options::get_astra_options(); $_prefix = 'menu' . $index; // Specify all the default values for Menu from here. $defaults[ 'header-' . $_prefix . '-bg-color' ] = ''; $defaults[ 'header-' . $_prefix . '-color' ] = ''; $defaults[ 'header-' . $_prefix . '-h-bg-color' ] = ''; $defaults[ 'header-' . $_prefix . '-h-color' ] = ''; $defaults[ 'header-' . $_prefix . '-a-bg-color' ] = ''; $defaults[ 'header-' . $_prefix . '-a-color' ] = ''; $defaults[ 'header-' . $_prefix . '-bg-obj-responsive' ] = array( 'desktop' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'tablet' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'overlay-type' => '', 'overlay-color' => '', 'overlay-opacity' => '', 'overlay-gradient' => '', ), ); $defaults[ 'header-' . $_prefix . '-color-responsive' ] = array( 'desktop' => $apply_new_default_color_typo_values ? 'var(--ast-global-color-3)' : '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-' . $_prefix . '-h-bg-color-responsive' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-' . $_prefix . '-h-color-responsive' ] = array( 'desktop' => $apply_new_default_color_typo_values ? 'var(--ast-global-color-1)' : '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-' . $_prefix . '-a-bg-color-responsive' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-' . $_prefix . '-a-color-responsive' ] = array( 'desktop' => $apply_new_default_color_typo_values ? 'var(--ast-global-color-1)' : '', 'tablet' => '', 'mobile' => '', ); $defaults[ 'header-' . $_prefix . '-menu-hover-animation' ] = ''; $defaults[ 'header-' . $_prefix . '-submenu-container-animation' ] = ''; $defaults[ 'section-hb-menu-' . $index . '-margin' ] = Astra_Builder_Helper::$default_responsive_spacing; $defaults[ 'header-menu' . $index . '-menu-spacing' ] = Astra_Builder_Helper::$default_responsive_spacing; /** * Submenu */ $defaults[ 'header-' . $_prefix . '-submenu-item-border' ] = false; $defaults[ 'header-' . $_prefix . '-submenu-item-b-size' ] = '1'; $defaults[ 'header-' . $_prefix . '-submenu-item-b-color' ] = '#eaeaea'; $header_button_submenu_border_radius_fields = ! isset( $astra_options[ 'header-' . $_prefix . '-submenu-border-radius-fields' ] ) && isset( $astra_options[ 'header-' . $_prefix . '-submenu-border-radius' ] ) ? $astra_options[ 'header-' . $_prefix . '-submenu-border-radius' ] : ''; $defaults[ 'header-' . $_prefix . '-submenu-border-radius-fields' ] = array( 'desktop' => array( 'top' => $header_button_submenu_border_radius_fields, 'right' => $header_button_submenu_border_radius_fields, 'bottom' => $header_button_submenu_border_radius_fields, 'left' => $header_button_submenu_border_radius_fields, ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'header-' . $_prefix . '-submenu-top-offset' ] = ''; $defaults[ 'header-' . $_prefix . '-submenu-width' ] = ''; $defaults[ 'header-' . $_prefix . '-submenu-border' ] = array( 'top' => 2, 'bottom' => 0, 'left' => 0, 'right' => 0, ); /** * Menu Stack on Mobile. */ $defaults[ 'header-' . $_prefix . '-menu-stack-on-mobile' ] = true; /** * Menu - Typography. */ $defaults[ 'header-' . $_prefix . '-font-size' ] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults[ 'header-' . $_prefix . '-font-weight' ] = 'inherit'; $defaults[ 'header-' . $_prefix . '-font-family' ] = 'inherit'; $defaults[ 'header-' . $_prefix . '-font-extras' ] = array( 'line-height' => ! isset( $astra_options[ 'header-' . $_prefix . '-font-extras' ] ) && isset( $astra_options[ 'header-' . $_prefix . '-line-height' ] ) ? $astra_options[ 'header-' . $_prefix . '-line-height' ] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options[ 'header-' . $_prefix . '-font-extras' ] ) && isset( $astra_options[ 'header-' . $_prefix . '-text-transform' ] ) ? $astra_options[ 'header-' . $_prefix . '-text-transform' ] : '', 'text-decoration' => '', ); /** * Header Types - Defaults */ $defaults['transparent-header-main-sep'] = ''; $defaults['transparent-header-main-sep-color'] = ''; return $defaults; } builder/class-astra-builder-helper.php000064400000117226152266256010014037 0ustar00> */ public static $general_tab = array( array( 'setting' => 'ast_selected_tab', 'value' => 'general', ), ); /** * Config context general tab config. * * @var array> */ public static $general_tab_config = array( 'setting' => 'ast_selected_tab', 'value' => 'general', ); /** * Config context design tab. * * @var array> */ public static $design_tab = array( array( 'setting' => 'ast_selected_tab', 'value' => 'design', ), ); /** * Config context design tab. * * @var array> */ public static $design_tab_config = array( 'setting' => 'ast_selected_tab', 'value' => 'design', ); /** * Config Tablet device context. * * @var array> */ public static $tablet_device = array( array( 'setting' => 'ast_selected_device', 'operator' => 'in', 'value' => array( 'tablet' ), ), ); /** * Config Mobile device context. * * @var array> */ public static $mobile_device = array( array( 'setting' => 'ast_selected_device', 'operator' => 'in', 'value' => array( 'mobile' ), ), ); /** * Config Mobile device context. * * @var array> */ public static $responsive_devices = array( array( 'setting' => 'ast_selected_device', 'operator' => 'in', 'value' => array( 'tablet', 'mobile' ), ), ); /** * Config Mobile device context. * * @var array> */ public static $responsive_general_tab = array( array( 'setting' => 'ast_selected_tab', 'value' => 'general', ), array( 'setting' => 'ast_selected_device', 'operator' => 'in', 'value' => array( 'tablet', 'mobile' ), ), ); /** * Config Desktop device context. * * @var array> */ public static $desktop_general_tab = array( array( 'setting' => 'ast_selected_tab', 'value' => 'general', ), array( 'setting' => 'ast_selected_device', 'operator' => '==', 'value' => 'desktop', ), ); /** * Default responsive spacing control value. * * @var array> */ public static $default_responsive_spacing = array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); /** * Default button responsive spacing control value. * * @var array> */ public static $default_button_responsive_spacing = array( 'desktop' => array( 'top' => '12', 'right' => '20', 'bottom' => '12', 'left' => '20', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); /** * Config Tablet device context. * * @var array> */ public static $tablet_general_tab = array( array( 'setting' => 'ast_selected_tab', 'value' => 'general', ), array( 'setting' => 'ast_selected_device', 'operator' => '==', 'value' => 'tablet', ), ); /** * Config Mobile device context. * * @var array> */ public static $mobile_general_tab = array( array( 'setting' => 'ast_selected_tab', 'value' => 'general', ), array( 'setting' => 'ast_selected_device', 'operator' => '==', 'value' => 'mobile', ), ); /** * No. Of. Component Limit. * * @var int */ public static $component_limit = 10; /** * No. Of. Component count array. * * @var array */ public static $component_count_array = array(); /** * No. Of. Footer Widgets. * * @var int */ public static $num_of_footer_widgets; /** * No. Of. Footer HTML. * * @var int */ public static $num_of_footer_html; /** * No. Of. Header Widgets. * * @var int */ public static $num_of_header_widgets; /** * No. Of. Header Menu. * * @var int */ public static $num_of_header_menu; /** * No. Of. Header Buttons. * * @var int */ public static $num_of_header_button; /** * No. Of. Footer Buttons. * * @var int */ public static $num_of_footer_button; /** * No. Of. Header HTML. * * @var int */ public static $num_of_header_html; /** * No. Of. Footer Columns. * * @var int */ public static $num_of_footer_columns; /** * No. Of. Header Social Icons. * * @var int */ public static $num_of_header_social_icons; /** * No. Of. Footer Social Icons. * * @var int */ public static $num_of_footer_social_icons; /** * No. Of. Header Dividers. * * @since 3.0.0 * @var int */ public static $num_of_header_divider; /** * No. Of. Footer Dividers. * * @since 3.0.0 * @var int */ public static $num_of_footer_divider; /** * Check if migrated to new HFB. * * @var int|bool */ public static $is_header_footer_builder_active; /** * Footer Row layout * * @var array */ public static $footer_row_layouts; /** * Header Desktop Items * * @var array */ public static $header_desktop_items = null; /** * Footer Desktop Items * * @var array */ public static $footer_desktop_items = null; /** * Header Mobile Items * * @var array */ public static $header_mobile_items = null; /** * Member Variable * * @var mixed */ public static $loaded_grid = null; /** * Member Variable * * @var null instance */ private static $instance = null; /** * Member Variable * * @var grid_size_mapping */ public static $grid_size_mapping = array( '6-equal' => 'repeat( 6, 1fr )', '5-equal' => 'repeat( 5, 1fr )', '4-equal' => 'repeat( 4, 1fr )', '4-lheavy' => '2fr 1fr 1fr 1fr', '4-rheavy' => '1fr 1fr 1fr 2fr', '3-equal' => 'repeat( 3, 1fr )', '3-lheavy' => '2fr 1fr 1fr', '3-rheavy' => '1fr 1fr 2fr', '3-cheavy' => '1fr 2fr 1fr', '3-cwide' => '1fr 3fr 1fr', '3-firstrow' => '1fr 1fr', '3-lastrow' => '1fr 1fr', '2-equal' => 'repeat( 2, 1fr )', '2-lheavy' => '2fr 1fr', '2-rheavy' => '1fr 2fr', '2-full' => '2fr', 'full' => '1fr', ); /** * Initiator */ public static function get_instance() { if ( is_null( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /** * Constructor */ public function __construct() { self::$component_count_array = self::get_component_count(); self::$num_of_header_button = defined( 'ASTRA_EXT_VER' ) ? self::$component_count_array['header-button'] : 1; self::$num_of_footer_button = defined( 'ASTRA_EXT_VER' ) ? self::$component_count_array['footer-button'] : 0; self::$num_of_header_html = defined( 'ASTRA_EXT_VER' ) ? self::$component_count_array['header-html'] : 2; self::$num_of_footer_html = defined( 'ASTRA_EXT_VER' ) ? self::$component_count_array['footer-html'] : 2; self::$num_of_header_menu = defined( 'ASTRA_EXT_VER' ) ? self::$component_count_array['header-menu'] : 2; self::$num_of_header_widgets = defined( 'ASTRA_EXT_VER' ) ? self::$component_count_array['header-widget'] : 2; self::$num_of_footer_widgets = defined( 'ASTRA_EXT_VER' ) ? self::$component_count_array['footer-widget'] : 4; self::$num_of_header_social_icons = defined( 'ASTRA_EXT_VER' ) ? self::$component_count_array['header-social-icons'] : 1; self::$num_of_footer_social_icons = defined( 'ASTRA_EXT_VER' ) ? self::$component_count_array['footer-social-icons'] : 1; // Divider. self::$num_of_header_divider = defined( 'ASTRA_EXT_VER' ) ? self::$component_count_array['header-divider'] : 0; self::$num_of_footer_divider = defined( 'ASTRA_EXT_VER' ) ? self::$component_count_array['footer-divider'] : 0; self::$num_of_footer_columns = defined( 'ASTRA_EXT_VER' ) ? apply_filters( 'astra_footer_column_count', 6 ) : 6; add_action( 'init', array( $this, 'initialize' ) ); self::$is_header_footer_builder_active = self::is_header_footer_builder_active(); } /** * Initialize function. */ public function initialize() { self::$footer_row_layouts = apply_filters( 'astra_footer_row_layout', array( 'desktop' => array( '6' => array( '6-equal' => array( 'icon' => 'sixcol', ), ), '5' => array( '5-equal' => array( 'icon' => 'fivecol', ), ), '4' => array( '4-equal' => array( 'icon' => 'fourcol', ), '4-lheavy' => array( 'icon' => 'lfourforty', ), '4-rheavy' => array( 'icon' => 'rfourforty', ), ), '3' => array( '3-equal' => array( 'icon' => 'threecol', ), '3-lheavy' => array( 'icon' => 'lefthalf', ), '3-rheavy' => array( 'icon' => 'righthalf', ), '3-cheavy' => array( 'icon' => 'centerhalf', ), '3-cwide' => array( 'icon' => 'widecenter', ), ), '2' => array( '2-equal' => array( 'icon' => 'twocol', ), '2-lheavy' => array( 'icon' => 'twoleftgolden', ), '2-rheavy' => array( 'icon' => 'tworightgolden', ), ), '1' => array( 'full' => array( 'icon' => 'row', ), ), ), 'tablet' => array( '6' => array( '6-equal' => array( 'tooltip' => __( 'Equal Width Columns', 'astra' ), 'icon' => 'sixcol', ), 'full' => array( 'tooltip' => __( 'Collapse to Rows', 'astra' ), 'icon' => 'collapserowsix', ), ), '5' => array( '5-equal' => array( 'tooltip' => __( 'Equal Width Columns', 'astra' ), 'icon' => 'fivecol', ), 'full' => array( 'tooltip' => __( 'Collapse to Rows', 'astra' ), 'icon' => 'collapserowfive', ), ), '4' => array( '4-equal' => array( 'tooltip' => __( 'Equal Width Columns', 'astra' ), 'icon' => 'fourcol', ), '2-equal' => array( 'tooltip' => __( 'Two Column Grid', 'astra' ), 'icon' => 'grid', ), 'full' => array( 'tooltip' => __( 'Collapse to Rows', 'astra' ), 'icon' => 'collapserowfour', ), ), '3' => array( '3-equal' => array( 'tooltip' => __( 'Equal Width Columns', 'astra' ), 'icon' => 'threecol', ), '3-lheavy' => array( 'tooltip' => __( 'Left Heavy 50/25/25', 'astra' ), 'icon' => 'lefthalf', ), '3-rheavy' => array( 'tooltip' => __( 'Right Heavy 25/25/50', 'astra' ), 'icon' => 'righthalf', ), '3-cheavy' => array( 'tooltip' => __( 'Center Heavy 25/50/25', 'astra' ), 'icon' => 'centerhalf', ), '3-cwide' => array( 'tooltip' => __( 'Wide Center 20/60/20', 'astra' ), 'icon' => 'widecenter', ), '3-firstrow' => array( 'tooltip' => __( 'First Row, Next Columns 100 - 50/50', 'astra' ), 'icon' => 'firstrow', ), '3-lastrow' => array( 'tooltip' => __( 'Last Row, Previous Columns 50/50 - 100', 'astra' ), 'icon' => 'lastrow', ), 'full' => array( 'tooltip' => __( 'Collapse to Rows', 'astra' ), 'icon' => 'collapserowthree', ), ), '2' => array( '2-equal' => array( 'tooltip' => __( 'Equal Width Columns', 'astra' ), 'icon' => 'twocol', ), '2-lheavy' => array( 'tooltip' => __( 'Left Heavy 66/33', 'astra' ), 'icon' => 'twoleftgolden', ), '2-rheavy' => array( 'tooltip' => __( 'Right Heavy 33/66', 'astra' ), 'icon' => 'tworightgolden', ), 'full' => array( 'tooltip' => __( 'Collapse to Rows', 'astra' ), 'icon' => 'collapserow', ), ), '1' => array( 'full' => array( 'tooltip' => __( 'Single Row', 'astra' ), 'icon' => 'row', ), ), ), 'mobile' => array( '6' => array( '6-equal' => array( 'tooltip' => __( 'Equal Width Columns', 'astra' ), 'icon' => 'sixcol', ), 'full' => array( 'tooltip' => __( 'Collapse to Rows', 'astra' ), 'icon' => 'collapserowsix', ), ), '5' => array( '5-equal' => array( 'tooltip' => __( 'Equal Width Columns', 'astra' ), 'icon' => 'fivecol', ), 'full' => array( 'tooltip' => __( 'Collapse to Rows', 'astra' ), 'icon' => 'collapserowfive', ), ), '4' => array( '4-equal' => array( 'icon' => 'fourcol', ), '2-equal' => array( 'icon' => 'grid', ), 'full' => array( 'icon' => 'collapserowfour', ), ), '3' => array( '3-equal' => array( 'icon' => 'threecol', ), '3-lheavy' => array( 'icon' => 'lefthalf', ), '3-rheavy' => array( 'icon' => 'righthalf', ), '3-cheavy' => array( 'icon' => 'centerhalf', ), '3-cwide' => array( 'icon' => 'widecenter', ), '3-firstrow' => array( 'icon' => 'firstrow', ), '3-lastrow' => array( 'icon' => 'lastrow', ), 'full' => array( 'icon' => 'collapserowthree', ), ), '2' => array( '2-equal' => array( 'icon' => 'twocol', ), '2-lheavy' => array( 'icon' => 'twoleftgolden', ), '2-rheavy' => array( 'icon' => 'tworightgolden', ), 'full' => array( 'icon' => 'collapserow', ), ), '1' => array( 'full' => array( 'icon' => 'row', ), ), ), 'responsive' => true, ) ); self::$header_desktop_items = apply_filters( 'astra_header_desktop_items', array( 'logo' => array( 'name' => __( 'Site Title & Logo', 'astra' ), 'icon' => 'admin-appearance', 'section' => 'title_tagline', 'delete' => false, ), 'search' => array( 'name' => __( 'Search', 'astra' ), 'icon' => 'search', 'section' => 'section-header-search', 'delete' => false, ), 'account' => array( 'name' => __( 'Account', 'astra' ), 'icon' => 'admin-users', 'section' => 'section-header-account', 'delete' => false, ), ) ); // Add an additional item conditionally. if ( ! defined( 'ASTRA_EXT_VER' ) ) { $pro_header_desktop_items = array( 'divider-1' => array( 'name' => __( 'Divider 1', 'astra' ), 'icon' => 'minus', 'section' => 'section-hb-divider-1', 'pro' => true, ), 'divider-2' => array( 'name' => __( 'Divider 2', 'astra' ), 'icon' => 'minus', 'section' => 'section-hb-divider-2', 'pro' => true, ), 'divider-3' => array( 'name' => __( 'Divider 3', 'astra' ), 'icon' => 'minus', 'section' => 'section-hb-divider-3', 'pro' => true, ), 'language-switcher' => array( 'name' => __( 'Language Switcher', 'astra' ), 'icon' => 'translation', 'section' => 'section-hb-language-switcher', 'pro' => true, ), 'mobile-trigger' => array( 'name' => __( 'Toggle Button', 'astra' ), 'icon' => 'menu-alt', 'section' => 'section-header-mobile-trigger', 'pro' => true, ), 'mobile-menu' => array( 'name' => __( 'Off-Canvas Menu', 'astra' ), 'icon' => 'menu-alt', 'section' => 'section-header-mobile-menu', 'pro' => true, ), 'button-2' => array( 'name' => __( 'Button 2', 'astra' ), 'icon' => 'button', 'section' => 'section-hb-button-2', 'pro' => true, ), 'html-3' => array( 'name' => __( 'HTML 3', 'astra' ), 'icon' => 'editor-code', 'section' => 'section-hb-html-3', 'pro' => true, ), 'widget-3' => array( 'name' => __( 'Widget 3', 'astra' ), 'icon' => 'screenoptions', 'section' => 'sidebar-widgets-header-widget-3', 'pro' => true, ), 'widget-4' => array( 'name' => __( 'Widget 4', 'astra' ), 'icon' => 'screenoptions', 'section' => 'sidebar-widgets-header-widget-4', 'pro' => true, ), 'menu-3' => array( 'name' => __( 'Menu 3', 'astra' ), 'icon' => 'menu', 'section' => 'section-hb-menu-3', 'pro' => true, ), 'color-switcher' => array( 'name' => __( 'Color Switcher', 'astra' ), 'icon' => 'art', 'section' => 'section-header-color-switcher', 'pro' => true, ), ); // Merge the additional items into the existing header desktop items. self::$header_desktop_items = array_merge( self::$header_desktop_items, $pro_header_desktop_items ); } self::$footer_desktop_items = apply_filters( 'astra_footer_desktop_items', array( 'copyright' => array( 'name' => 'Copyright', 'icon' => 'nametag', 'section' => 'section-footer-copyright', 'delete' => false, ), 'menu' => array( 'name' => 'Footer Menu', 'icon' => 'menu', 'section' => 'section-footer-menu', 'delete' => false, ), ) ); // Add an additional item conditionally. if ( ! defined( 'ASTRA_EXT_VER' ) ) { $pro_footer_desktop_items = array( 'divider-1' => array( 'name' => __( 'Divider 1', 'astra' ), 'icon' => 'minus', 'pro' => true, ), 'divider-2' => array( 'name' => __( 'Divider 2', 'astra' ), 'icon' => 'minus', 'pro' => true, ), 'divider-3' => array( 'name' => __( 'Divider 3', 'astra' ), 'icon' => 'minus', 'pro' => true, ), 'widget-5' => array( 'name' => __( 'Widget 5', 'astra' ), 'icon' => 'screenoptions', 'pro' => true, ), 'widget-6' => array( 'name' => __( 'Widget 6', 'astra' ), 'icon' => 'screenoptions', 'pro' => true, ), 'button-1' => array( 'name' => __( 'Button 1', 'astra' ), 'icon' => 'button', 'pro' => true, ), 'button-2' => array( 'name' => __( 'Button 2', 'astra' ), 'icon' => 'button', 'pro' => true, ), ); // Merge the additional items into the existing header desktop items. self::$footer_desktop_items = array_merge( self::$footer_desktop_items, $pro_footer_desktop_items ); } if ( class_exists( 'Astra_Woocommerce' ) ) { $woo_cart_name = class_exists( 'Easy_Digital_Downloads' ) ? __( 'Woo Cart', 'astra' ) : __( 'Cart', 'astra' ); self::$header_desktop_items['woo-cart'] = array( 'name' => $woo_cart_name, 'icon' => 'cart', 'section' => 'section-header-woo-cart', ); } if ( class_exists( 'Easy_Digital_Downloads' ) ) { $edd_cart_name = class_exists( 'Astra_Woocommerce' ) ? __( 'EDD Cart', 'astra' ) : __( 'Cart', 'astra' ); self::$header_desktop_items['edd-cart'] = array( 'name' => $edd_cart_name, 'icon' => 'cart', 'section' => 'section-header-edd-cart', ); } self::$header_mobile_items = apply_filters( 'astra_header_mobile_items', array( 'logo' => array( 'name' => __( 'Site Title & Logo', 'astra' ), 'icon' => 'admin-appearance', 'section' => 'title_tagline', ), 'search' => array( 'name' => __( 'Search', 'astra' ), 'icon' => 'search', 'section' => 'section-header-search', ), 'mobile-trigger' => array( 'name' => __( 'Toggle Button', 'astra' ), 'icon' => 'menu-alt', 'section' => 'section-header-mobile-trigger', ), 'mobile-menu' => array( 'name' => __( 'Off-Canvas Menu', 'astra' ), 'icon' => 'menu-alt', 'section' => 'section-header-mobile-menu', ), 'account' => array( 'name' => __( 'Account', 'astra' ), 'icon' => 'admin-users', 'section' => 'section-header-account', ), ) ); // Add an additional item conditionally. if ( ! defined( 'ASTRA_EXT_VER' ) ) { $pro_header_mobile_items = array( 'divider-1' => array( 'name' => __( 'Divider 1', 'astra' ), 'icon' => 'minus', 'pro' => true, ), 'divider-2' => array( 'name' => __( 'Divider 2', 'astra' ), 'icon' => 'minus', 'pro' => true, ), 'divider-3' => array( 'name' => __( 'Divider 3', 'astra' ), 'icon' => 'minus', 'pro' => true, ), 'language-switcher' => array( 'name' => __( 'Language Switcher', 'astra' ), 'icon' => 'translation', 'pro' => true, ), 'button-2' => array( 'name' => __( 'Button 2', 'astra' ), 'icon' => 'button', 'pro' => true, ), 'html-3' => array( 'name' => __( 'HTML 3', 'astra' ), 'icon' => 'text', 'pro' => true, ), 'widget-3' => array( 'name' => __( 'Widget 3', 'astra' ), 'icon' => 'wordpress', 'pro' => true, ), 'widget-4' => array( 'name' => __( 'Widget 4', 'astra' ), 'icon' => 'wordpress', 'pro' => true, ), 'menu-3' => array( 'name' => __( 'Menu 3', 'astra' ), 'icon' => 'menu', 'pro' => true, ), 'color-switcher' => array( 'name' => __( 'Color Switcher', 'astra' ), 'icon' => 'art', 'section' => 'section-header-color-switcher', 'pro' => true, ), ); // Merge the additional items into the existing header desktop items. self::$header_mobile_items = array_merge( self::$header_mobile_items, $pro_header_mobile_items ); } if ( class_exists( 'Astra_Woocommerce' ) ) { self::$header_mobile_items['woo-cart'] = array( 'name' => $woo_cart_name, 'icon' => 'cart', 'section' => 'section-header-woo-cart', ); } if ( class_exists( 'Easy_Digital_Downloads' ) ) { self::$header_mobile_items['edd-cart'] = array( 'name' => $edd_cart_name, 'icon' => 'cart', 'section' => 'section-header-edd-cart', ); } add_filter( 'astra_addon_list', array( $this, 'deprecate_old_header_and_footer' ) ); } /** * Get count of all components. * * @since 3.0.0 * * @return int Number of all components. */ public static function get_component_count() { $component_keys_count = array( 'header-button' => 2, 'footer-button' => 2, 'header-html' => 2, 'footer-html' => 2, 'header-menu' => 2, 'header-widget' => 4, 'footer-widget' => 4, 'header-social-icons' => 1, 'footer-social-icons' => 1, 'header-divider' => 0, 'footer-divider' => 0, 'removed-items' => array(), ); $component_keys_count = array_merge( $component_keys_count, apply_filters( 'astra_builder_elements_count', $component_keys_count ) ); $skip_it_keys = array( 'removed-items', 'flag' ); foreach ( $component_keys_count as $component_type => $component_count ) { if ( in_array( $component_type, $skip_it_keys, true ) ) { continue; } $component_keys_count[ $component_type ] = min( $component_count, self::$component_limit ); } return $component_keys_count; } /** * Deprecate Header Sections, Mobile Headers, Footer Widgets for new users and migrated users. * * @since 3.0.0 * @param array $args The arguments as per the filter. * @return array $args Updated arguments as per the filter. */ public function deprecate_old_header_and_footer( $args ) { if ( self::$is_header_footer_builder_active ) { unset( $args['mobile-header'] ); unset( $args['header-sections'] ); unset( $args['advanced-footer'] ); } return $args; } /** * For existing users, do not load the wide/full width image CSS by default. * * @since 3.0.0 * @return bool false if it is an existing user , true if not. */ public static function is_header_footer_builder_active() { $astra_settings = astra_get_options(); return apply_filters( 'astra_is_header_footer_builder_active', isset( $astra_settings['is-header-footer-builder'] ) ? (bool) $astra_settings['is-header-footer-builder'] : true ); } /** * Check if Migrated to new Astra Builder. */ public static function is_new_user() { return astra_get_option( 'header-footer-builder-notice', true ); } /** * Adds a check to see if the side columns should run. * * @param string $row the name of the row. */ public static function has_mobile_side_columns( $row = 'primary' ) { $mobile_sides = false; $elements = astra_get_option( 'header-mobile-items' ); if ( isset( $elements ) && isset( $elements[ $row ] ) ) { if ( ( isset( $elements[ $row ][ $row . '_left' ] ) && is_array( $elements[ $row ][ $row . '_left' ] ) && ! empty( $elements[ $row ][ $row . '_left' ] ) ) || ( isset( $elements[ $row ][ $row . '_left_center' ] ) && is_array( $elements[ $row ][ $row . '_left_center' ] ) && ! empty( $elements[ $row ][ $row . '_left_center' ] ) ) || ( isset( $elements[ $row ][ $row . '_right_center' ] ) && is_array( $elements[ $row ][ $row . '_right_center' ] ) && ! empty( $elements[ $row ][ $row . '_right_center' ] ) ) || ( isset( $elements[ $row ][ $row . '_right' ] ) && is_array( $elements[ $row ][ $row . '_right' ] ) && ! empty( $elements[ $row ][ $row . '_right' ] ) ) ) { $mobile_sides = true; } } return $mobile_sides; } /** * Adds a check to see if the center column should run. * * @param string $row the name of the row. */ public static function has_mobile_center_column( $row = 'primary' ) { $mobile_center = false; $elements = astra_get_option( 'header-mobile-items' ); if ( isset( $elements ) && isset( $elements[ $row ] ) && isset( $elements[ $row ][ $row . '_center' ] ) && is_array( $elements[ $row ][ $row . '_center' ] ) && ! empty( $elements[ $row ][ $row . '_center' ] ) ) { $mobile_center = true; } return $mobile_center; } /** * Adds support to render header columns. * * @param string $row the name of the row. * @param string $column the name of the column. * @param string $header the name of the header. * @param string $builder the name of the builder. */ public static function render_builder_markup( $row = 'primary', $column = 'left', $header = 'desktop', $builder = 'header' ) { $elements = astra_get_option( $builder . '-' . $header . '-items' ); if ( isset( $elements ) && isset( $elements[ $row ] ) && isset( $elements[ $row ][ $row . '_' . $column ] ) && is_array( $elements[ $row ][ $row . '_' . $column ] ) && ! empty( $elements[ $row ][ $row . '_' . $column ] ) ) { foreach ( $elements[ $row ][ $row . '_' . $column ] as $item ) { if ( astra_wp_version_compare( '5.4.99', '>=' ) ) { get_template_part( 'template-parts/' . $builder . '/builder/components', '', array( 'type' => $item, 'device' => $header, ) ); } else { set_query_var( 'type', $item ); get_template_part( 'template-parts/' . $builder . '/builder/components' ); } } } } /** * Adds support to render Mobile Popup Markup. */ public static function render_mobile_popup_markup() { if ( ! self::is_component_loaded( 'mobile-trigger', 'header' ) && ! is_customize_preview() ) { return; } $off_canvas_slide = astra_get_option( 'off-canvas-slide' ); $mobile_header_type = astra_get_option( 'mobile-header-type' ); $content_alignment = astra_get_option( 'header-offcanvas-content-alignment' ); $side_class = 'content-align-' . $content_alignment . ' '; if ( $mobile_header_type ) { if ( 'off-canvas' === $mobile_header_type ) { if ( $off_canvas_slide ) { if ( 'left' === $off_canvas_slide ) { $side_class .= 'ast-mobile-popup-left'; } else { $side_class .= 'ast-mobile-popup-right'; } } } else { $side_class .= 'ast-mobile-popup-full-width'; } } ?>
$row_grids ) { $components = array(); if ( ! empty( $row_grids ) ) { foreach ( $row_grids as $row => $grid ) { if ( ! in_array( $row, array( 'below', 'above', 'primary', 'popup' ) ) ) { continue; } if ( ! is_array( $grid ) ) { continue; } $result = array_values( $grid ); if ( is_array( $result ) ) { $loaded_component = call_user_func_array( 'array_merge', $result ); $components[] = is_array( $loaded_component ) ? $loaded_component : array(); } } } $loaded_components[ $grid_row ] = call_user_func_array( 'array_merge', $components ); } } if ( ! empty( $loaded_components ) ) { // For both devices(mobile & desktop). $loaded_components['header_both'] = array_merge( $loaded_components['header_desktop'], $loaded_components['header_mobile'] ); // For All device and builder type. $all_components = call_user_func_array( 'array_merge', array_values( $loaded_components ) ); $loaded_components['all'] = array_unique( $all_components ); } self::$loaded_grid = $loaded_components; } $loaded_components = self::$loaded_grid; if ( 'all' === $builder_type && ! empty( $loaded_components['all'] ) ) { $is_loaded = in_array( $component_id, $loaded_components['all'], true ); } else { $is_loaded = in_array( $component_id, $loaded_components[ $builder_type . '_' . $device ], true ); } return $is_loaded || is_customize_preview(); } /** * For existing users, do not apply dynamic CSS chages. * * @since 3.3.0 * @return bool true if it is an existing user , false if not. */ public static function apply_flex_based_css() { $astra_settings = astra_get_options(); return apply_filters( 'astra_apply_flex_based_css', isset( $astra_settings['is-flex-based-css'] ) ? $astra_settings['is-flex-based-css'] : true ); } /** * Member Variable * * @var array Translatable dynamic strings. */ public static $translatable_strings = array(); /** * Method to return translatable strings for builder components. * * @since 4.8.4 */ public static function get_translatable_strings() { if ( empty( self::$translatable_strings ) ) { // Count is 10 because component limit is set to 10 in $component_limit. self::$translatable_strings = array( // Header button components. 'header-button1-text' => _x( '%astra%', 'Builder: Header Button 1 Text', 'astra' ), 'header-button2-text' => _x( '%astra%', 'Builder: Header Button 2 Text', 'astra' ), 'header-button3-text' => _x( '%astra%', 'Builder: Header Button 3 Text', 'astra' ), 'header-button4-text' => _x( '%astra%', 'Builder: Header Button 4 Text', 'astra' ), 'header-button5-text' => _x( '%astra%', 'Builder: Header Button 5 Text', 'astra' ), 'header-button6-text' => _x( '%astra%', 'Builder: Header Button 6 Text', 'astra' ), 'header-button7-text' => _x( '%astra%', 'Builder: Header Button 7 Text', 'astra' ), 'header-button8-text' => _x( '%astra%', 'Builder: Header Button 8 Text', 'astra' ), 'header-button9-text' => _x( '%astra%', 'Builder: Header Button 9 Text', 'astra' ), 'header-button10-text' => _x( '%astra%', 'Builder: Header Button 10 Text', 'astra' ), // Footer button components. 'footer-button1-text' => _x( '%astra%', 'Builder: Footer Button 1 Text', 'astra' ), 'footer-button2-text' => _x( '%astra%', 'Builder: Footer Button 2 Text', 'astra' ), 'footer-button3-text' => _x( '%astra%', 'Builder: Footer Button 3 Text', 'astra' ), 'footer-button4-text' => _x( '%astra%', 'Builder: Footer Button 4 Text', 'astra' ), 'footer-button5-text' => _x( '%astra%', 'Builder: Footer Button 5 Text', 'astra' ), 'footer-button6-text' => _x( '%astra%', 'Builder: Footer Button 6 Text', 'astra' ), 'footer-button7-text' => _x( '%astra%', 'Builder: Footer Button 7 Text', 'astra' ), 'footer-button8-text' => _x( '%astra%', 'Builder: Footer Button 8 Text', 'astra' ), 'footer-button9-text' => _x( '%astra%', 'Builder: Footer Button 9 Text', 'astra' ), 'footer-button10-text' => _x( '%astra%', 'Builder: Footer Button 10 Text', 'astra' ), // Header HTML components. 'header-html-1' => _x( '%astra%', 'Builder: Header HTML 1', 'astra' ), 'header-html-2' => _x( '%astra%', 'Builder: Header HTML 2', 'astra' ), 'header-html-3' => _x( '%astra%', 'Builder: Header HTML 3', 'astra' ), 'header-html-4' => _x( '%astra%', 'Builder: Header HTML 4', 'astra' ), 'header-html-5' => _x( '%astra%', 'Builder: Header HTML 5', 'astra' ), 'header-html-6' => _x( '%astra%', 'Builder: Header HTML 6', 'astra' ), 'header-html-7' => _x( '%astra%', 'Builder: Header HTML 7', 'astra' ), 'header-html-8' => _x( '%astra%', 'Builder: Header HTML 8', 'astra' ), 'header-html-9' => _x( '%astra%', 'Builder: Header HTML 9', 'astra' ), 'header-html-10' => _x( '%astra%', 'Builder: Header HTML 10', 'astra' ), // Footer HTML components. 'footer-html-1' => _x( '%astra%', 'Builder: Footer HTML 1', 'astra' ), 'footer-html-2' => _x( '%astra%', 'Builder: Footer HTML 2', 'astra' ), 'footer-html-3' => _x( '%astra%', 'Builder: Footer HTML 3', 'astra' ), 'footer-html-4' => _x( '%astra%', 'Builder: Footer HTML 4', 'astra' ), 'footer-html-5' => _x( '%astra%', 'Builder: Footer HTML 5', 'astra' ), 'footer-html-6' => _x( '%astra%', 'Builder: Footer HTML 6', 'astra' ), 'footer-html-7' => _x( '%astra%', 'Builder: Footer HTML 7', 'astra' ), 'footer-html-8' => _x( '%astra%', 'Builder: Footer HTML 8', 'astra' ), 'footer-html-9' => _x( '%astra%', 'Builder: Footer HTML 9', 'astra' ), 'footer-html-10' => _x( '%astra%', 'Builder: Footer HTML 10', 'astra' ), ); // Old header button. self::$translatable_strings['header-main-rt-section-button-text'] = _x( '%astra%', 'Button text for last item in Primary Menu', 'astra' ); } return self::$translatable_strings; } /** * Method to return single translatable string for builder components. * * @param string $option_key Option key for the translated dynamic string. * * @since 4.8.4 */ public static function get_translatable_string( $option_key ) { $strings = self::get_translatable_strings(); if ( isset( $strings[ $option_key ] ) ) { return $strings[ $option_key ]; } return '%astra%'; // Indicates to use original string saved in the database. } } /** * Prepare if class 'Astra_Builder_Helper' exist. * Kicking this off by calling 'get_instance()' method */ Astra_Builder_Helper::get_instance(); class-astra-icons.php000064400000033612152266256010010615 0ustar00 array( 'class' => array() ), 'svg' => array( 'xmlns:xlink' => array(), 'version' => array(), 'id' => array(), 'x' => array(), 'y' => array(), 'enable-background' => array(), 'xml:space' => array(), 'class' => array(), 'aria-hidden' => array(), 'aria-labelledby' => array(), 'role' => array(), 'xmlns' => array(), 'width' => array(), 'height' => array(), 'viewbox' => array(), 'fill' => array(), 'stroke' => array(), 'stroke-width' => array(), 'stroke-linecap' => array(), 'stroke-linejoin' => array(), ), 'title' => array( 'title' => array() ), 'g' => array( 'fill' => array(), 'stroke' => array(), 'transform' => array(), ), 'path' => array( 'd' => array(), 'fill' => array(), 'stroke' => array(), 'stroke-width' => array(), 'fill-rule' => array(), ), 'circle' => array( 'cx' => array(), 'cy' => array(), 'r' => array(), 'fill' => array(), 'stroke' => array(), 'stroke-width' => array(), ), 'rect' => array( 'x' => array(), 'y' => array(), 'width' => array(), 'height' => array(), 'rx' => array(), 'ry' => array(), 'fill' => array(), 'stroke' => array(), 'stroke-width' => array(), ), 'line' => array( 'x1' => array(), 'y1' => array(), 'x2' => array(), 'y2' => array(), 'stroke' => array(), 'stroke-width' => array(), ), 'polygon' => array( 'points' => array(), 'fill' => array(), 'stroke' => array(), 'stroke-width' => array(), ), 'polyline' => array( 'points' => array(), 'fill' => array(), 'stroke' => array(), 'stroke-width' => array(), ), 'ellipse' => array( 'cx' => array(), 'cy' => array(), 'rx' => array(), 'ry' => array(), 'fill' => array(), 'stroke' => array(), 'stroke-width' => array(), ), 'defs' => array(), 'clipPath' => array( 'id' => array(), ), 'use' => array( 'xlink:href' => array(), 'href' => array(), // modern SVG2. ), ); } /** * Get SVG icons. * Returns the SVG icon you want to display. * * @since 3.3.0 * * @param string $icon Key for the SVG you want to load. * @param bool $is_echo whether to echo the output or return. * @param bool $replace load close markup for SVG. * @param string $menu_location Creates dynamic filter for passed parameter. * * @return string SVG for passed key. */ public static function get_icons( $icon, $is_echo = false, $replace = false, $menu_location = 'main' ) { $output = ''; if ( true === self::is_svg_icons() ) { switch ( $icon ) { case 'menu-bars': $output = ' '; break; case 'close': $output = ''; break; case 'search': $output = ' '; break; case 'arrow': $output = ' '; break; case 'cart': $output = ' '; break; case 'bag': $output = ' '; break; case 'basket': $output = ' '; break; default: $output = ''; break; } if ( $replace ) { $output .= ' '; } } else { if ( 'menu-bars' === $icon ) { $menu_icon = apply_filters( 'astra_' . $menu_location . '_menu_toggle_icon', 'menu-toggle-icon' ); $output = ''; } } $output = apply_filters( 'astra_svg_icon_element', $output, $icon ); $classes = array( 'ast-icon', 'icon-' . $icon, ); /** * @psalm-suppress TooManyArguments */ $output = apply_filters( 'astra_svg_icon', // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound sprintf( '%2$s', implode( ' ', $classes ), $output ), $icon ); if ( $is_echo !== true ) { return wp_kses( $output, self::allowed_svg_args() ); } echo wp_kses( $output, self::allowed_svg_args() ); } } new Astra_Icons(); class-theme-strings.php000064400000012122152266256010011154 0ustar00 __( '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_dynamic_string, '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', 'astra' ) . ' ', 'string-blog-navigation-previous' => ' ' . __( 'Previous', 'astra' ), 'string-next-text' => __( 'Next', 'astra' ), 'string-previous-text' => __( 'Previous', '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', 'astra' ) . ' '; $defaults['string-blog-navigation-previous'] = ' ' . __( 'Previous', '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; } } } class-astra-enqueue-scripts.php000064400000064546152266256010012650 0ustar00 tag in admin page * * @param String $classes body classes returned from the filter. * @return String body classes to be added to tag in admin page */ public function admin_body_class( $classes ) { global $pagenow; $screen = get_current_screen(); if ( true === apply_filters( 'astra_block_editor_hover_effect', true ) ) { $classes .= ' ast-highlight-wpblock-onhover'; } if ( ( 'post-new.php' === $pagenow || 'post.php' === $pagenow ) && ( defined( 'ASTRA_ADVANCED_HOOKS_POST_TYPE' ) && ASTRA_ADVANCED_HOOKS_POST_TYPE === $screen->post_type ) || 'widgets.php' === $pagenow ) { return $classes; } $post_id = get_the_ID(); $is_boxed = astra_is_content_style_boxed( $post_id ); $is_sidebar_boxed = astra_is_sidebar_style_boxed( $post_id ); $classes .= $is_boxed ? ' ast-default-content-style-boxed' : ' ast-default-content-unboxed'; $classes .= $is_sidebar_boxed ? ' ast-default-sidebar-style-boxed' : ' ast-default-sidebar-unboxed'; if ( $post_id ) { $meta_content_layout = astra_toggle_layout( 'ast-site-content-layout', 'meta', $post_id ); } if ( ( isset( $meta_content_layout ) && ! empty( $meta_content_layout ) ) && 'default' !== $meta_content_layout ) { $content_layout = $meta_content_layout; } else { $content_layout = astra_toggle_layout( 'ast-site-content-layout', 'global', false ); } $editor_default_content_layout = astra_toggle_layout( 'single-' . strval( get_post_type() ) . '-ast-content-layout', 'single', false ); if ( 'default' === $editor_default_content_layout || empty( $editor_default_content_layout ) ) { // Get the GLOBAL content layout value. // NOTE: Here not used `true` in the below function call. $editor_default_content_layout = astra_toggle_layout( 'ast-site-content-layout', 'global', false ); $editor_default_content_layout = astra_apply_boxed_layouts( $editor_default_content_layout, $is_boxed, $is_sidebar_boxed, $post_id ); $classes .= ' ast-default-layout-' . $editor_default_content_layout; } else { $editor_default_content_layout = astra_apply_boxed_layouts( $editor_default_content_layout, $is_boxed, $is_sidebar_boxed, $post_id ); $classes .= ' ast-default-layout-' . $editor_default_content_layout; } $content_layout = astra_apply_boxed_layouts( $content_layout, $is_boxed, $is_sidebar_boxed, $post_id ); 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'; } elseif ( 'narrow-container' === $content_layout ) { $classes .= ' ast-narrow-container'; } $site_layout = astra_get_option( 'site-layout' ); if ( 'ast-box-layout' === $site_layout ) { $classes .= ' ast-max-width-layout'; } // block CSS class. if ( astra_block_based_legacy_setup() ) { $classes .= ' ast-block-legacy'; } else { $classes .= ' ast-block-custom'; } $classes .= ' ast-' . astra_page_layout(); $classes .= ' ast-sidebar-default-' . astra_get_sidebar_layout_for_editor( strval( get_post_type() ) ); return $classes; } /** * List of all assets. * * @return array assets array. */ public static function theme_assets() { $default_assets = array( // handle => location ( in /assets/js/ ) ( without .js ext). 'js' => array( 'astra-theme-js' => 'style', ), // handle => location ( in /assets/css/ ) ( without .css ext). 'css' => array( 'astra-theme-css' => Astra_Builder_Helper::apply_flex_based_css() ? 'style-flex' : 'style', ), ); if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { $default_assets = array( // handle => location ( in /assets/js/ ) ( without .js ext). 'js' => array( 'astra-theme-js' => 'frontend', ), // handle => location ( in /assets/css/ ) ( without .css ext). 'css' => array( 'astra-theme-css' => Astra_Builder_Helper::apply_flex_based_css() ? 'main' : 'frontend', ), ); if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '3.5.9', '<' ) ) { $default_assets['js']['astra-theme-js-pro'] = 'frontend-pro'; } if ( ( class_exists( 'Easy_Digital_Downloads' ) && Astra_Builder_Helper::is_component_loaded( 'edd-cart', 'header' ) ) || ( class_exists( 'WooCommerce' ) && Astra_Builder_Helper::is_component_loaded( 'woo-cart', 'header' ) && self::should_load_woocommerce_js() ) ) { $default_assets['js']['astra-mobile-cart'] = 'mobile-cart'; } /** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( ( true === Astra_Builder_Helper::$is_header_footer_builder_active && Astra_Builder_Helper::is_component_loaded( 'search', 'header' ) && astra_get_option( 'live-search', false ) ) || ( is_search() && true === astra_get_option( 'ast-search-live-search' ) ) ) { /** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $default_assets['js']['astra-live-search'] = 'live-search'; } if ( class_exists( 'WooCommerce' ) && self::should_load_woocommerce_js() ) { if ( is_product() && astra_get_option( 'single-product-sticky-add-to-cart' ) ) { $default_assets['js']['astra-sticky-add-to-cart'] = 'sticky-add-to-cart'; } if ( ! is_customize_preview() ) { $astra_shop_add_to_cart = astra_get_option( 'shop-add-to-cart-action' ); if ( $astra_shop_add_to_cart && 'default' !== $astra_shop_add_to_cart ) { $default_assets['js']['astra-shop-add-to-cart'] = 'shop-add-to-cart'; } } /** @psalm-suppress UndefinedFunction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $astra_add_to_cart_quantity_btn_enabled = apply_filters( 'astra_add_to_cart_quantity_btn_enabled', astra_get_option( 'single-product-plus-minus-button' ) ); if ( $astra_add_to_cart_quantity_btn_enabled ) { $default_assets['js']['astra-add-to-cart-quantity-btn'] = 'add-to-cart-quantity-btn'; } } } if ( astra_get_option( 'site-sticky-sidebar', false ) ) { $default_assets['js']['astra-sticky-sidebar'] = 'sticky-sidebar'; } 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 ); } /** * Check if WooCommerce JS assets should be loaded based on filter settings * * @return bool Whether WooCommerce JS should be loaded * @since 4.11.13 */ public static function should_load_woocommerce_js() { // Allow users to disable WooCommerce JS loading on specific pages/posts/post types return apply_filters( 'astra_load_woocommerce_js', true ); } /** * Check if WooCommerce CSS assets should be loaded based on filter settings * * @return bool Whether WooCommerce CSS should be loaded * @since 4.11.13 */ public static function should_load_woocommerce_css() { // Allow users to disable WooCommerce CSS loading on specific pages/posts/post types return apply_filters( 'astra_load_woocommerce_css', true ); } /** * 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/minified/'; /** * IE Only Js and CSS Files. */ // Flexibility.js for flexbox IE10 support. wp_enqueue_script( 'astra-flexibility', $js_uri . 'flexibility' . $file_prefix . '.js', array(), ASTRA_THEME_VERSION, false ); wp_add_inline_script( 'astra-flexibility', 'flexibility(document.documentElement);' ); wp_script_add_data( 'astra-flexibility', 'conditional', 'IE' ); // Polyfill for CustomEvent for IE. wp_register_script( 'astra-customevent', $js_uri . 'custom-events-polyfill' . $file_prefix . '.js', array(), ASTRA_THEME_VERSION, false ); wp_register_style( 'astra-galleries-css', $css_uri . 'galleries.min.css', array(), ASTRA_THEME_VERSION, 'all' ); // All assets. $all_assets = self::theme_assets(); $styles = $all_assets['css']; $scripts = $all_assets['js']; if ( is_array( $styles ) && ! empty( $styles ) ) { // Register & Enqueue Styles. foreach ( $styles as $key => $style ) { $dependency = array(); // Add dynamic CSS dependency for all styles except for theme's style.css. if ( 'astra-theme-css' !== $key && class_exists( 'Astra_Cache_Base' ) ) { if ( ! Astra_Cache_Base::inline_assets() ) { $dependency[] = 'astra-theme-dynamic'; } } // Generate CSS URL. $css_file = $css_uri . $style . '.min.css'; // Register. wp_register_style( $key, $css_file, $dependency, ASTRA_THEME_VERSION, 'all' ); // Enqueue. wp_enqueue_style( $key ); // RTL support. wp_style_add_data( $key, 'rtl', 'replace' ); } } // Fonts - Render Fonts. Astra_Fonts::render_fonts(); /** * Inline styles */ add_filter( 'astra_dynamic_theme_css', array( 'Astra_Dynamic_CSS', 'return_output' ) ); add_filter( 'astra_dynamic_theme_css', array( 'Astra_Dynamic_CSS', 'return_meta_output' ) ); $menu_animation = astra_get_option( 'header-main-submenu-container-animation' ); // Submenu Container Animation for header builder. if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { for ( $index = 1; $index <= Astra_Builder_Helper::$component_limit; $index++ ) { $menu_animation_enable = astra_get_option( 'header-menu' . $index . '-submenu-container-animation' ); if ( Astra_Builder_Helper::is_component_loaded( 'menu-' . $index, 'header' ) && ! empty( $menu_animation_enable ) ) { $menu_animation = 'is_animated'; break; } } } $rtl = is_rtl() ? '-rtl' : ''; if ( ! empty( $menu_animation ) || is_customize_preview() ) { if ( class_exists( 'Astra_Cache' ) ) { Astra_Cache::add_css_file( ASTRA_THEME_DIR . 'assets/css/minified/menu-animation' . $rtl . '.min.css' ); } else { wp_register_style( 'astra-menu-animation', $css_uri . 'menu-animation.min.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 ) { // Set dependencies based on script type. $dependencies = array(); if ( 'astra-mobile-cart' === $key && class_exists( 'WooCommerce' ) ) { $dependencies = array( 'jquery', 'wc-add-to-cart' ); } // Register. wp_register_script( $key, $js_uri . $script . $file_prefix . '.js', $dependencies, ASTRA_THEME_VERSION, true ); // Enqueue. wp_enqueue_script( $key ); } } /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $quantity_type = defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'woocommerce' ) ? astra_get_option( 'cart-plus-minus-button-type' ) : 'normal'; /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $astra_localize = array( 'break_point' => astra_header_break_point(), // Header Break Point. 'isRtl' => is_rtl(), 'is_scroll_to_id' => astra_get_option( 'enable-scroll-to-id' ), 'is_scroll_to_top' => astra_get_option( 'scroll-to-top-enable' ), 'is_header_footer_builder_active' => Astra_Builder_Helper::$is_header_footer_builder_active, 'responsive_cart_click' => astra_get_option( 'responsive-cart-click-action' ), 'is_dark_palette' => Astra_Global_Palette::is_dark_palette(), ); wp_localize_script( 'astra-theme-js', 'astra', apply_filters( 'astra_theme_js_localize', $astra_localize ) ); $astra_qty_btn_localize = array( 'plus_qty' => __( 'Plus Quantity', 'astra' ), 'minus_qty' => __( 'Minus Quantity', 'astra' ), 'style_type' => $quantity_type, // Quantity button type. ); wp_localize_script( 'astra-add-to-cart-quantity-btn', 'astra_qty_btn', apply_filters( 'astra_qty_btn_js_localize', $astra_qty_btn_localize ) ); $astra_cart_localize_data = array( 'desktop_layout' => astra_get_option( 'woo-header-cart-click-action' ), // WooCommerce sidebar flyout desktop. 'responsive_cart_click' => astra_get_option( 'responsive-cart-click-action' ), // WooCommerce responsive devices flyout. ); wp_localize_script( 'astra-mobile-cart', 'astra_cart', apply_filters( 'astra_cart_js_localize', $astra_cart_localize_data ) ); if ( ( true === Astra_Builder_Helper::$is_header_footer_builder_active && Astra_Builder_Helper::is_component_loaded( 'search', 'header' ) && astra_get_option( 'live-search', false ) ) || ( is_search() && true === astra_get_option( 'ast-search-live-search' ) ) ) { $search_post_types = array(); $search_post_type_label = array(); $search_within_val = astra_get_option( 'live-search-post-types' ); if ( ! empty( $search_within_val ) && is_array( $search_within_val ) ) { foreach ( $search_within_val as $post_type => $value ) { if ( $value && post_type_exists( $post_type ) ) { $search_post_types[] = $post_type; /** @psalm-suppress PossiblyNullPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $post_type_object = get_post_type_object( $post_type ); $search_post_type_label[ $post_type ] = is_object( $post_type_object ) && isset( $post_type_object->labels->name ) ? esc_html( $post_type_object->labels->name ) : $post_type; /** @psalm-suppress PossiblyNullPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort } } } $search_page_post_types = array(); $search_page_post_type_label = array(); $search_page_within_val = astra_get_option( 'ast-search-live-search-post-types' ); if ( is_search() && ! empty( $search_page_within_val ) && is_array( $search_page_within_val ) ) { foreach ( $search_page_within_val as $post_type => $value ) { if ( $value && post_type_exists( $post_type ) ) { $search_page_post_types[] = $post_type; /** @psalm-suppress PossiblyNullPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $post_type_object = get_post_type_object( $post_type ); $search_page_post_type_label[ $post_type ] = is_object( $post_type_object ) && isset( $post_type_object->labels->name ) ? esc_html( $post_type_object->labels->name ) : $post_type; /** @psalm-suppress PossiblyNullPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort } } } $astra_live_search_localize_data = array( 'rest_api_url' => get_rest_url(), 'search_posts_per_page' => astra_get_option( 'live-search-result-count' ), 'search_post_types' => $search_post_types, 'search_post_types_labels' => $search_post_type_label, 'search_language' => astra_get_current_language_slug(), 'no_live_results_found' => __( 'No results found', 'astra' ), 'search_page_condition' => is_search() && true === astra_get_option( 'ast-search-live-search' ) ? true : false, 'search_page_post_types' => $search_page_post_types, 'search_page_post_type_labels' => $search_page_post_type_label, ); wp_localize_script( 'astra-live-search', 'astra_search', apply_filters( 'astra_search_js_localize', $astra_live_search_localize_data ) ); } if ( class_exists( 'woocommerce' ) && self::should_load_woocommerce_js() ) { $is_astra_pro = function_exists( 'astra_has_pro_woocommerce_addon' ) ? astra_has_pro_woocommerce_addon() : false; $astra_shop_add_to_cart_localize_data = array( 'shop_add_to_cart_action' => astra_get_option( 'shop-add-to-cart-action' ), 'cart_url' => wc_get_cart_url(), 'checkout_url' => wc_get_checkout_url(), 'is_astra_pro' => $is_astra_pro, ); wp_localize_script( 'astra-shop-add-to-cart', 'astra_shop_add_to_cart', apply_filters( 'astra_shop_add_to_cart_js_localize', $astra_shop_add_to_cart_localize_data ) ); } $sticky_sidebar = astra_get_option( 'site-sticky-sidebar', false ); if ( $sticky_sidebar ) { /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $sticky_header_addon = ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'sticky-header' ) ); /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $astra_sticky_sidebar_localize_data = array( 'sticky_sidebar_on' => $sticky_sidebar, 'header_above_height' => astra_get_option( 'hba-header-height' ), 'header_height' => astra_get_option( 'hb-header-height' ), 'header_below_height' => astra_get_option( 'hbb-header-height' ), 'header_above_stick' => astra_get_option( 'header-above-stick', false ), 'header_main_stick' => astra_get_option( 'header-main-stick', false ), 'header_below_stick' => astra_get_option( 'header-below-stick', false ), 'sticky_header_addon' => $sticky_header_addon, 'desktop_breakpoint' => astra_get_tablet_breakpoint( '', 1 ), ); wp_localize_script( 'astra-sticky-sidebar', 'astra_sticky_sidebar', apply_filters( 'astra_sticky_sidebar_js_localize', $astra_sticky_sidebar_localize_data ) ); } } /** * 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'; } $js_uri = ASTRA_THEME_URI . 'inc/assets/js/block-editor-script.js'; /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort wp_enqueue_script( 'astra-block-editor-script', $js_uri, false, ASTRA_THEME_VERSION, 'all' ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $content_bg_obj = astra_get_option( 'content-bg-obj-responsive' ); $site_bg_obj = astra_get_option( 'site-layout-outside-bg-obj-responsive' ); $site_builder_url = admin_url( 'admin.php?page=theme-builder' ); /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $is_astra_pro_colors_activated = ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) ); /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $astra_global_palette_instance = new Astra_Global_Palette(); $astra_colors = array( 'var(--ast-global-color-0)' => $astra_global_palette_instance->get_color_by_palette_variable( 'var(--ast-global-color-0)' ), 'var(--ast-global-color-1)' => $astra_global_palette_instance->get_color_by_palette_variable( 'var(--ast-global-color-1)' ), 'var(--ast-global-color-2)' => $astra_global_palette_instance->get_color_by_palette_variable( 'var(--ast-global-color-2)' ), 'var(--ast-global-color-3)' => $astra_global_palette_instance->get_color_by_palette_variable( 'var(--ast-global-color-3)' ), 'var(--ast-global-color-4)' => $astra_global_palette_instance->get_color_by_palette_variable( 'var(--ast-global-color-4)' ), 'var(--ast-global-color-5)' => $astra_global_palette_instance->get_color_by_palette_variable( 'var(--ast-global-color-5)' ), 'var(--ast-global-color-6)' => $astra_global_palette_instance->get_color_by_palette_variable( 'var(--ast-global-color-6)' ), 'var(--ast-global-color-7)' => $astra_global_palette_instance->get_color_by_palette_variable( 'var(--ast-global-color-7)' ), 'var(--ast-global-color-8)' => $astra_global_palette_instance->get_color_by_palette_variable( 'var(--ast-global-color-8)' ), 'ast_wp_version_higher_6_3' => astra_wp_version_compare( '6.2.99', '>' ), 'ast_wp_version_higher_6_4' => astra_wp_version_compare( '6.4.99', '>' ), 'is_dark_palette' => Astra_Global_Palette::is_dark_palette(), 'apply_content_bg_fullwidth' => astra_apply_content_background_fullwidth_layouts(), 'customizer_content_bg_obj' => $content_bg_obj, 'customizer_site_bg_obj' => $site_bg_obj, 'is_astra_pro_colors_activated' => $is_astra_pro_colors_activated, 'site_builder_url' => $site_builder_url, 'mobile_logo' => astra_get_option( 'mobile-header-logo' ), 'mobile_logo_state' => astra_get_option( 'different-mobile-logo' ), ); wp_localize_script( 'astra-block-editor-script', 'astraColors', apply_filters( 'astra_theme_root_colors', $astra_colors ) ); // Render fonts in Gutenberg layout. Astra_Fonts::render_fonts(); if ( astra_block_based_legacy_setup() ) { $css_uri = ASTRA_THEME_URI . 'inc/assets/css/block-editor-styles' . $rtl . '.css'; /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort wp_enqueue_style( 'astra-block-editor-styles', $css_uri, false, ASTRA_THEME_VERSION, 'all' ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort wp_add_inline_style( 'astra-block-editor-styles', apply_filters( 'astra_block_editor_dynamic_css', Gutenberg_Editor_CSS::get_css() ) ); } else { $css_uri = ASTRA_THEME_URI . 'inc/assets/css/wp-editor-styles' . $rtl . '.css'; /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort wp_enqueue_style( 'astra-wp-editor-styles', $css_uri, false, ASTRA_THEME_VERSION, 'all' ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort wp_add_inline_style( 'astra-wp-editor-styles', apply_filters( 'astra_block_editor_dynamic_css', Astra_WP_Editor_CSS::get_css() ) ); } } /** * Function to check if enqueuing of Astra assets are disabled. * * @since 2.1.0 * @return bool */ public static function enqueue_theme_assets() { return apply_filters( 'astra_enqueue_theme_assets', true ); } /** * Enqueue galleries relates CSS on gallery_style filter. * * @param string $gallery_style gallery style and div. * @since 3.5.0 * @return string */ public function enqueue_galleries_style( $gallery_style ) { wp_enqueue_style( 'astra-galleries-css' ); return $gallery_style; } } new Astra_Enqueue_Scripts(); } theme-hooks.php000064400000021704152266256010007511 0ustar00 * // 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