PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.5.6
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.5.6
4.5.6 4.5.5 4.5.4 4.2.1 4.2.2 4.2.3 4.5.0 4.5.2 4.5.3 4.2.0 4.1.18 4.1.17 4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.0.9 4.1.0 4.1.1 4.1.2 All 148 releases
← All changes | modules/harold-list/widgets/harold-list.php +32 -13 4.0.9 → 4.5.6 View file →
@@ -132,8 +132,9 @@
132 132 $this->add_group_control(
133 133 Group_Control_Image_Size::get_type(),
134 134 [
135 135 'name' => 'primary_thumbnail',
136 + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour.
136 137 'exclude' => ['custom'],
137 138 'default' => 'medium',
138 139 ]
139 140 );
@@ -162,8 +163,11 @@
162 163 ],
163 164 'default' => [
164 165 'size' => 6,
165 166 ],
167 + 'condition' => [
168 + 'posts_source!' => 'current_query',
169 + ]
166 170 ]
167 171 );
168 172
169 173 $this->register_query_builder_controls();
@@ -542,9 +546,9 @@
542 546 [
543 547 'label' => esc_html__('Hover Color', 'ultimate-post-kit'),
544 548 'type' => Controls_Manager::COLOR,
545 549 'selectors' => [
546 - '{{WRAPPER}} .upk-harold-list .upk-item .upk-item-box .upk-content .upk-meta .upk-author a:hover' => 'color: {{VALUE}};',
550 + '{{WRAPPER}} .upk-harold-list .upk-item .upk-item-box .upk-content .upk-meta .upk-author a:hover *' => 'color: {{VALUE}};',
547 551 ],
548 552 ]
549 553 );
550 554
@@ -586,9 +590,9 @@
586 590 Group_Control_Typography::get_type(),
587 591 [
588 592 'name' => 'meta_typography',
589 593 'label' => esc_html__('Typography', 'ultimate-post-kit'),
590 - 'selector' => '{{WRAPPER}} .upk-harold-list .upk-item .upk-item-box .upk-content .upk-meta',
594 + 'selector' => '{{WRAPPER}} .upk-harold-list .upk-item .upk-item-box .upk-content .upk-meta, {{WRAPPER}} .upk-harold-list .upk-item .upk-item-box .upk-content .upk-meta *',
591 595 ]
592 596 );
593 597
594 598 $this->end_controls_section();
@@ -791,20 +795,33 @@
791 795 $this->register_ajax_loadmore_style_controls();
792 796 }
793 797
794 798 /**
795 - * Main query render for this widget
796 - * @param $posts_per_page number item query limit
799 + * Get post query builder arguments
797 800 */
798 - public function query_posts($posts_per_page) {
801 + public function query_posts( $posts_per_page ) {
802 + $settings = $this->get_settings();
803 + $posts_per_page = isset( $posts_per_page ) ? (int) $posts_per_page : 0;
804 + $args = $this->getGroupControlQueryArgs();
805 + $is_current_query = ( ! empty( $settings['posts_source'] ) && $settings['posts_source'] === 'current_query' );
799 806
800 - $default = $this->getGroupControlQueryArgs();
801 - if ($posts_per_page) {
807 + if ( $is_current_query ) {
808 + unset( $args['offset'] );
809 + unset( $args['no_found_rows'] );
810 + $posts_per_page = 0;
811 + }
812 +
813 + if ( $posts_per_page > 0 ) {
802 814 $args['posts_per_page'] = $posts_per_page;
803 - $args['paged'] = max(1, get_query_var('paged'), get_query_var('page'));
815 + } else {
816 + $args['posts_per_page'] = (int) get_option( 'posts_per_page', 10 );
804 817 }
805 - $args = array_merge($default, $args);
806 - $this->_query = new WP_Query($args);
818 +
819 + if ( $settings['show_pagination'] ) {
820 + $args['paged'] = max( 1, (int) get_query_var( 'paged' ), (int) get_query_var( 'page' ) );
821 + }
822 +
823 + $this->_query = new \WP_Query( $args );
807 824 }
808 825
809 826 public function render_author() {
810 827
@@ -878,16 +895,16 @@
878 895 <?php if ($settings['show_author'] or $settings['show_date'] or $settings['show_reading_time']) : ?>
879 896 <div class="upk-meta">
880 897 <?php $this->render_author(); ?>
881 898 <?php if ($settings['show_date']) : ?>
882 - <div data-separator="<?php echo esc_html($settings['meta_separator']); ?>">
899 + <div data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
883 900 <?php $this->render_date(); ?>
884 901 </div>
885 902 <?php endif; ?>
886 903 <?php if (_is_upk_pro_activated()) :
887 904 if ('yes' === $settings['show_reading_time']) : ?>
888 - <div class="upk-reading-time" data-separator="<?php echo esc_html($settings['meta_separator']); ?>">
889 - <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'] ) ); ?>
905 + <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
906 + <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?>
890 907 </div>
891 908 <?php endif; ?>
892 909 <?php endif; ?>
893 910 </div>
@@ -961,8 +978,10 @@
961 978 'human_diff_time' => isset($settings['human_diff_time']) ? $settings['human_diff_time'] : 'no',
962 979 'human_diff_time_short' => isset($settings['human_diff_time_short']) ? $settings['human_diff_time_short'] : 'no',
963 980 'show_reading_time' => isset($settings['show_reading_time']) ? $settings['show_reading_time'] : 'no',
964 981 'avg_reading_speed' => isset($settings['avg_reading_speed']) ? $settings['avg_reading_speed'] : 200,
982 + 'hide_seconds' => isset($settings['hide_seconds']) ? $settings['hide_seconds'] : 'no',
983 + 'hide_minutes' => isset($settings['hide_minutes']) ? $settings['hide_minutes'] : 'no',
965 984 'primary_thumbnail_size' => isset($settings['primary_thumbnail_size']) ? $settings['primary_thumbnail_size'] : 'medium',
966 985 'upk_link_new_tab' => isset($settings['upk_link_new_tab']) ? $settings['upk_link_new_tab'] : 'no',
967 986 'global_link' => isset($settings['global_link']) ? $settings['global_link'] : 'no',
968 987 ];