| @@ -165,8 +165,9 @@ | ||
| 165 | 165 | $this->add_group_control( |
| 166 | 166 | Group_Control_Image_Size::get_type(), |
| 167 | 167 | [ |
| 168 | 168 | 'name' => 'primary_thumbnail', |
| 169 | + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 169 | 170 | 'exclude' => ['custom'], |
| 170 | 171 | 'default' => 'full', |
| 171 | 172 | ] |
| 172 | 173 | ); |
| @@ -261,8 +262,11 @@ | ||
| 261 | 262 | ], |
| 262 | 263 | 'default' => [ |
| 263 | 264 | 'size' => 12, |
| 264 | 265 | ], |
| 266 | + 'condition' => [ | |
| 267 | + 'posts_source!' => 'current_query', | |
| 268 | + ] | |
| 265 | 269 | ] |
| 266 | 270 | ); |
| 267 | 271 | |
| 268 | 272 | $this->register_query_builder_controls(); |
| @@ -300,10 +304,13 @@ | ||
| 300 | 304 | |
| 301 | 305 | $this->add_control( |
| 302 | 306 | 'pauseonhover', |
| 303 | 307 | [ |
| 304 | - 'label' => esc_html__('Pause on Hover', 'ultimate-post-kit'), | |
| 305 | - 'type' => Controls_Manager::SWITCHER, | |
| 308 | + 'label' => esc_html__('Pause on Hover', 'ultimate-post-kit'), | |
| 309 | + 'type' => Controls_Manager::SWITCHER, | |
| 310 | + 'condition' => [ | |
| 311 | + 'autoplay' => 'yes', | |
| 312 | + ], | |
| 306 | 313 | ] |
| 307 | 314 | ); |
| 308 | 315 | |
| 309 | 316 | $this->add_control( |
| @@ -382,8 +389,9 @@ | ||
| 382 | 389 | [ |
| 383 | 390 | 'name' => 'overlay_color', |
| 384 | 391 | 'label' => esc_html__('Background', 'ultimate-post-kit'), |
| 385 | 392 | 'types' => ['classic', 'gradient'], |
| 393 | + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 386 | 394 | 'exclude' => ['image'], |
| 387 | 395 | 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-img-wrap::before', |
| 388 | 396 | 'fields_options' => [ |
| 389 | 397 | 'background' => [ |
| @@ -1371,11 +1379,11 @@ | ||
| 1371 | 1379 | */ |
| 1372 | 1380 | public function query_posts($posts_per_page) { |
| 1373 | 1381 | |
| 1374 | 1382 | $default = $this->getGroupControlQueryArgs(); |
| 1383 | + $args = []; | |
| 1375 | 1384 | if ($posts_per_page) { |
| 1376 | 1385 | $args['posts_per_page'] = $posts_per_page; |
| 1377 | - // $args['paged'] = max(1, get_query_var('paged'), get_query_var('page')); | |
| 1378 | 1386 | } |
| 1379 | 1387 | $args = array_merge($default, $args); |
| 1380 | 1388 | $this->_query = new WP_Query($args); |
| 1381 | 1389 | } |
| @@ -1399,13 +1407,13 @@ | ||
| 1399 | 1407 | |
| 1400 | 1408 | if (!$this->get_settings('show_comments')) { |
| 1401 | 1409 | return; |
| 1402 | 1410 | } |
| 1403 | - ?> | |
| 1411 | + ?> | |
| 1404 | 1412 | |
| 1405 | 1413 | <div class="upk-comments"> |
| 1406 | - <?php echo get_comments_number($id) ?> | |
| 1407 | - <i class="upk-icon-bubble"></i> | |
| 1414 | + <?php echo esc_html( $this->upk_get_localized_comment_count( $id ) ); ?> | |
| 1415 | + <i class="upk-icon-bubble" aria-hidden="true"></i> | |
| 1408 | 1416 | </div> |
| 1409 | 1417 | |
| 1410 | 1418 | <?php |
| 1411 | 1419 | } |
| @@ -1450,10 +1458,10 @@ | ||
| 1450 | 1458 | |
| 1451 | 1459 | $this->add_render_attribute('swiper', 'class', 'swiper-carousel swiper'); |
| 1452 | 1460 | |
| 1453 | 1461 | ?> |
| 1454 | - <div <?php echo $this->get_render_attribute_string('camux-slider'); ?>> | |
| 1455 | - <div <?php echo $this->get_render_attribute_string('swiper'); ?>> | |
| 1462 | + <div <?php $this->print_render_attribute_string('camux-slider'); ?>> | |
| 1463 | + <div <?php $this->print_render_attribute_string('swiper'); ?>> | |
| 1456 | 1464 | <div class="swiper-wrapper"> |
| 1457 | 1465 | <?php |
| 1458 | 1466 | } |
| 1459 | 1467 | |
| @@ -1465,12 +1473,12 @@ | ||
| 1465 | 1473 | </div> |
| 1466 | 1474 | <?php if ($settings['show_navigation']) : ?> |
| 1467 | 1475 | <div class="upk-navigation-wrap"> |
| 1468 | 1476 | <div class="upk-navigation-prev"> |
| 1469 | - <i class="upk-icon-arrow-left-<?php echo esc_html($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i> | |
| 1477 | + <i class="upk-icon-arrow-left-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i> | |
| 1470 | 1478 | </div> |
| 1471 | 1479 | <div class="upk-navigation-next"> |
| 1472 | - <i class="upk-icon-arrow-right-<?php echo esc_html($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i> | |
| 1480 | + <i class="upk-icon-arrow-right-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i> | |
| 1473 | 1481 | </div> |
| 1474 | 1482 | </div> |
| 1475 | 1483 | <?php endif; ?> |
| 1476 | 1484 | </div> |
| @@ -1484,9 +1492,9 @@ | ||
| 1484 | 1492 | |
| 1485 | 1493 | $this->add_render_attribute('slider-item', 'class', 'upk-item swiper-slide', true); |
| 1486 | 1494 | |
| 1487 | 1495 | ?> |
| 1488 | - <div <?php echo $this->get_render_attribute_string('slider-item'); ?>> | |
| 1496 | + <div <?php $this->print_render_attribute_string('slider-item'); ?>> | |
| 1489 | 1497 | <div class="upk-img-wrap"> |
| 1490 | 1498 | <?php $this->render_image(get_post_thumbnail_id($post_id), $image_size); ?> |
| 1491 | 1499 | </div> |
| 1492 | 1500 | |
| @@ -1515,16 +1523,16 @@ | ||
| 1515 | 1523 | <?php if ($settings['show_author']) : ?> |
| 1516 | 1524 | <?php $this->render_author(); ?> |
| 1517 | 1525 | <?php endif; ?> |
| 1518 | 1526 | <?php if ($settings['show_date']) : ?> |
| 1519 | - <div data-separator="<?php echo esc_html($settings['meta_separator']); ?>"> | |
| 1527 | + <div data-separator="<?php echo esc_attr($settings['meta_separator']); ?>"> | |
| 1520 | 1528 | <?php $this->render_date(); ?> |
| 1521 | 1529 | </div> |
| 1522 | 1530 | <?php endif; ?> |
| 1523 | 1531 | <?php if (_is_upk_pro_activated()) : |
| 1524 | 1532 | if ('yes' === $settings['show_reading_time']) : ?> |
| 1525 | - <div class="upk-reading-time" data-separator="<?php echo esc_html($settings['meta_separator']); ?>"> | |
| 1526 | - <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'] ) ); ?> | |
| 1533 | + <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>"> | |
| 1534 | + <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?> | |
| 1527 | 1535 | </div> |
| 1528 | 1536 | <?php endif; ?> |
| 1529 | 1537 | <?php endif; ?> |
| 1530 | 1538 | </div> |
| @@ -1540,9 +1548,9 @@ | ||
| 1540 | 1548 | |
| 1541 | 1549 | $this->add_render_attribute('thumb-item', 'class', 'upk-item swiper-slide', true); |
| 1542 | 1550 | |
| 1543 | 1551 | ?> |
| 1544 | - <div <?php echo $this->get_render_attribute_string('thumb-item'); ?>> | |
| 1552 | + <div <?php $this->print_render_attribute_string('thumb-item'); ?>> | |
| 1545 | 1553 | <div class="upk-img-wrap"> |
| 1546 | 1554 | <?php $this->render_image(get_post_thumbnail_id($post_id), $image_size); ?> |
| 1547 | 1555 | </div> |
| 1548 | 1556 | <?php $this->render_comments($post_id); ?> |
| @@ -1578,9 +1586,9 @@ | ||
| 1578 | 1586 | |
| 1579 | 1587 | $this->render_footer(); |
| 1580 | 1588 | |
| 1581 | 1589 | ?> |
| 1582 | - <div thumbsSlider="" <?php echo $this->get_render_attribute_string('swiper-thumbs'); ?>> | |
| 1590 | + <div thumbsSlider="" <?php $this->print_render_attribute_string('swiper-thumbs'); ?>> | |
| 1583 | 1591 | <div class="swiper-wrapper"> |
| 1584 | 1592 | <?php |
| 1585 | 1593 | |
| 1586 | 1594 | while ($wp_query->have_posts()) { |