Changeset 48990 for trunk/src/wp-includes/class-wp-comment-query.php
- Timestamp:
- 09/17/2020 07:53:47 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-comment-query.php
r48986 r48990 395 395 * - Otherwise the filter should return an array of WP_Comment objects. 396 396 * 397 * Note that if the filter returns an array of comment data, it will be assigned 398 * to the `comments` property of the current WP_Comment_Query instance. 399 * 400 * Filtering functions that require pagination information are encouraged to set 401 * the `found_comments` and `max_num_pages` properties of the WP_Comment_Query object, 402 * passed to the filter by reference. If WP_Comment_Query does not perform a database 403 * query, it will not have enough information to generate these values itself. 404 * 397 405 * @since 5.3.0 406 * @since 5.6.0 The returned array of comment data is assigned to the `comments` property 407 * of the current WP_Comment_Query instance. 398 408 * 399 409 * @param array|int|null $comment_data Return an array of comment data to short-circuit WP's comment query, … … 405 415 406 416 if ( null !== $comment_data ) { 417 if ( is_array( $comment_data ) && ! $this->query_vars['count'] ) { 418 $this->comments = $comment_data; 419 } 420 407 421 return $comment_data; 408 422 }
Note: See TracChangeset
for help on using the changeset viewer.