WC_API_Webhooks::delete_webhook( int $id )
Delete a webhook
Description Description
Parameters Parameters
- $id
-
(Required) webhook ID
Return Return
(array|WP_Error)
Source Source
File: includes/legacy/api/v2/class-wc-api-webhooks.php
public function delete_webhook( $id ) {
$id = $this->validate_request( $id, 'shop_webhook', 'delete' );
if ( is_wp_error( $id ) ) {
return $id;
}
do_action( 'woocommerce_api_delete_webhook', $id, $this );
$webhook = wc_get_webhook( $id );
return $webhook->delete( true );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.2 | Introduced. |