WC_Webhook_Data_Store::delete( WC_Webhook $webhook )
Remove a webhook from the database.
Description Description
Parameters Parameters
- $webhook
-
(Required) Webhook instance.
Source Source
File: includes/data-stores/class-wc-webhook-data-store.php
public function delete( &$webhook ) {
global $wpdb;
$wpdb->delete(
$wpdb->prefix . 'wc_webhooks',
array(
'webhook_id' => $webhook->get_id(),
),
array( '%d' )
); // WPCS: cache ok, DB call ok.
$this->delete_transients( 'all' );
wp_cache_delete( $webhook->get_id(), 'webhooks' );
WC_Cache_Helper::invalidate_cache_group( 'webhooks' );
do_action( 'woocommerce_webhook_deleted', $webhook->get_id(), $webhook );
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.3.0 | Introduced. |