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


DraftOrders::assert_order_results() private WC 1.0

Asserts whether incoming order results are expected given the query this service class executes.

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

Хуков нет.


null. Ничего.


// private - только в коде основоного (родительского) класса
$result = $this->assert_order_results( $order_results, $expected_batch_size );
$order_results(WC_Order[]) (обязательный)
The order results being asserted.
$expected_batch_size(int) (обязательный)
The expected batch size for the results.

Код DraftOrders::assert_order_results() WC 5.5.2

private function assert_order_results( $order_results, $expected_batch_size ) {
	// if not an array, then just return because it won't get handled
	// anyways.
	if ( ! is_array( $order_results ) ) {

	$suffix = ' This is an indicator that something is filtering WooCommerce or WordPress queries and modifying the query parameters.';

	// if count is greater than our expected batch size, then that's a problem.
	if ( count( $order_results ) > 20 ) {
		throw new Exception( 'There are an unexpected number of results returned from the query.' . $suffix );

	// if any of the returned orders are not draft (or not a WC_Order), then that's a problem.
	foreach ( $order_results as $order ) {
		if ( ! ( $order instanceof WC_Order ) ) {
			throw new Exception( 'The returned results contain a value that is not a WC_Order.' . $suffix );
		if ( ! $order->has_status( self::STATUS ) ) {
			throw new Exception( 'The results contain an order that is not a `wc-checkout-draft` status in the results.' . $suffix );