WordPress at Your Fingertips
function is not described

WC_API_Webhooks::delete_webhook() public WC 2.2

Delete a webhook

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

Hooks from the method
Return

Array|WP_Error.

Usage

$WC_API_Webhooks = new WC_API_Webhooks();
$WC_API_Webhooks->delete_webhook( $id );
$id(int) (required)
webhook ID

Changelog

Since 2.2 Introduced.

Code of WC_API_Webhooks::delete_webhook() WC 5.5.2

<?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 );
}