WC_Report_Downloads::prepare_items()publicWC 1.0

Prepare download list items.

Метод класса: WC_Report_Downloads{}

Возвращает

null. Ничего (null).

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

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

Код WC_Report_Downloads::prepare_items() WC 9.4.2

public function prepare_items() {

	$this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns() );
	$current_page          = absint( $this->get_pagenum() );
	// Allow filtering per_page value, but ensure it's at least 1.
	$per_page = max( 1, apply_filters( 'woocommerce_admin_downloads_report_downloads_per_page', 20 ) );

	$this->get_items( $current_page, $per_page );

	/**
	 * Pagination.
	 */
	$this->set_pagination_args(
		array(
			'total_items' => $this->max_items,
			'per_page'    => $per_page,
			'total_pages' => ceil( $this->max_items / $per_page ),
		)
	);
}