update_comment_cache

SummerySummery

Updates the comment cache of given comments.

Syntax

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

DescriptionDescription

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.

ParametersParameters

$comments

(WP_Comment[]) (Required) Array of comment objects

$update_meta_cache

(bool) (Optional) Whether to update commentmeta cache.

Default value: true

SourceSource

File: wp-includes/comment.php


			

ChangelogChangelog

Changelog
Version Description
4.4.0 Introduced the $update_meta_cache parameter.
2.3.0 Introduced.
Scroll to Top