WC_Admin_Webhooks::bulk_delete()public staticWC 1.0

Bulk delete.

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

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Admin_Webhooks::bulk_delete( $webhooks );
$webhooks(array) (required)
List of webhooks IDs.

Code of WC_Admin_Webhooks::bulk_delete() WC 6.7.0

public static function bulk_delete( $webhooks ) {
	foreach ( $webhooks as $webhook_id ) {
		$webhook = new WC_Webhook( (int) $webhook_id );
		$webhook->delete( true );
	}

	$qty    = count( $webhooks );
	$status = isset( $_GET['status'] ) ? '&status=' . sanitize_text_field( wp_unslash( $_GET['status'] ) ) : ''; // WPCS: input var okay, CSRF ok.

	// Redirect to webhooks page.
	wp_safe_redirect( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks' . $status . '&deleted=' . $qty ) );
	exit();
}