/** * Prepares, sorts, delets, all that stuff :) */ function prepare_items() { $this->process_bulk_action(); $allLogs = $this->log->getAll(); $this->_column_headers = array($this->get_columns(), array(), $this->get_sortable_columns()); usort($allLogs, array(&$this, 'usort_reorder')); $perPage = 50; // set per page $this->found_data = array_slice($allLogs, ($this->get_pagenum() - 1) * $perPage, $perPage); $this->set_pagination_args(array('total_items' => count($allLogs), 'per_page' => $perPage)); $this->items = $this->found_data; }