Since already initialized on load no need of this

This commit is contained in:
Shiva Poudel 2018-02-13 08:31:11 +05:45
parent 6bad005c5b
commit a283da9a53
2 changed files with 3 additions and 35 deletions

View File

@ -186,15 +186,9 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
public function prepare_items() {
global $wpdb;
$per_page = $this->get_items_per_page( 'wc_keys_per_page' );
$columns = $this->get_columns();
$hidden = $this->get_hidden_columns();
$sortable = $this->get_sortable_columns();
// Column headers.
$this->_column_headers = array( $columns, $hidden, $sortable );
$per_page = $this->get_items_per_page( 'wc_keys_per_page' );
$current_page = $this->get_pagenum();
if ( 1 < $current_page ) {
$offset = $per_page * ( $current_page - 1 );
} else {
@ -224,13 +218,4 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
'total_pages' => ceil( $count / $per_page ),
) );
}
/**
* Get a list of hidden columns.
*
* @return array
*/
protected function get_hidden_columns() {
return get_hidden_columns( $this->screen );
}
}

View File

@ -247,15 +247,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
* Prepare table list items.
*/
public function prepare_items() {
$per_page = $this->get_items_per_page( 'wc_webhooks_per_page' );
$per_page = 0 === $per_page ? 10 : $per_page;
$columns = $this->get_columns();
$hidden = $this->get_hidden_columns();
$sortable = $this->get_sortable_columns();
// Column headers.
$this->_column_headers = array( $columns, $hidden, $sortable );
$per_page = $this->get_items_per_page( 'wc_webhooks_per_page' );
$current_page = $this->get_pagenum();
// Query args.
@ -290,13 +282,4 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
'total_pages' => ceil( $total_items / $per_page ),
) );
}
/**
* Get a list of hidden columns.
*
* @return array
*/
protected function get_hidden_columns() {
return get_hidden_columns( $this->screen );
}
}