WC_Webhook_Data_Store::delete_transients
Delete the transients used to cache a set of webhook IDs, optionally filtered by status.
Метод класса: WC_Webhook_Data_Store{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->delete_transients( $status );
- $status(строка)
- Optional - status of cache to delete, or
'all'to delete all caches.
По умолчанию:''
Список изменений
| С версии 3.6.0 | Введена. |
Код WC_Webhook_Data_Store::delete_transients() WC Webhook Data Store::delete transients WC 10.7.0
private function delete_transients( $status = '' ) {
// Always delete the non-filtered cache.
delete_transient( $this->get_transient_key( '' ) );
if ( ! empty( $status ) ) {
if ( 'all' === $status ) {
foreach ( wc_get_webhook_statuses() as $status_key => $status_string ) {
delete_transient( $this->get_transient_key( $status_key ) );
}
} else {
delete_transient( $this->get_transient_key( $status ) );
}
}
}