WC_Admin_Webhooks_Table_List::process_bulk_action()publicWC 1.0

Process bulk actions.

Method of the class: WC_Admin_Webhooks_Table_List{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Admin_Webhooks_Table_List = new WC_Admin_Webhooks_Table_List();
$WC_Admin_Webhooks_Table_List->process_bulk_action();

WC_Admin_Webhooks_Table_List::process_bulk_action() code WC 9.4.2

public function process_bulk_action() {
	$action   = $this->current_action();
	$webhooks = isset( $_REQUEST['webhook'] ) ? array_map( 'absint', (array) $_REQUEST['webhook'] ) : array(); // WPCS: input var okay, CSRF ok.

	if ( false !== $action ) {
		check_admin_referer( 'woocommerce-settings' );

		if ( ! current_user_can( 'manage_woocommerce' ) ) {
			wp_die( esc_html__( 'You do not have permission to edit Webhooks', 'woocommerce' ) );
		}

		if ( 'delete' === $action ) {
			WC_Admin_Webhooks::bulk_delete( $webhooks );
		}
	}
}