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

Automattic\WooCommerce\Admin\Schedulers

OrdersScheduler::get_items() public WC 1.0

Get the order/refund IDs and total count that need to be synced.

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

Хуков нет.

Возвращает

Null. Ничего.

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

$result = OrdersScheduler::get_items( $limit, $page, $days, $skip_existing );
$limit(число)
Number of records to retrieve.
По умолчанию: 10
$page(число)
Page number.
По умолчанию: 1
$days(число/true/false)
Number of days prior to current date to limit search results.
По умолчанию: false
$skip_existing(true/false)
Skip already imported orders.
По умолчанию: false

Код OrdersScheduler::get_items() WC 4.7.0

<?php
public static function get_items( $limit = 10, $page = 1, $days = false, $skip_existing = false ) {
	global $wpdb;
	$where_clause = '';
	$offset       = $page > 1 ? ( $page - 1 ) * $limit : 0;

	if ( is_int( $days ) ) {
		$days_ago      = gmdate( 'Y-m-d 00:00:00', time() - ( DAY_IN_SECONDS * $days ) );
		$where_clause .= " AND post_date_gmt >= '{$days_ago}'";
	}

	if ( $skip_existing ) {
		$where_clause .= " AND NOT EXISTS (
			SELECT 1 FROM {$wpdb->prefix}wc_order_stats
			WHERE {$wpdb->prefix}wc_order_stats.order_id = {$wpdb->posts}.ID
		)";
	}

	$count = $wpdb->get_var(
		"SELECT COUNT(*) FROM {$wpdb->posts}
		WHERE post_type IN ( 'shop_order', 'shop_order_refund' )
		AND post_status NOT IN ( 'wc-auto-draft', 'auto-draft', 'trash' )
		{$where_clause}"
	); // WPCS: unprepared SQL ok.

	$order_ids = absint( $count ) > 0 ? $wpdb->get_col(
		$wpdb->prepare(
			"SELECT ID FROM {$wpdb->posts}
			WHERE post_type IN ( 'shop_order', 'shop_order_refund' )
			AND post_status NOT IN ( 'wc-auto-draft', 'auto-draft', 'trash' )
			{$where_clause}
			ORDER BY post_date_gmt ASC
			LIMIT %d
			OFFSET %d",
			$limit,
			$offset
		)
	) : array(); // phpcs:ignore unprepared SQL ok.

	return (object) array(
		'total' => absint( $count ),
		'ids'   => $order_ids,
	);
}