0
function prepare_items() {
$columns = $this->get_columns();
$hidden = array();
$sortable = $this->get_sortable_columns();
$this->_column_headers = array($columns, $hidden, $sortable);
usort($this->$data, array(&$this, 'usort_reorder'));
$per_page = 5;
$current_page = $this->get_pagenum();
$total_items = count($this->data);
$this->found_data = array_slice($this->data,(($current_page-1)* $per_page), $per_page);
$this->set_pagination_args(array(
'total_items' => $total_items,
'per_page' => $per_page
));
$this->items = $this->found_data;}
Je reçois cette erreur du code ci-dessus.PHP Attention: usort() s'attend à ce que le paramètre 1 soit array, nul donné dans & array_slice() attend le paramètre 1 à array, null donné en
Warning: usort() expects parameter 1 to be array, null given in [...]
Warning: array_slice() expects parameter 1 to be array, null given in [...]
Quelqu'un peut-il m'aider à résoudre ses problèmes?
est '$ this -> $ data' un tableau? – Thamilan
Je pense que $ this -> $ data retourne vide – Karthikeyani