ActionScheduler_ListTable::bulk_delete()protectedWC 1.0

Bulk delete

Deletes actions based on their ID. This is the handler for the bulk delete. It assumes the data properly validated by the callee and it will delete the actions without any extra validation.

Method of the class: ActionScheduler_ListTable{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->bulk_delete( $ids, $ids_sql );
$ids(array) (required)
-
$ids_sql(string) (required)
Inherited and unused

ActionScheduler_ListTable::bulk_delete() code WC 8.6.1

protected function bulk_delete( array $ids, $ids_sql ) {
	foreach ( $ids as $id ) {
		try {
			$this->store->delete_action( $id );
		} catch ( Exception $e ) {
			// A possible reason for an exception would include a scenario where the same action is deleted by a
			// concurrent request.
			error_log(
				sprintf(
					/* translators: 1: action ID 2: exception message. */
					__( 'Action Scheduler was unable to delete action %1$d. Reason: %2$s', 'woocommerce' ),
					$id,
					$e->getMessage()
				)
			);
		}
	}
}