WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта с помощью браузерных PUSH уведомлений
функция не описана

WC_Order::needs_processing() public WC 3.0.0

See if the order needs processing before it can be completed.

Orders which only contain virtual, downloadable items do not need admin intervention.

Uses a transient so these calls are not repeated multiple times, and because once the order is processed this code/transient does not need to persist.

{} Это метод класса: WC_Order{}

Хуки из метода
Возвращает

true|false. Ничего.

Использование

$WC_Order = new WC_Order();
$WC_Order->needs_processing();

Список изменений

С версии 3.0.0 Введена.

Код WC_Order::needs_processing() WC 5.2.2

<?php
public function needs_processing() {
	$transient_name   = 'wc_order_' . $this->get_id() . '_needs_processing';
	$needs_processing = get_transient( $transient_name );

	if ( false === $needs_processing ) {
		$needs_processing = 0;

		if ( count( $this->get_items() ) > 0 ) {
			foreach ( $this->get_items() as $item ) {
				if ( $item->is_type( 'line_item' ) ) {
					$product = $item->get_product();

					if ( ! $product ) {
						continue;
					}

					$virtual_downloadable_item = $product->is_downloadable() && $product->is_virtual();

					if ( apply_filters( 'woocommerce_order_item_needs_processing', ! $virtual_downloadable_item, $product, $this->get_id() ) ) {
						$needs_processing = 1;
						break;
					}
				}
			}
		}

		set_transient( $transient_name, $needs_processing, DAY_IN_SECONDS );
	}

	return 1 === absint( $needs_processing );
}