Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_clear_modified_cache_on_transition_comment_status( string $new_status, string $old_status )

Clear the lastcommentmodified cached value when a comment status is changed.


Description Description

Deletes the lastcommentmodified cache key when a comment enters or leaves ‘approved’ status.


Top ↑

Parameters Parameters

$new_status

(string) (Required) The new comment status.

$old_status

(string) (Required) The old comment status.



Top ↑

Source Source

File: wp-includes/comment.php

function _clear_modified_cache_on_transition_comment_status( $new_status, $old_status ) {
	if ( 'approved' === $new_status || 'approved' === $old_status ) {
		foreach ( array( 'server', 'gmt', 'blog' ) as $timezone ) {
			wp_cache_delete( "lastcommentmodified:$timezone", 'timeinfo' );
		}
	}
}

Top ↑

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.