ActionScheduler_ListTable::bulk_delete
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.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->bulk_delete( $ids, $ids_sql );
- $ids(int[]) (required)
- Action IDs.
- $ids_sql(string) (required)
- Inherited and unused.
ActionScheduler_ListTable::bulk_delete() ActionScheduler ListTable::bulk delete code WC 10.3.6
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.
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
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()
)
);
}
}
}