Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_queue_comments_for_comment_meta_lazyload ›

Da4.5.0
Deprecaton/a
wp_queue_comments_for_comment_meta_lazyload ( $comments )
Parametri:
  • (WP_Comment[]) $comments Array of comment objects.
    Richiesto:
Definito a:
Codex:

Queues comments for metadata lazy-loading.



Sorgenti

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 );
	}
}