WC_Admin_Webhooks::bulk_delete()public staticWC 1.0

Bulk delete.

{} Это метод класса: WC_Admin_Webhooks{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$result = WC_Admin_Webhooks::bulk_delete( $webhooks );
$webhooks(массив) (обязательный)
List of webhooks IDs.

Код WC_Admin_Webhooks::bulk_delete() WC 6.9.4

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

	$qty = count( $webhooks );
	// phpcs:ignore WordPress.Security.NonceVerification.Recommended
	$status = isset( $_GET['status'] ) ? '&status=' . sanitize_text_field( wp_unslash( $_GET['status'] ) ) : '';

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