WC_Privacy::trash_failed_orders
Find and trash old orders.
Метод класса: WC_Privacy{}
Хуки из метода
Возвращает
int. Number of orders processed.
Использование
$result = WC_Privacy::trash_failed_orders( $limit );
- $limit(int)
- Limit orders to process per batch.
По умолчанию: 20
Список изменений
| С версии 3.4.0 | Введена. |
Код WC_Privacy::trash_failed_orders() WC Privacy::trash failed orders WC 10.3.4
public static function trash_failed_orders( $limit = 20 ) {
$option = wc_parse_relative_date_option( get_option( 'woocommerce_trash_failed_orders' ) );
if ( empty( $option['number'] ) ) {
return 0;
}
return self::trash_orders_query(
apply_filters(
'woocommerce_trash_failed_orders_query_args',
array(
'date_created' => '<' . strtotime( '-' . $option['number'] . ' ' . $option['unit'] ),
'limit' => $limit, // Batches of 20.
'status' => OrderInternalStatus::FAILED,
'type' => 'shop_order',
)
)
);
}