_clear_modified_cache_on_transition_comment_status() – Clears the lastcommentmodified cached value when a comment status is changed.

You appear to be a bot. Output may be restricted

Description

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

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

Usage

_clear_modified_cache_on_transition_comment_status( $new_status, $old_status );

Parameters

$new_status
( string ) required – The new comment status.
$old_status
( string ) required – The old comment status.

Returns

void

Source

File name: wordpress/wp-includes/comment.php


Lines:

1 to 10 of 10
function _clear_modified_cache_on_transition_comment_status( $new_status, $old_status ) {
  if ( 'approved' === $new_status || 'approved' === $old_status ) {
    $data = array();
    foreach ( array( 'server', 'gmt', 'blog' ) as $timezone ) {
      $data[] = "lastcommentmodified:$timezone";
    }
    wp_cache_delete_multiple( $data, 'timeinfo' );
  }
}
 

 View on GitHub View on Trac