Uses
Uses | Description |
---|---|
wp-includes/meta.php: wp_metadata_lazyloader() | Retrieves the queue for lazy-loading metadata. |
Queues comments for metadata lazy-loading.
(WP_Comment[]) (Required) Array of comment objects.
File: wp-includes/comment.php
function wp_queue_comments_for_comment_meta_lazyload( $comments ) { // Don't use `wp_list_pluck()` to avoid by-reference manipulation. $comment_ids = array(); if ( is_array( $comments ) ) { foreach ( $comments as $comment ) { if ( $comment instanceof WP_Comment ) { $comment_ids[] = $comment->comment_ID; } } } if ( $comment_ids ) { $lazyloader = wp_metadata_lazyloader(); $lazyloader->queue_objects( 'comment', $comment_ids ); } }
Version | Description |
---|---|
4.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_queue_comments_for_comment_meta_lazyload