diff --git src/wp-includes/class-wp-comment-query.php src/wp-includes/class-wp-comment-query.php
index bbc6fe2d66..ecd3e5fe7c 100644
|
|
class WP_Comment_Query { |
390 | 390 | * When `$this->query_vars['count']` is set, the filter should return the comment count as an int. |
391 | 391 | * When `'ids' === $this->query_vars['fields']`, the filter should return an array of comment IDs. |
392 | 392 | * Otherwise the filter should return an array of WP_Comment objects. |
| 393 | * Note that if the filter return an array, that array will be assigned to the comments property of |
| 394 | * the current WP_Comment_Query instance. |
393 | 395 | * |
394 | 396 | * @since 5.3.0 |
395 | 397 | * |
… |
… |
class WP_Comment_Query { |
401 | 403 | $comment_data = apply_filters_ref_array( 'comments_pre_query', array( $comment_data, &$this ) ); |
402 | 404 | |
403 | 405 | if ( null !== $comment_data ) { |
| 406 | if ( is_array( $comment_data ) && ! $this->query_vars['count'] ) { |
| 407 | $this->comments = $comment_data; |
| 408 | } |
404 | 409 | return $comment_data; |
405 | 410 | } |
406 | 411 | |