Automattic\WooCommerce\Internal\Admin\Orders
ListTable::do_untrash
Handles bulk restoration of trashed orders.
Method of the class: ListTable{}
No Hooks.
Returns
Int. Number of orders that were restored from the trash.
Usage
// private - for code of main (parent) class only $result = $this->do_untrash( $ids ): int;
- $ids(array) (required)
- Order IDs to be restored to their previous status.
ListTable::do_untrash() ListTable::do untrash code WC 10.3.6
private function do_untrash( array $ids ): int {
$orders_store = wc_get_container()->get( OrdersTableDataStore::class );
$changed = 0;
foreach ( $ids as $id ) {
if ( $orders_store->untrash_order( wc_get_order( $id ) ) ) {
++$changed;
}
}
return $changed;
}