Changeset 36566 for trunk/src/wp-includes/comment.php
- Timestamp:
- 02/17/2016 10:57:33 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r36542 r36566 470 470 471 471 /** 472 * Queue comments for metadata lazyloading. 473 * 474 * @since 4.5.0 475 * 476 * @param array $comments Array of comment objects. 477 */ 478 function wp_queue_comments_for_comment_meta_lazyload( $comments ) { 479 // Don't use `wp_list_pluck()` to avoid by-reference manipulation. 480 $comment_ids = array(); 481 if ( is_array( $comments ) ) { 482 foreach ( $comments as $comment ) { 483 if ( $comment instanceof WP_Comment ) { 484 $comment_ids[] = $comment->comment_ID; 485 } 486 } 487 } 488 489 if ( $comment_ids ) { 490 $lazyloader = wp_metadata_lazyloader(); 491 $lazyloader->queue_objects( 'comment', $comment_ids ); 492 } 493 } 494 495 /** 472 496 * Sets the cookies used to store an unauthenticated commentator's identity. Typically used 473 497 * to recall previous comments by this commentator that are still held in moderation.
Note: See TracChangeset
for help on using the changeset viewer.