WordPress at Your Fingertips
function is not described

WC_Webhook_Data_Store::delete_transients() private WC 3.6.0

Delete the transients used to cache a set of webhook IDs, optionally filtered by status.

{} It's a method of the class: WC_Webhook_Data_Store{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->delete_transients( $status );
$status(string)
Optional - status of cache to delete, or 'all' to delete all caches.
Default: ''

Changelog

Since 3.6.0 Introduced.

Code of WC_Webhook_Data_Store::delete_transients() WC 5.6.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 ) );
		}
	}
}