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/hazel-grid/widgets/hazel-grid.php +39 -18 4.0.9 → 4.5.6 View file →
@@ -104,8 +104,9 @@
104 104 ],
105 105 ]
106 106 );
107 107
108 + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- established hook name relied on across the plugin family; renaming would break integration.
108 109 $column_size = apply_filters('upk_column_size', '');
109 110
110 111 $this->add_responsive_control(
111 112 'columns',
@@ -263,8 +264,9 @@
263 264 $this->add_group_control(
264 265 Group_Control_Image_Size::get_type(),
265 266 [
266 267 'name' => 'primary_thumbnail',
268 + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour.
267 269 'exclude' => ['custom'],
268 270 'default' => 'medium',
269 271 ]
270 272 );
@@ -295,9 +297,10 @@
295 297 'default' => [
296 298 'size' => 6,
297 299 ],
298 300 'condition' => [
299 - 'grid_style' => ['1', '2', '8', '10']
301 + 'grid_style' => ['1', '2', '8', '10'],
302 + 'posts_source!' => 'current_query'
300 303 ]
301 304 ]
302 305 );
303 306
@@ -316,9 +319,10 @@
316 319 'default' => [
317 320 'size' => 5,
318 321 ],
319 322 'condition' => [
320 - 'grid_style' => ['3', '4', '5', '6']
323 + 'grid_style' => ['3', '4', '5', '6'],
324 + 'posts_source!' => 'current_query'
321 325 ]
322 326 ]
323 327 );
324 328
@@ -337,9 +341,10 @@
337 341 'default' => [
338 342 'size' => 7,
339 343 ],
340 344 'condition' => [
341 - 'grid_style' => ['7']
345 + 'grid_style' => ['7'],
346 + 'posts_source!' => 'current_query'
342 347 ]
343 348 ]
344 349 );
345 350
@@ -358,9 +363,10 @@
358 363 'default' => [
359 364 'size' => 4,
360 365 ],
361 366 'condition' => [
362 - 'grid_style' => ['9']
367 + 'grid_style' => ['9'],
368 + 'posts_source!' => 'current_query'
363 369 ]
364 370 ]
365 371 );
366 372
@@ -449,9 +455,9 @@
449 455 [
450 456 'label' => esc_html__('Glassmorphism', 'ultimate-post-kit'),
451 457 'type' => Controls_Manager::SWITCHER,
452 458 // translators: %1s: Opening anchor tag with link to MDN backdrop-filter documentation, %2s: Closing anchor tag
453 - 'description' => sprintf(__('This feature will not work in the Firefox browser untill you enable browser compatibility so please %1s look here %2s', 'ultimate-post-kit'), '<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility" target="_blank">', '</a>'),
459 + 'description' => sprintf(__('This feature will not work in the Firefox browser untill you enable browser compatibility so please %1$s look here %2$s', 'ultimate-post-kit'), '<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility" target="_blank">', '</a>'),
454 460 'default' => 'yes',
455 461 'condition' => [
456 462 'content_style' => '2',
457 463 ]
@@ -790,9 +796,9 @@
790 796 Group_Control_Typography::get_type(),
791 797 [
792 798 'name' => 'author_typography',
793 799 'label' => esc_html__('Typography', 'ultimate-post-kit'),
794 - 'selector' => '{{WRAPPER}} .upk-hazel-grid .upk-meta',
800 + 'selector' => '{{WRAPPER}} .upk-hazel-grid .upk-meta, {{WRAPPER}} .upk-hazel-grid .upk-meta *',
795 801 ]
796 802 );
797 803
798 804 $this->end_controls_section();
@@ -959,20 +965,33 @@
959 965 $this->register_ajax_loadmore_style_controls();
960 966 }
961 967
962 968 /**
963 - * Main query render for this widget
964 - * @param $posts_per_page number item query limit
969 + * Get post query builder arguments
965 970 */
966 - public function query_posts($posts_per_page) {
971 + public function query_posts( $posts_per_page ) {
972 + $settings = $this->get_settings();
973 + $posts_per_page = isset( $posts_per_page ) ? (int) $posts_per_page : 0;
974 + $args = $this->getGroupControlQueryArgs();
975 + $is_current_query = ( ! empty( $settings['posts_source'] ) && $settings['posts_source'] === 'current_query' );
967 976
968 - $default = $this->getGroupControlQueryArgs();
969 - if ($posts_per_page) {
977 + if ( $is_current_query ) {
978 + unset( $args['offset'] );
979 + unset( $args['no_found_rows'] );
980 + $posts_per_page = 0;
981 + }
982 +
983 + if ( $posts_per_page > 0 ) {
970 984 $args['posts_per_page'] = $posts_per_page;
971 - $args['paged'] = max(1, get_query_var('paged'), get_query_var('page'));
985 + } else {
986 + $args['posts_per_page'] = (int) get_option( 'posts_per_page', 10 );
972 987 }
973 - $args = array_merge($default, $args);
974 - $this->_query = new WP_Query($args);
988 +
989 + if ( $settings['show_pagination'] ) {
990 + $args['paged'] = max( 1, (int) get_query_var( 'paged' ), (int) get_query_var( 'page' ) );
991 + }
992 +
993 + $this->_query = new \WP_Query( $args );
975 994 }
976 995
977 996 public function render_author() {
978 997
@@ -982,9 +1001,9 @@
982 1001
983 1002 ?>
984 1003
985 1004 <div class="upk-blog-author">
986 - <span class="by"><?php echo esc_html_x('by', 'Frontend', 'ultimate-post-kit') ?></span>
1005 + <span class="by"><?php echo esc_html_x('By', 'Frontend', 'ultimate-post-kit') ?></span>
987 1006 <span class="upk-post-grid-author">
988 1007 <a href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>">
989 1008 <?php echo esc_html( get_the_author() ) ?>
990 1009 </a>
@@ -1033,9 +1052,9 @@
1033 1052 <div class="upk-meta">
1034 1053 <?php $this->render_author(); ?>
1035 1054
1036 1055 <?php if ($settings['show_date']) : ?>
1037 - <div data-separator="<?php echo esc_html($settings['meta_separator']); ?>">
1056 + <div data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
1038 1057 <div class="upk-date">
1039 1058 <i class="upk-icon-calendar" aria-hidden="true"></i><?php $this->render_date(); ?>
1040 1059 </div>
1041 1060
@@ -1049,10 +1068,10 @@
1049 1068 <?php endif; ?>
1050 1069
1051 1070 <?php if (_is_upk_pro_activated()) :
1052 1071 if ('yes' === $settings['show_reading_time']) : ?>
1053 - <div class="upk-reading-time" data-separator="<?php echo esc_html($settings['meta_separator']); ?>">
1054 - <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'] ) ); ?>
1072 + <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
1073 + <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?>
1055 1074 </div>
1056 1075 <?php endif; ?>
1057 1076 <?php endif; ?>
1058 1077 </div>
@@ -1138,8 +1157,10 @@
1138 1157 'show_time' => isset( $settings['show_time'] ) ? $settings['show_time'] : 'no',
1139 1158 'show_category' => isset( $settings['show_category'] ) ? $settings['show_category'] : 'yes',
1140 1159 'show_reading_time' => isset( $settings['show_reading_time'] ) ? $settings['show_reading_time'] : 'no',
1141 1160 'avg_reading_speed' => isset( $settings['avg_reading_speed'] ) ? $settings['avg_reading_speed'] : 200,
1161 + 'hide_seconds' => isset( $settings['hide_seconds'] ) ? $settings['hide_seconds'] : 'no',
1162 + 'hide_minutes' => isset( $settings['hide_minutes'] ) ? $settings['hide_minutes'] : 'no',
1142 1163 'upk_link_new_tab' => isset( $settings['upk_link_new_tab'] ) ? $settings['upk_link_new_tab'] : 'no',
1143 1164 'meta_separator' => isset( $settings['meta_separator'] ) ? $settings['meta_separator'] : '|',
1144 1165 'human_diff_time' => isset( $settings['human_diff_time'] ) ? $settings['human_diff_time'] : 'no',
1145 1166 'human_diff_time_short' => isset( $settings['human_diff_time_short'] ) ? $settings['human_diff_time_short'] : 'no',