Automattic\WooCommerce\Internal\OrderWithdrawal
OrderWithdrawalFormProcessor::is_order_outside_withdrawal_window
Whether the matched order is outside the valid withdrawal request window.
Метод класса: OrderWithdrawalFormProcessor{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->is_order_outside_withdrawal_window( $order ): bool;
- $order(WC_Order) (обязательный)
- Matched order.
Код OrderWithdrawalFormProcessor::is_order_outside_withdrawal_window() OrderWithdrawalFormProcessor::is order outside withdrawal window WC 11.2.2
private function is_order_outside_withdrawal_window( WC_Order $order ): bool {
$date_created = $order->get_date_created( 'edit' );
if ( ! $date_created ) {
return false;
}
return ( time() - self::WITHDRAWAL_WINDOW_IN_SECONDS ) > $date_created->getTimestamp();
}