← All changes
|
includes/controls/group-query/group-control-query.php
+6
-0
4.1.15
→
4.5.6
View file →
| @@ -388,8 +388,9 @@ | ||
| 388 | 388 | * Set Feature Images |
| 389 | 389 | */ |
| 390 | 390 | |
| 391 | 391 | if ($this->get_settings_for_display('posts_only_with_featured_image') === 'yes') { |
| 392 | + // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 392 | 393 | $args['meta_key'] = '_thumbnail_id'; |
| 393 | 394 | } |
| 394 | 395 | |
| 395 | 396 | /** |
| @@ -469,8 +470,9 @@ | ||
| 469 | 470 | ) { |
| 470 | 471 | $args['ignore_sticky_posts'] = true; |
| 471 | 472 | |
| 472 | 473 | if (in_array('current_post', $exclude_by)) { |
| 474 | + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 473 | 475 | $args['post__not_in'] = [get_the_ID()]; |
| 474 | 476 | } |
| 475 | 477 | } |
| 476 | 478 | |
| @@ -501,8 +503,9 @@ | ||
| 501 | 503 | $args['post_type'] = get_post_type($related_post_id); |
| 502 | 504 | |
| 503 | 505 | $exclude_by = $this->getGroupControlQueryParamBy('exclude'); |
| 504 | 506 | if (in_array('current_post', $exclude_by)) { |
| 507 | + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 505 | 508 | $args['post__not_in'] = [get_the_ID()]; |
| 506 | 509 | } |
| 507 | 510 | |
| 508 | 511 | /** |
| @@ -535,8 +538,9 @@ | ||
| 535 | 538 | } |
| 536 | 539 | |
| 537 | 540 | if (in_array('manual_selection', $exclude_by)) { |
| 538 | 541 | $exclude_ids = $settings['posts_exclude_ids']; |
| 542 | + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 539 | 543 | $args['post__not_in'] = array_merge($current_post, wp_parse_id_list($exclude_ids)); |
| 540 | 544 | } |
| 541 | 545 | |
| 542 | 546 | /** |
| @@ -639,8 +643,9 @@ | ||
| 639 | 643 | } |
| 640 | 644 | } |
| 641 | 645 | |
| 642 | 646 | if (!empty($terms_query)) { |
| 647 | + // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 643 | 648 | $args['tax_query'] = $terms_query; |
| 644 | 649 | $args['tax_query']['relation'] = 'AND'; |
| 645 | 650 | } |
| 646 | 651 | |
| @@ -662,8 +667,9 @@ | ||
| 662 | 667 | * @return array|mixed |
| 663 | 668 | */ |
| 664 | 669 | private function getGroupControlQueryParamBy($by = 'exclude') { |
| 665 | 670 | $mapBy = [ |
| 671 | + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 666 | 672 | 'exclude' => 'posts_exclude_by', |
| 667 | 673 | 'include' => 'posts_include_by', |
| 668 | 674 | ]; |
| 669 | 675 | |