_clear_modified_cache_on_transition_comment_status()
Clears the lastcommentmodified cached value when a comment status is changed.
Deletes the lastcommentmodified cache key when a comment enters or leaves 'approved' status.
Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.
Хуков нет.
Возвращает
null. Ничего (null).
Использование
_clear_modified_cache_on_transition_comment_status( $new_status, $old_status );
- $new_status(строка) (обязательный)
- The new comment status.
- $old_status(строка) (обязательный)
- The old comment status.
Список изменений
| С версии 4.7.0 | Введена. |
Код _clear_modified_cache_on_transition_comment_status() clear modified cache on transition comment status WP 6.8.3
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' );
}
}