WordPress at Your Fingertips
function is not described

WC_Webhook_Data_Store::delete() public WC 3.3.0

Remove a webhook from the database.

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

Hooks from the method
Return

null. Nothing.

Usage

$WC_Webhook_Data_Store = new WC_Webhook_Data_Store();
$WC_Webhook_Data_Store->delete( $webhook );
$webhook(WC_Webhook) (required) (passed by reference — &)
Webhook instance.

Changelog

Since 3.3.0 Introduced.

Code of WC_Webhook_Data_Store::delete() WC 5.6.0

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