Automattic\WooCommerce\Internal\Admin\Orders

ListTable::prepare_items()publicWC 1.0

Prepares the list of items for displaying.

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

Хуков нет.

Возвращает

null. Ничего.

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

$ListTable = new ListTable();
$ListTable->prepare_items();

Код ListTable::prepare_items() WC 6.8.0

public function prepare_items() {
	$limit = $this->get_items_per_page( 'edit_orders_per_page' );
	$args  = array(
		'limit'    => $limit,
		'page'     => $this->get_pagenum(),
		'paginate' => true,
		'status'   => sanitize_text_field( wp_unslash( $_REQUEST['status'] ?? 'all' ) ),
		'type'     => 'shop_order',
	);

	$orders      = wc_get_orders( $args );
	$this->items = $orders->orders;

	$this->set_pagination_args(
		array(
			'total_items' => $orders->total,
			'per_page'    => $limit,
		)
	);
}