WC_Report_Downloads::prepare_items()publicWC 1.0

Prepare download list items.

Method of the class: WC_Report_Downloads{}

Return

null. Nothing (null).

Usage

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

WC_Report_Downloads::prepare_items() code WC 8.6.1

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 ),
		)
	);
}