WC_Comments::delete_comments_count_cache
Delete comments count cache whenever there is new comment or the status of a comment changes. Cache will be regenerated next time WC_Comments::wp_count_comments() is called.
Method of the class: WC_Comments{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Comments::delete_comments_count_cache();
WC_Comments::delete_comments_count_cache() WC Comments::delete comments count cache code WC 10.6.2
public static function delete_comments_count_cache() {
$comment_status_keys = array(
'wc_count_comments_approved',
'wc_count_comments_unapproved',
'wc_count_comments_spam',
'wc_count_comments_trash',
'wc_count_comments_post-trashed',
);
wp_cache_delete_multiple( $comment_status_keys, self::COMMENT_COUNT_CACHE_GROUP );
}