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/alex-grid/widgets/alex-grid.php +88 -57 4.0.9 → 4.5.6 View file →
@@ -103,25 +103,26 @@
103 103 // } else {
104 104 // $column_size = '';
105 105 // }
106 106
107 + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- established hook name relied on across the plugin family; renaming would break integration.
107 108 $column_size = apply_filters('upk_column_size', '');
108 109
109 110 $this->add_responsive_control(
110 111 'columns',
111 112 [
112 - 'label' => __('Columns', 'ultimate-post-kit') . BDTUPK_PC,
113 + 'label' => esc_html__('Columns', 'ultimate-post-kit') . BDTUPK_PC,
113 114 'type' => Controls_Manager::SELECT,
114 115 'default' => '3',
115 116 'tablet_default' => '2',
116 117 'mobile_default' => '1',
117 118 'options' => [
118 - '1' => '1',
119 - '2' => '2',
120 - '3' => '3',
121 - '4' => '4',
122 - '5' => '5',
123 - '6' => '6',
119 + '1' => esc_html__('1', 'ultimate-post-kit'),
120 + '2' => esc_html__('2', 'ultimate-post-kit'),
121 + '3' => esc_html__('3', 'ultimate-post-kit'),
122 + '4' => esc_html__('4', 'ultimate-post-kit'),
123 + '5' => esc_html__('5', 'ultimate-post-kit'),
124 + '6' => esc_html__('6', 'ultimate-post-kit'),
124 125 ],
125 126 'selectors' => [
126 127 '{{WRAPPER}} .upk-alex-grid .upk-style-2' => $column_size,
127 128 ],
@@ -191,8 +192,12 @@
191 192 'min' => 200,
192 193 'max' => 800,
193 194 ],
194 195 ],
196 + 'default' => [
197 + 'size' => 420,
198 + 'unit' => 'px',
199 + ],
195 200 'selectors' => [
196 201 '{{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+1), {{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+2), {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+2)' => 'height: {{SIZE}}{{UNIT}};',
197 202 ],
198 203 'condition' => [
@@ -211,8 +216,12 @@
211 216 'min' => 200,
212 217 'max' => 800,
213 218 ],
214 219 ],
220 + 'default' => [
221 + 'size' => 280,
222 + 'unit' => 'px',
223 + ],
215 224 'selectors' => [
216 225 '{{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+3), {{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+4), {{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+5), {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+1), {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+3), {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+4), {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+5)' => 'height: {{SIZE}}{{UNIT}};',
217 226 ],
218 227 'condition' => [
@@ -244,8 +253,9 @@
244 253 $this->add_group_control(
245 254 Group_Control_Image_Size::get_type(),
246 255 [
247 256 'name' => 'primary_thumbnail',
257 + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour.
248 258 'exclude' => ['custom'],
249 259 'default' => 'medium',
250 260 ]
251 261 );
@@ -255,9 +265,9 @@
255 265 //New Query Builder Settings
256 266 $this->start_controls_section(
257 267 'section_post_query_builder',
258 268 [
259 - 'label' => __('Query', 'ultimate-post-kit'),
269 + 'label' => esc_html__('Query', 'ultimate-post-kit'),
260 270 'tab' => Controls_Manager::TAB_CONTENT,
261 271 ]
262 272 );
263 273
@@ -276,9 +286,10 @@
276 286 'default' => [
277 287 'size' => 5,
278 288 ],
279 289 'condition' => [
280 - 'grid_style' => ['1', '3']
290 + 'grid_style' => ['1', '3'],
291 + 'posts_source!' => 'current_query',
281 292 ]
282 293 ]
283 294 );
284 295
@@ -352,9 +363,9 @@
352 363
353 364 $this->add_control(
354 365 'meta_separator',
355 366 [
356 - 'label' => __('Separator', 'ultimate-post-kit'),
367 + 'label' => esc_html__('Separator', 'ultimate-post-kit'),
357 368 'type' => Controls_Manager::TEXT,
358 369 'default' => '|',
359 370 'label_block' => false,
360 371 ]
@@ -383,12 +394,12 @@
383 394
384 395 $this->add_control(
385 396 'global_link',
386 397 [
387 - 'label' => __('Item Wrapper Link', 'ultimate-post-kit'),
398 + 'label' => esc_html__('Item Wrapper Link', 'ultimate-post-kit'),
388 399 'type' => Controls_Manager::SWITCHER,
389 400 'prefix_class' => 'upk-global-link-',
390 - 'description' => __('Be aware! When Item Wrapper Link activated then title link and read more link will not work', 'ultimate-post-kit'),
401 + 'description' => esc_html__('Be aware! When Item Wrapper Link activated then title link and read more link will not work', 'ultimate-post-kit'),
391 402 'separator' => 'before'
392 403 ]
393 404 );
394 405
@@ -468,9 +479,9 @@
468 479 [
469 480 'label' => esc_html__('Glassmorphism', 'ultimate-post-kit'),
470 481 'type' => Controls_Manager::SWITCHER,
471 482 // translators: %1s: Opening anchor tag with link to MDN backdrop-filter documentation, %2s: Closing anchor tag
472 - '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>'),
483 + '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>'),
473 484 'default' => 'yes',
474 485 ]
475 486 );
476 487
@@ -476,9 +487,9 @@
476 487
477 488 $this->add_control(
478 489 'overlay_blur_level',
479 490 [
480 - 'label' => __('Blur Level', 'ultimate-post-kit'),
491 + 'label' => esc_html__('Blur Level', 'ultimate-post-kit'),
481 492 'type' => Controls_Manager::SLIDER,
482 493 'range' => [
483 494 'px' => [
484 495 'min' => 0,
@@ -527,9 +538,9 @@
527 538
528 539 $this->add_responsive_control(
529 540 'content_width',
530 541 [
531 - 'label' => __('Width(%)', 'ultimate-post-kit'),
542 + 'label' => esc_html__('Width(%)', 'ultimate-post-kit'),
532 543 'type' => Controls_Manager::SLIDER,
533 544 'selectors' => [
534 545 '{{WRAPPER}} .upk-alex-grid .upk-item .upk-content-wrap' => 'width: {{SIZE}}%;'
535 546 ],
@@ -538,9 +549,9 @@
538 549
539 550 $this->add_responsive_control(
540 551 'secondary_content_width',
541 552 [
542 - 'label' => __('Secondary Width(%)', 'ultimate-post-kit'),
553 + 'label' => esc_html__('Secondary Width(%)', 'ultimate-post-kit'),
543 554 'type' => Controls_Manager::SLIDER,
544 555 'selectors' => [
545 556 '{{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+3) .upk-content-wrap, {{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+4) .upk-content-wrap, {{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+5) .upk-content-wrap, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+1) .upk-content-wrap, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+3) .upk-content-wrap, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+4) .upk-content-wrap, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+5) .upk-content-wrap' => 'width: {{SIZE}}%;'
546 557 ],
@@ -559,9 +570,9 @@
559 570
560 571 $this->add_responsive_control(
561 572 'content_height',
562 573 [
563 - 'label' => __('Height(px)', 'ultimate-post-kit'),
574 + 'label' => esc_html__('Height(px)', 'ultimate-post-kit'),
564 575 'type' => Controls_Manager::SLIDER,
565 576 'range' => [
566 577 'px' => [
567 578 'min' => 50,
@@ -576,9 +587,9 @@
576 587
577 588 $this->add_responsive_control(
578 589 'secondary_content_height',
579 590 [
580 - 'label' => __('Secondary height(px)', 'ultimate-post-kit'),
591 + 'label' => esc_html__('Secondary height(px)', 'ultimate-post-kit'),
581 592 'type' => Controls_Manager::SLIDER,
582 593 'range' => [
583 594 'px' => [
584 595 'min' => 50,
@@ -603,9 +614,9 @@
603 614
604 615 $this->add_responsive_control(
605 616 'content_inner_padding',
606 617 [
607 - 'label' => __('Inner Padding', 'ultimate-post-kit'),
618 + 'label' => esc_html__('Inner Padding', 'ultimate-post-kit'),
608 619 'type' => Controls_Manager::DIMENSIONS,
609 620 'size_units' => ['px', 'em', '%'],
610 621 'selectors' => [
611 622 '{{WRAPPER}} .upk-alex-grid .upk-item .upk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
@@ -615,9 +626,9 @@
615 626
616 627 $this->add_responsive_control(
617 628 'content_secondary_inner_padding',
618 629 [
619 - 'label' => __('Secondary Inner Padding', 'ultimate-post-kit'),
630 + 'label' => esc_html__('Secondary Inner Padding', 'ultimate-post-kit'),
620 631 'type' => Controls_Manager::DIMENSIONS,
621 632 'size_units' => ['px', 'em', '%'],
622 633 'selectors' => [
623 634 '{{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+3) .upk-content, {{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+4) .upk-content, {{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+5) .upk-content, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+1) .upk-content, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+3) .upk-content, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+4) .upk-content, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+5) .upk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
@@ -720,9 +731,9 @@
720 731 $this->add_group_control(
721 732 Group_Control_Text_Shadow::get_type(),
722 733 [
723 734 'name' => 'title_text_shadow',
724 - 'label' => __('Text Shadow', 'ultimate-post-kit'),
735 + 'label' => esc_html__('Text Shadow', 'ultimate-post-kit'),
725 736 'selector' => '{{WRAPPER}} .upk-alex-grid .upk-title',
726 737 'condition' => [
727 738 'title_advanced_style' => 'yes'
728 739 ]
@@ -742,9 +753,9 @@
742 753
743 754 $this->add_responsive_control(
744 755 'title_border_radius',
745 756 [
746 - 'label' => __('Border Radius', 'ultimate-post-kit'),
757 + 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
747 758 'type' => Controls_Manager::DIMENSIONS,
748 759 'size_units' => ['px', '%'],
749 760 'selectors' => [
750 761 '{{WRAPPER}} .upk-alex-grid .upk-title' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
@@ -768,9 +779,9 @@
768 779
769 780 $this->add_responsive_control(
770 781 'title_text_padding',
771 782 [
772 - 'label' => __('Padding', 'ultimate-post-kit'),
783 + 'label' => esc_html__('Padding', 'ultimate-post-kit'),
773 784 'type' => Controls_Manager::DIMENSIONS,
774 785 'size_units' => ['px', 'em', '%'],
775 786 'selectors' => [
776 787 '{{WRAPPER}} .upk-alex-grid .upk-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
@@ -1009,9 +1020,9 @@
1009 1020
1010 1021 $this->start_controls_section(
1011 1022 'section_style_readmore',
1012 1023 [
1013 - 'label' => __('Read More', 'ultimate-post-kit'),
1024 + 'label' => esc_html__('Read More', 'ultimate-post-kit'),
1014 1025 'tab' => Controls_Manager::TAB_STYLE,
1015 1026 'condition' => [
1016 1027 'show_readmore' => 'yes',
1017 1028 ],
@@ -1022,9 +1033,9 @@
1022 1033
1023 1034 $this->start_controls_tab(
1024 1035 'tab_readmore_normal',
1025 1036 [
1026 - 'label' => __('Normal', 'ultimate-post-kit'),
1037 + 'label' => esc_html__('Normal', 'ultimate-post-kit'),
1027 1038 ]
1028 1039 );
1029 1040
1030 1041 $this->add_control(
@@ -1029,12 +1040,12 @@
1029 1040
1030 1041 $this->add_control(
1031 1042 'readmore_text_color',
1032 1043 [
1033 - 'label' => __('Color', 'ultimate-post-kit'),
1044 + 'label' => esc_html__('Color', 'ultimate-post-kit'),
1034 1045 'type' => Controls_Manager::COLOR,
1035 1046 'selectors' => [
1036 - '{{WRAPPER}} .upk-alex-grid .upk-readmore .upk-readmore-icon:before, {{WRAPPER}} .upk-alex-grid .upk-item:hover .upk-readmore .upk-readmore-icon span:before, {{WRAPPER}} .upk-alex-grid .upk-item:hover .upk-readmore .upk-readmore-icon span:after' => 'background: {{VALUE}};',
1047 + '{{WRAPPER}} .upk-alex-grid .upk-readmore .upk-readmore-icon:before, {{WRAPPER}} .upk-alex-grid .upk-readmore .upk-readmore-icon span:before, {{WRAPPER}} .upk-alex-grid .upk-readmore .upk-readmore-icon span:after' => 'background: {{VALUE}};',
1037 1048 ],
1038 1049 ]
1039 1050 );
1040 1051
@@ -1058,9 +1069,9 @@
1058 1069
1059 1070 $this->add_responsive_control(
1060 1071 'readmore_radius',
1061 1072 [
1062 - 'label' => __('Border Radius', 'ultimate-post-kit'),
1073 + 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1063 1074 'type' => Controls_Manager::DIMENSIONS,
1064 1075 'size_units' => ['px', '%'],
1065 1076 'selectors' => [
1066 1077 '{{WRAPPER}} .upk-alex-grid .upk-readmore' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
@@ -1070,9 +1081,9 @@
1070 1081
1071 1082 $this->add_responsive_control(
1072 1083 'readmore_primary_padding',
1073 1084 [
1074 - 'label' => __('Padding', 'ultimate-post-kit'),
1085 + 'label' => esc_html__('Padding', 'ultimate-post-kit'),
1075 1086 'type' => Controls_Manager::DIMENSIONS,
1076 1087 'size_units' => ['px', 'em', '%'],
1077 1088 'selectors' => [
1078 1089 '{{WRAPPER}} .upk-alex-grid .upk-readmore' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
@@ -1083,9 +1094,9 @@
1083 1094
1084 1095 $this->add_responsive_control(
1085 1096 'readmore_secondary_padding',
1086 1097 [
1087 - 'label' => __('Secondary Padding', 'ultimate-post-kit'),
1098 + 'label' => esc_html__('Secondary Padding', 'ultimate-post-kit'),
1088 1099 'type' => Controls_Manager::DIMENSIONS,
1089 1100 'size_units' => ['px', 'em', '%'],
1090 1101 'selectors' => [
1091 1102 '{{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+3) .upk-readmore, {{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+4) .upk-readmore, {{WRAPPER}} .upk-alex-grid .upk-style-1 .upk-item:nth-child(5n+5) .upk-readmore, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+1) .upk-readmore, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+3) .upk-readmore, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+4) .upk-readmore, {{WRAPPER}} .upk-alex-grid .upk-style-3 .upk-item:nth-child(5n+5) .upk-readmore' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
@@ -1109,9 +1120,9 @@
1109 1120
1110 1121 $this->start_controls_tab(
1111 1122 'tab_readmore_hover',
1112 1123 [
1113 - 'label' => __('Hover', 'ultimate-post-kit'),
1124 + 'label' => esc_html__('Hover', 'ultimate-post-kit'),
1114 1125 ]
1115 1126 );
1116 1127
1117 1128 $this->add_control(
@@ -1116,12 +1127,12 @@
1116 1127
1117 1128 $this->add_control(
1118 1129 'readmore_hover_text_color',
1119 1130 [
1120 - 'label' => __('Color', 'ultimate-post-kit'),
1131 + 'label' => esc_html__('Color', 'ultimate-post-kit'),
1121 1132 'type' => Controls_Manager::COLOR,
1122 1133 'selectors' => [
1123 - '{{WRAPPER}} .upk-alex-grid .upk-item:hover .upk-readmore .upk-readmore-icon:before, {{WRAPPER}} .upk-alex-grid .upk-item:hover .upk-readmore .upk-readmore-icon span:before, {{WRAPPER}} .upk-alex-grid .upk-item:hover .upk-readmore .upk-readmore-icon span:after' => 'background: {{VALUE}};',
1134 + '{{WRAPPER}} .upk-alex-grid .upk-readmore:hover .upk-readmore-icon:before, {{WRAPPER}} .upk-alex-grid .upk-readmore:hover .upk-readmore-icon span:before, {{WRAPPER}} .upk-alex-grid .upk-readmore:hover .upk-readmore-icon span:after' => 'background: {{VALUE}};',
1124 1135 ],
1125 1136 ]
1126 1137 );
1127 1138
@@ -1135,9 +1146,9 @@
1135 1146
1136 1147 $this->add_control(
1137 1148 'readmore_hover_border_color',
1138 1149 [
1139 - 'label' => __('Border Color', 'ultimate-post-kit'),
1150 + 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
1140 1151 'type' => Controls_Manager::COLOR,
1141 1152 'selectors' => [
1142 1153 '{{WRAPPER}} .upk-alex-grid .upk-readmore:hover' => 'border-color: {{VALUE}};',
1143 1154 ],
@@ -1190,9 +1201,9 @@
1190 1201
1191 1202 $this->start_controls_tab(
1192 1203 'tab_avatar_normal',
1193 1204 [
1194 - 'label' => __('Avatar', 'ultimate-post-kit'),
1205 + 'label' => esc_html__('Avatar', 'ultimate-post-kit'),
1195 1206 'condition' => [
1196 1207 'show_author' => 'yes',
1197 1208 ],
1198 1209 ]
@@ -1256,9 +1267,9 @@
1256 1267 $this->end_controls_tab();
1257 1268 $this->start_controls_tab(
1258 1269 'tab_author_name_normal',
1259 1270 [
1260 - 'label' => __('Author Name', 'ultimate-post-kit'),
1271 + 'label' => esc_html__('Author Name', 'ultimate-post-kit'),
1261 1272 'condition' => [
1262 1273 'show_author' => 'yes',
1263 1274 ],
1264 1275 ]
@@ -1307,9 +1318,9 @@
1307 1318 $this->end_controls_tab();
1308 1319 $this->start_controls_tab(
1309 1320 'tab_date_normal',
1310 1321 [
1311 - 'label' => __('Date', 'ultimate-post-kit'),
1322 + 'label' => esc_html__('Date', 'ultimate-post-kit'),
1312 1323 'conditions' => [
1313 1324 'relation' => 'or',
1314 1325 'terms' => [
1315 1326 [
@@ -1423,9 +1434,9 @@
1423 1434 [
1424 1435 'label' => esc_html__('Glassmorphism', 'ultimate-post-kit'),
1425 1436 'type' => Controls_Manager::SWITCHER,
1426 1437 // translators: %1s: Opening anchor tag with link to MDN backdrop-filter documentation, %2s: Closing anchor tag
1427 - '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>'),
1438 + '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>'),
1428 1439 'default' => 'yes',
1429 1440 'separator' => 'before'
1430 1441 ]
1431 1442 );
@@ -1432,9 +1443,9 @@
1432 1443
1433 1444 $this->add_control(
1434 1445 'overlay_blur_level_post_format',
1435 1446 [
1436 - 'label' => __('Blur Level', 'ultimate-post-kit'),
1447 + 'label' => esc_html__('Blur Level', 'ultimate-post-kit'),
1437 1448 'type' => Controls_Manager::SLIDER,
1438 1449 'range' => [
1439 1450 'px' => [
1440 1451 'min' => 0,
@@ -1459,8 +1470,9 @@
1459 1470 [
1460 1471 'name' => 'post_format_background',
1461 1472 'label' => esc_html__('Background', 'ultimate-post-kit'),
1462 1473 'types' => ['classic', 'gradient'],
1474 + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour.
1463 1475 'exclude' => ['image'],
1464 1476 'selector' => '{{WRAPPER}} .upk-alex-grid .upk-post-format a',
1465 1477 'fields_options' => [
1466 1478 'background' => [
@@ -1496,9 +1508,9 @@
1496 1508
1497 1509 $this->add_responsive_control(
1498 1510 'post_format_padding',
1499 1511 [
1500 - 'label' => __('Padding', 'ultimate-post-kit'),
1512 + 'label' => esc_html__('Padding', 'ultimate-post-kit'),
1501 1513 'type' => Controls_Manager::DIMENSIONS,
1502 1514 'size_units' => ['px', 'em', '%'],
1503 1515 'selectors' => [
1504 1516 '{{WRAPPER}} .upk-alex-grid .upk-post-format a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
@@ -1508,9 +1520,9 @@
1508 1520
1509 1521 $this->add_responsive_control(
1510 1522 'post_format_margin',
1511 1523 [
1512 - 'label' => __('Margin', 'ultimate-post-kit'),
1524 + 'label' => esc_html__('Margin', 'ultimate-post-kit'),
1513 1525 'type' => Controls_Manager::DIMENSIONS,
1514 1526 'size_units' => ['px', 'em', '%'],
1515 1527 'selectors' => [
1516 1528 '{{WRAPPER}} .upk-alex-grid .upk-post-format' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
@@ -1544,21 +1556,33 @@
1544 1556 $this->register_ajax_loadmore_style_controls();
1545 1557 }
1546 1558
1547 1559 /**
1548 - * Main query render for this widget
1549 - * @param $posts_per_page number item query limit
1560 + * Get post query builder arguments
1550 1561 */
1551 - public function query_posts($posts_per_page) {
1562 + public function query_posts( $posts_per_page ) {
1563 + $settings = $this->get_settings();
1564 + $posts_per_page = isset( $posts_per_page ) ? (int) $posts_per_page : 0;
1565 + $args = $this->getGroupControlQueryArgs();
1566 + $is_current_query = ( ! empty( $settings['posts_source'] ) && $settings['posts_source'] === 'current_query' );
1552 1567
1553 - $default = $this->getGroupControlQueryArgs();
1554 - if ($posts_per_page) {
1568 + if ( $is_current_query ) {
1569 + unset( $args['offset'] );
1570 + unset( $args['no_found_rows'] );
1571 + $posts_per_page = 0;
1572 + }
1573 +
1574 + if ( $posts_per_page > 0 ) {
1555 1575 $args['posts_per_page'] = $posts_per_page;
1556 - $args['paged'] = max(1, get_query_var('paged'), get_query_var('page'));
1576 + } else {
1577 + $args['posts_per_page'] = (int) get_option( 'posts_per_page', 10 );
1557 1578 }
1558 1579
1559 - $args = array_merge($default, $args);
1560 - $this->_query = new WP_Query($args);
1580 + if ( $settings['show_pagination'] ) {
1581 + $args['paged'] = max( 1, (int) get_query_var( 'paged' ), (int) get_query_var( 'page' ) );
1582 + }
1583 +
1584 + $this->_query = new \WP_Query( $args );
1561 1585 }
1562 1586
1563 1587 public function render_readmore() {
1564 1588 if (!$this->get_settings('show_readmore')) {
@@ -1566,9 +1590,13 @@
1566 1590 }
1567 1591
1568 1592 ?>
1569 1593 <div class="upk-button-wrap">
1570 - <a href="<?php echo esc_url(get_permalink()); ?>" class="upk-readmore">
1594 + <a
1595 + href="<?php echo esc_url(get_permalink()); ?>"
1596 + class="upk-readmore"
1597 + aria-label="<?php echo esc_attr__( 'Read More Button', 'ultimate-post-kit' ); ?>"
1598 + >
1571 1599 <span class="upk-readmore-icon"><span></span></span>
1572 1600 </a>
1573 1601 </div>
1574 1602 <?php
@@ -1587,10 +1615,13 @@
1587 1615 <?php endif; ?>
1588 1616 <div>
1589 1617 <?php if ($settings['show_author']) : ?>
1590 1618 <div class="upk-author-name">
1591 - <a href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>">
1592 - <?php echo esc_html( get_the_author() ) ?>
1619 + <a
1620 + href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"
1621 + aria-label="<?php echo esc_attr( 'View all posts by ' . get_the_author() ); ?>"
1622 + >
1623 + <?php echo esc_html( get_the_author() ); ?>
1593 1624 </a>
1594 1625 </div>
1595 1626 <?php endif; ?>
1596 1627
@@ -1595,17 +1626,15 @@
1595 1626 <?php endif; ?>
1596 1627
1597 1628 <div class="upk-flex upk-flex-middle upk-date-reading-wrap">
1598 1629 <?php if ('yes' === $settings['show_date']) : ?>
1599 - <div data-separator="<?php echo esc_html($settings['meta_separator']); ?>">
1600 - <?php $this->render_date(); ?>
1601 - </div>
1630 + <?php $this->render_date(); ?>
1602 1631 <?php endif; ?>
1603 1632
1604 1633 <?php if (_is_upk_pro_activated()) :
1605 1634 if ('yes' === $settings['show_reading_time']) : ?>
1606 - <div class="upk-reading-time" data-separator="<?php echo esc_html($settings['meta_separator']); ?>">
1607 - <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'] ) ); ?>
1635 + <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
1636 + <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?>
1608 1637 </div>
1609 1638 <?php endif; ?>
1610 1639 <?php endif; ?>
1611 1640 </div>
@@ -1715,8 +1744,10 @@
1715 1744 'show_category' => isset($settings['show_category']) ? $settings['show_category'] : 'yes',
1716 1745 'show_readmore' => isset($settings['show_readmore']) ? $settings['show_readmore'] : 'yes',
1717 1746 'show_reading_time' => isset($settings['show_reading_time']) ? $settings['show_reading_time'] : 'no',
1718 1747 'avg_reading_speed' => isset($settings['avg_reading_speed']) ? $settings['avg_reading_speed'] : 200,
1748 + 'hide_seconds' => isset($settings['hide_seconds']) ? $settings['hide_seconds'] : 'no',
1749 + 'hide_minutes' => isset($settings['hide_minutes']) ? $settings['hide_minutes'] : 'no',
1719 1750 'upk_link_new_tab' => isset($settings['upk_link_new_tab']) ? $settings['upk_link_new_tab'] : 'no',
1720 1751 'meta_separator' => isset($settings['meta_separator']) ? $settings['meta_separator'] : '|',
1721 1752 'human_diff_time' => isset($settings['human_diff_time']) ? $settings['human_diff_time'] : 'no',
1722 1753 'human_diff_time_short' => isset($settings['human_diff_time_short']) ? $settings['human_diff_time_short'] : 'no',