wp_queue_comments_for_comment_meta_lazyload()WP 4.5.0

Deprecated from version 6.3.0. It is no longer supported and can be removed in future releases. Use wp_lazyload_comment_meta() instead.

Queues comments for metadata lazy-loading.

No Hooks.

Return

null. Nothing (null).

Usage

wp_queue_comments_for_comment_meta_lazyload( $comments );
$comments(WP_Comment[]) (required)
Array of comment objects.

Changelog

Since 4.5.0 Introduced.
Deprecated since 6.3.0 Use wp_lazyload_comment_meta() instead.

wp_queue_comments_for_comment_meta_lazyload() code WP 6.5.2

function wp_queue_comments_for_comment_meta_lazyload( $comments ) {
	_deprecated_function( __FUNCTION__, '6.3.0', 'wp_lazyload_comment_meta()' );
	// 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;
			}
		}
	}

	wp_lazyload_comment_meta( $comment_ids );
}