WordPress at a glance
function is not described


DataStore::page_records() protected WC 1.0

Returns the page of data according to page number and items per page.

{} It's a method of the class: DataStore{}

No Hooks.


Array. Nothing.


// protected - for code of main (parent) or child class
$result = $this->page_records( $data, $page_no, $items_per_page );
$data(array) (required)
Data to paginate.
$page_no(int) (required)
Page number.
$items_per_page(int) (required)
Number of items per page.

Code of DataStore::page_records() WC 5.3.0

protected function page_records( $data, $page_no, $items_per_page ) {
	$offset = ( $page_no - 1 ) * $items_per_page;
	return array_slice( $data, $offset, $items_per_page );