Regenerate_Order_Attendees::bulk_handler_for_attendee_regeneration( string $redirect_to, string $action, array $ids )
Regenerate bulk action for missing attendees.
Contents
Parameters
- $redirect_to
-
(string) (Required) The URL to redirect to.
- $action
-
(string) (Required) The bulk action name that is running.
- $ids
-
(array) (Required) The list of Order ids.
Return
(string) The URL to redirect to.
Source
File: src/Tribe/Commerce/WooCommerce/Regenerate_Order_Attendees.php
public function bulk_handler_for_attendee_regeneration( $redirect_to, $action, $ids ) {
if ( $action !== $this->action_slug ) {
return $redirect_to;
}
if ( empty( $ids ) ) {
return $redirect_to;
}
/** @var \Tribe__Tickets_Plus__Commerce__WooCommerce__Main $commerce_woo */
$commerce_woo = tribe( 'tickets-plus.commerce.woo' );
$changed = 0;
foreach ( $ids as $id ) {
$order = wc_get_order( $id );
if ( ! $order ) {
continue;
}
if ( ! $this->order_has_tickets( $order ) ) {
continue;
}
$this->force_regenerate_attendees_for_order( $commerce_woo, $order );
$changed ++;
}
if ( $changed ) {
$args = [
'post_type' => $commerce_woo->order_object,
'bulk_action' => $this->action_slug,
'changed' => $changed,
'ids' => implode( ',', $ids ),
];
$redirect_to = add_query_arg( $args, $redirect_to );
}
return $redirect_to;
}
Changelog
| Version | Description |
|---|---|
| 5.2.7 | Introduced. |