clean_comment_cache()

最后更新于:2021-11-25 20:32:48

clean_comment_cache( int|array$ids)

Removes a comment from the object cache.

参数

$ids

(int|array) (Required) Comment ID or an array of comment IDs to remove from cache.

源文件

文件: gc-includes/comment.php

function clean_comment_cache( $ids ) {
	foreach ( (array) $ids as $id ) {
		gc_cache_delete( $id, 'comment' );

		/**
		 * Fires immediately after a comment has been removed from the object cache.
		 *
		 * @since 4.5.0
		 *
		 * @param int $id Comment ID.
		 */
		do_action( 'clean_comment_cache', $id );
	}

	gc_cache_set( 'last_changed', microtime(), 'comment' );
}