WC_Admin_Webhooks::bulk_delete()
Bulk delete.
Метод класса: WC_Admin_Webhooks{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$result = WC_Admin_Webhooks::bulk_delete( $webhooks );
- $webhooks(массив) (обязательный)
- List of webhooks IDs.
Код WC_Admin_Webhooks::bulk_delete() WC Admin Webhooks::bulk delete WC 9.2.3
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§ion=webhooks' . $status . '&deleted=' . $qty ) ); exit(); }