From 9d4123cee1867ee7199b06bdc92d40611f547ecc Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 21 Jul 2021 14:54:07 -0500 Subject: Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/. --- .../class-astra-related-posts-loader.php | 194 ++++ .../class-astra-related-posts-markup.php | 393 ++++++++ .../related-posts/class-astra-related-posts.php | 48 + inc/modules/related-posts/css/dynamic-css.php | 207 ++++ inc/modules/related-posts/css/static-css.php | 92 ++ .../class-astra-related-posts-configs.php | 1065 ++++++++++++++++++++ 6 files changed, 1999 insertions(+) create mode 100644 inc/modules/related-posts/class-astra-related-posts-loader.php create mode 100644 inc/modules/related-posts/class-astra-related-posts-markup.php create mode 100644 inc/modules/related-posts/class-astra-related-posts.php create mode 100644 inc/modules/related-posts/css/dynamic-css.php create mode 100644 inc/modules/related-posts/css/static-css.php create mode 100644 inc/modules/related-posts/customizer/class-astra-related-posts-configs.php (limited to 'inc/modules/related-posts') diff --git a/inc/modules/related-posts/class-astra-related-posts-loader.php b/inc/modules/related-posts/class-astra-related-posts-loader.php new file mode 100644 index 0000000..845fd42 --- /dev/null +++ b/inc/modules/related-posts/class-astra-related-posts-loader.php @@ -0,0 +1,194 @@ + '2-equal', + 'tablet' => '2-equal', + 'mobile' => 'full', + ); + $defaults['related-posts-structure'] = array( + 'featured-image', + 'title-meta', + ); + $defaults['related-posts-meta-structure'] = array( + 'comments', + 'category', + 'author', + ); + // Related Posts - Color styles. + $defaults['related-posts-text-color'] = ''; + $defaults['related-posts-link-color'] = ''; + $defaults['related-posts-title-color'] = ''; + $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'] = ''; + $defaults['related-posts-section-title-font-size'] = array( + 'desktop' => '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'] = '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', + ); + + // 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', + ); + + // Related Posts - Content typo. + $defaults['related-posts-content-font-family'] = 'inherit'; + $defaults['related-posts-content-font-weight'] = 'inherit'; + $defaults['related-posts-content-text-transform'] = ''; + $defaults['related-posts-content-line-height'] = ''; + $defaults['related-posts-content-font-size'] = array( + 'desktop' => '', + 'tablet' => '', + 'mobile' => '', + 'desktop-unit' => 'px', + 'tablet-unit' => 'px', + 'mobile-unit' => 'px', + ); + + 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(); diff --git a/inc/modules/related-posts/class-astra-related-posts-markup.php b/inc/modules/related-posts/class-astra-related-posts-markup.php new file mode 100644 index 0000000..14655bf --- /dev/null +++ b/inc/modules/related-posts/class-astra-related-posts-markup.php @@ -0,0 +1,393 @@ + 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_option( 'related-posts-title' ); + $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 ) ); + + // 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(); + $output_str = astra_get_post_meta( $related_post_meta ); + + if ( is_array( $exclude_ids ) && ! in_array( $post_id, $exclude_ids ) ) { + + if ( false === $related_posts_section_loaded ) { + + echo ''; + + $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 ); + + if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { + $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(); diff --git a/inc/modules/related-posts/class-astra-related-posts.php b/inc/modules/related-posts/class-astra-related-posts.php new file mode 100644 index 0000000..3e8b7cd --- /dev/null +++ b/inc/modules/related-posts/class-astra-related-posts.php @@ -0,0 +1,48 @@ + Post Title typography dyanamic stylings. + $related_post_title_font_family = astra_get_option( 'related-posts-title-font-family' ); + $related_post_title_font_weight = astra_get_option( 'related-posts-title-font-weight' ); + $related_post_title_font_size = astra_get_option( 'related-posts-title-font-size' ); + $related_post_title_line_height = astra_get_option( 'related-posts-title-line-height' ); + $related_post_title_text_transform = astra_get_option( 'related-posts-title-text-transform' ); + + // Related Posts -> Post Meta typography dyanamic stylings. + $related_post_meta_font_family = astra_get_option( 'related-posts-meta-font-family' ); + $related_post_meta_font_weight = astra_get_option( 'related-posts-meta-font-weight' ); + $related_post_meta_font_size = astra_get_option( 'related-posts-meta-font-size' ); + $related_post_meta_line_height = astra_get_option( 'related-posts-meta-line-height' ); + $related_post_meta_text_transform = astra_get_option( 'related-posts-meta-text-transform' ); + + // Related Posts -> Content typography dyanamic stylings. + $related_post_content_font_family = astra_get_option( 'related-posts-content-font-family' ); + $related_post_content_font_weight = astra_get_option( 'related-posts-content-font-weight' ); + $related_post_content_font_size = astra_get_option( 'related-posts-content-font-size' ); + $related_post_content_line_height = astra_get_option( 'related-posts-content-line-height' ); + $related_post_content_text_transform = astra_get_option( 'related-posts-content-text-transform' ); + + // Related Posts -> Section Title typography dyanamic stylings. + $related_posts_section_title_font_family = astra_get_option( 'related-posts-section-title-font-family' ); + $related_posts_section_title_font_size = astra_get_option( 'related-posts-section-title-font-size' ); + $related_posts_section_title_font_weight = astra_get_option( 'related-posts-section-title-font-weight' ); + $related_posts_section_title_line_height = astra_get_option( 'related-posts-section-title-line-height' ); + $related_posts_section_title_text_transform = astra_get_option( 'related-posts-section-title-text-transform' ); + + // 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 dyanamic stylings. + $related_posts_title_color = astra_get_option( 'related-posts-title-color' ); + $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' ); + + $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' => array( + 'color' => esc_attr( $related_posts_title_color ), + 'font-family' => astra_get_css_value( $related_posts_section_title_font_family, 'font' ), + 'font-weight' => astra_get_css_value( $related_posts_section_title_font_weight, 'font' ), + 'font-size' => astra_responsive_font( $related_posts_section_title_font_size, 'desktop' ), + 'line-height' => esc_attr( $related_posts_section_title_line_height ), + 'text-transform' => esc_attr( $related_posts_section_title_text_transform ), + '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' => array( + 'font-family' => astra_get_css_value( $related_post_title_font_family, 'font' ), + 'font-weight' => astra_get_css_value( $related_post_title_font_weight, 'font' ), + 'font-size' => astra_responsive_font( $related_post_title_font_size, 'desktop' ), + 'line-height' => esc_attr( $related_post_title_line_height ), + 'text-transform' => esc_attr( $related_post_title_text_transform ), + 'color' => esc_attr( $related_post_text_color ), + ), + /** + * Related Posts - Meta + */ + '.ast-related-post-content .entry-meta, .ast-related-post-content .entry-meta *' => array( + 'font-family' => astra_get_css_value( $related_post_meta_font_family, 'font' ), + 'font-weight' => astra_get_css_value( $related_post_meta_font_weight, 'font' ), + 'font-size' => astra_responsive_font( $related_post_meta_font_size, 'desktop' ), + 'line-height' => esc_attr( $related_post_meta_line_height ), + 'text-transform' => esc_attr( $related_post_meta_text_transform ), + 'color' => esc_attr( $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' => array( + 'font-family' => astra_get_css_value( $related_post_content_font_family, 'font' ), + 'font-weight' => astra_get_css_value( $related_post_content_font_weight, 'font' ), + 'font-size' => astra_responsive_font( $related_post_content_font_size, 'desktop' ), + 'line-height' => esc_attr( $related_post_content_line_height ), + 'text-transform' => esc_attr( $related_post_content_text_transform ), + 'color' => esc_attr( $related_post_text_color ), + ), + ); + + $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 .ast-related-post-title' => 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' ), + ), + ); + + $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 .ast-related-post-title' => 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' ), + ), + ); + + $dynamic_css .= astra_parse_css( $css_max_mobile_output, '', astra_get_mobile_breakpoint() ); + + return $dynamic_css; + } + + return $dynamic_css; +} diff --git a/inc/modules/related-posts/css/static-css.php b/inc/modules/related-posts/css/static-css.php new file mode 100644 index 0000000..84e68e8 --- /dev/null +++ b/inc/modules/related-posts/css/static-css.php @@ -0,0 +1,92 @@ + ASTRA_THEME_SETTINGS . '[enable-related-posts]', + 'default' => astra_get_option( 'enable-related-posts' ), + 'type' => 'control', + 'control' => 'ast-toggle-control', + 'title' => __( 'Enable Related Posts', 'astra' ), + 'section' => 'section-blog-single', + 'priority' => 10, + ), + + /** + * 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' ), + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', + 'operator' => '==', + 'value' => true, + ), + ), + 'priority' => 11, + ), + + /** + * Option: Related Posts Title + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[related-posts-title]', + 'default' => astra_get_option( 'related-posts-title' ), + 'type' => 'control', + 'section' => 'section-blog-single', + 'priority' => 11, + 'title' => __( 'Title', 'astra' ), + 'control' => 'text', + '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' => 'section-blog-single', + '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' => 'section-blog-single', + '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' => array( + 'featured-image' => __( 'Featured Image', 'astra' ), + 'title-meta' => __( 'Title & Post Meta', 'astra' ), + ), + 'divider' => array( 'ast_class' => 'ast-top-divider' ), + ), + + 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' => 'section-blog-single', + 'priority' => 12, + 'title' => __( 'Meta', 'astra' ), + 'choices' => array( + 'comments' => __( 'Comments', 'astra' ), + 'category' => __( 'Category', 'astra' ), + 'author' => __( 'Author', 'astra' ), + 'date' => __( 'Publish Date', 'astra' ), + 'tag' => __( 'Tag', 'astra' ), + ), + ), + + /** + * 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' => 'section-blog-single', + 'priority' => 12, + 'context' => array( + Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', + 'operator' => '==', + 'value' => true, + ), + ), + ), + + /** + * 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' => 'section-blog-single', + 'title' => __( 'Excerpt Word Count', 'astra' ), + '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' => 'section-blog-single', + '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' => 'section-blog-single', + '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' => 'section-blog-single', + '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' => 'section-blog-single', + 'priority' => 1, + 'control' => 'ast-selector', + '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' => 'section-blog-single', + 'type' => 'sub-control', + 'priority' => 2, + 'transport' => 'postMessage', + 'title' => __( 'Order by', 'astra' ), + 'control' => 'ast-select', + 'choices' => array( + 'date' => __( 'Date', 'astra' ), + 'title' => __( 'Title', 'astra' ), + 'post-order' => __( 'Post Order', 'astra' ), + 'random' => __( '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' => 'section-blog-single', + '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', + ), + + /** + * 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( + true === Astra_Builder_Helper::$is_header_footer_builder_active ? + Astra_Builder_Helper::$design_tab_config : 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', + ), + ), + 'title' => __( 'Content Colors', 'astra' ), + 'section' => 'section-blog-single', + 'priority' => 15, + ), + + /** + * 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', + 'context' => array( + true === Astra_Builder_Helper::$is_header_footer_builder_active ? + Astra_Builder_Helper::$design_tab_config : 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' => '', + ), + ), + 'title' => __( 'Section Title Font', 'astra' ), + 'section' => 'section-blog-single', + '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( + true === Astra_Builder_Helper::$is_header_footer_builder_active ? + Astra_Builder_Helper::$design_tab_config : 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', + ), + ), + 'title' => __( 'Post Title Font', 'astra' ), + 'section' => 'section-blog-single', + '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( + true === Astra_Builder_Helper::$is_header_footer_builder_active ? + Astra_Builder_Helper::$design_tab_config : 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', + ), + ), + 'title' => __( 'Meta Font', 'astra' ), + 'section' => 'section-blog-single', + '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', + 'context' => array( + true === Astra_Builder_Helper::$is_header_footer_builder_active ? + Astra_Builder_Helper::$design_tab_config : 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, + ), + ), + 'title' => __( 'Content Font', 'astra' ), + 'section' => 'section-blog-single', + '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' => 'section-blog-single', + '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' => 'section-blog-single', + 'default' => astra_get_option( 'related-posts-link-color' ), + 'transport' => 'postMessage', + 'control' => 'ast-color', + 'title' => __( 'Link Color', 'astra' ), + ), + + /** + * Option: Related Posts Query + */ + array( + 'name' => ASTRA_THEME_SETTINGS . '[related-posts-design-section-heading]', + 'section' => 'section-blog-single', + 'type' => 'control', + 'control' => 'ast-heading', + 'title' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? __( 'Related Posts', 'astra' ) : __( 'Related Posts Design', 'astra' ), + 'context' => array( + true === Astra_Builder_Helper::$is_header_footer_builder_active ? + Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', + 'operator' => '==', + 'value' => true, + ), + ), + 'priority' => 14, + ), + + /** + * 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' => 'section-blog-single', + 'transport' => 'postMessage', + 'priority' => 14, + 'context' => array( + true === Astra_Builder_Helper::$is_header_footer_builder_active ? + Astra_Builder_Helper::$design_tab_config : 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' => '', + ), + ), + 'title' => __( 'Section Title', 'astra' ), + ), + + /** + * 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' => 'section-blog-single', + 'transport' => 'postMessage', + 'priority' => 14, + 'context' => array( + true === Astra_Builder_Helper::$is_header_footer_builder_active ? + Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config, + array( + 'setting' => ASTRA_THEME_SETTINGS . '[enable-related-posts]', + 'operator' => '==', + 'value' => true, + ), + ), + 'title' => __( 'Section Background', 'astra' ), + ), + + /** + * 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' => 'section-blog-single', + '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' => 'section-blog-single', + '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' => 'section-blog-single', + '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' => 'section-blog-single', + 'type' => 'sub-control', + 'control' => 'ast-font', + 'font_type' => 'ast-font-family', + 'default' => astra_get_option( 'related-posts-title-font-family' ), + 'title' => __( 'Family', 'astra' ), + 'connect' => ASTRA_THEME_SETTINGS . '[related-posts-title-font-weight]', + ), + + /** + * Option: Related Posts Title Font Size + */ + array( + 'name' => 'related-posts-title-font-size', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-title-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'control' => 'ast-responsive', + 'default' => astra_get_option( 'related-posts-title-font-size' ), + 'transport' => 'postMessage', + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Related Posts Title Font Weight + */ + array( + 'name' => 'related-posts-title-font-weight', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-title-typography-group]', + 'section' => 'section-blog-single', + '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' => __( 'Weight', 'astra' ), + 'connect' => 'related-posts-title-font-family', + ), + + /** + * Option: Related Posts Title Text Transform + */ + array( + 'name' => 'related-posts-title-text-transform', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-title-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'title' => __( 'Text Transform', 'astra' ), + 'default' => astra_get_option( 'related-posts-title-text-transform' ), + 'transport' => 'postMessage', + 'control' => 'ast-select', + 'choices' => array( + '' => __( 'Inherit', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + ), + + /** + * Option: Related Posts Title Line Height + */ + array( + 'name' => 'related-posts-title-line-height', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-title-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'related-posts-title-line-height' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'title' => __( 'Line Height', 'astra' ), + 'control' => 'ast-slider', + 'suffix' => '', + 'input_attrs' => array( + 'min' => 1, + 'step' => 1, + 'max' => 5, + ), + ), + + /** + * 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' => 'section-blog-single', + 'type' => 'sub-control', + 'control' => 'ast-font', + 'font_type' => 'ast-font-family', + 'default' => astra_get_option( 'related-posts-section-title-font-family' ), + 'title' => __( 'Family', 'astra' ), + 'connect' => ASTRA_THEME_SETTINGS . '[related-posts-section-title-font-weight]', + ), + + /** + * 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' => 'section-blog-single', + 'type' => 'sub-control', + 'control' => 'ast-responsive', + 'default' => astra_get_option( 'related-posts-section-title-font-size' ), + 'transport' => 'postMessage', + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * 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' => 'section-blog-single', + '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' => __( 'Weight', 'astra' ), + 'connect' => 'related-posts-section-title-font-family', + ), + + /** + * Option: Related Posts Title Text Transform + */ + array( + 'name' => 'related-posts-section-title-text-transform', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-section-title-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'title' => __( 'Text Transform', 'astra' ), + 'default' => astra_get_option( 'related-posts-section-title-text-transform' ), + 'transport' => 'postMessage', + 'control' => 'ast-select', + 'choices' => array( + '' => __( 'Inherit', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + ), + + /** + * Option: Related Posts Title Line Height + */ + array( + 'name' => 'related-posts-section-title-line-height', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-section-title-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'related-posts-section-title-line-height' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'title' => __( 'Line Height', 'astra' ), + 'control' => 'ast-slider', + 'suffix' => '', + 'input_attrs' => array( + 'min' => 1, + 'step' => 1, + 'max' => 5, + ), + ), + + /** + * Option: Related Posts Meta Font Family + */ + array( + 'name' => 'related-posts-meta-font-family', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'control' => 'ast-font', + 'font_type' => 'ast-font-family', + 'default' => astra_get_option( 'related-posts-meta-font-family' ), + 'title' => __( 'Family', 'astra' ), + 'connect' => ASTRA_THEME_SETTINGS . '[related-posts-meta-font-weight]', + ), + + /** + * Option: Related Posts Meta Font Size + */ + array( + 'name' => 'related-posts-meta-font-size', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'control' => 'ast-responsive', + 'default' => astra_get_option( 'related-posts-meta-font-size' ), + 'transport' => 'postMessage', + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Related Posts Meta Font Weight + */ + array( + 'name' => 'related-posts-meta-font-weight', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-typography-group]', + 'section' => 'section-blog-single', + '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' => __( 'Weight', 'astra' ), + 'connect' => 'related-posts-meta-font-family', + ), + + /** + * Option: Related Posts Meta Text Transform + */ + array( + 'name' => 'related-posts-meta-text-transform', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'title' => __( 'Text Transform', 'astra' ), + 'default' => astra_get_option( 'related-posts-meta-text-transform' ), + 'transport' => 'postMessage', + 'control' => 'ast-select', + 'choices' => array( + '' => __( 'Inherit', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + ), + + /** + * Option: Related Posts Meta Line Height + */ + array( + 'name' => 'related-posts-meta-line-height', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-meta-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'related-posts-meta-line-height' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'title' => __( 'Line Height', 'astra' ), + 'control' => 'ast-slider', + 'suffix' => '', + 'input_attrs' => array( + 'min' => 1, + 'step' => 1, + 'max' => 5, + ), + ), + + /** + * Option: Related Posts Content Font Family + */ + array( + 'name' => 'related-posts-content-font-family', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-content-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'control' => 'ast-font', + 'font_type' => 'ast-font-family', + 'default' => astra_get_option( 'related-posts-content-font-family' ), + 'title' => __( 'Family', 'astra' ), + 'connect' => ASTRA_THEME_SETTINGS . '[related-posts-content-font-weight]', + ), + + /** + * Option: Related Posts Content Font Size + */ + array( + 'name' => 'related-posts-content-font-size', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-content-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'control' => 'ast-responsive', + 'default' => astra_get_option( 'related-posts-content-font-size' ), + 'transport' => 'postMessage', + 'title' => __( 'Size', 'astra' ), + 'input_attrs' => array( + 'min' => 0, + ), + 'units' => array( + 'px' => 'px', + 'em' => 'em', + ), + ), + + /** + * Option: Related Posts Content Font Weight + */ + array( + 'name' => 'related-posts-content-font-weight', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-content-typography-group]', + 'section' => 'section-blog-single', + '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' => __( 'Weight', 'astra' ), + 'connect' => 'related-posts-content-font-family', + ), + + /** + * Option: Related Posts Content Text Transform + */ + array( + 'name' => 'related-posts-content-text-transform', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-content-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'title' => __( 'Text Transform', 'astra' ), + 'default' => astra_get_option( 'related-posts-content-text-transform' ), + 'transport' => 'postMessage', + 'control' => 'ast-select', + 'choices' => array( + '' => __( 'Inherit', 'astra' ), + 'none' => __( 'None', 'astra' ), + 'capitalize' => __( 'Capitalize', 'astra' ), + 'uppercase' => __( 'Uppercase', 'astra' ), + 'lowercase' => __( 'Lowercase', 'astra' ), + ), + ), + + /** + * Option: Related Posts Content Line Height + */ + array( + 'name' => 'related-posts-content-line-height', + 'parent' => ASTRA_THEME_SETTINGS . '[related-posts-content-typography-group]', + 'section' => 'section-blog-single', + 'type' => 'sub-control', + 'transport' => 'postMessage', + 'default' => astra_get_option( 'related-posts-content-line-height' ), + 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ), + 'title' => __( 'Line Height', 'astra' ), + 'control' => 'ast-slider', + 'suffix' => '', + 'input_attrs' => array( + 'min' => 1, + 'step' => 1, + 'max' => 5, + ), + ), + ); + + $configurations = array_merge( $configurations, $_configs ); + + return $configurations; + } +} + +/** + * Kicking this off by creating NEW instance. + */ +new Astra_Related_Posts_Configs(); -- cgit v1.2.3-70-g09d2