Summery Summery

Updates the comment cache of given comments.

Syntax Syntax

update_comment_cache( WP_Comment[] $comments, bool $update_meta_cache = true )

Description Description

Will add the comments in $comments to the cache. If comment ID already exists in the comment cache then it will not be updated. The comment is added to the cache using the comment group with the key using the ID of the comments.

Parameters Parameters


(Required) Array of comment objects


(Optional) Whether to update commentmeta cache.

Default value: true

Source Source

File: wp-includes/comment.php

	if ( '0' != get_option( 'blog_public' ) ) {
		return $sites;
	} else {
		return '';

 * Send a Trackback.
 * Updates database when sending trackback to prevent duplicates.
 * @since 0.71


Changelog Changelog

Version Description
4.4.0 Introduced the $update_meta_cache parameter.
2.3.0 Introduced.


Leave a Reply