/** * Loads the items that are displayed on the current list page. * * @since 1.0.0 */ public function prepare_items() { $this->_column_headers = array($this->get_columns(), $this->get_hidden_columns(), $this->get_sortable_columns()); $per_page = $this->get_items_per_page('transactionlog_per_page', 50); $current_page = $this->get_pagenum(); $args = array('posts_per_page' => $per_page, 'offset' => ($current_page - 1) * $per_page, 'meta_query' => array()); if (!empty($_GET['state'])) { $args['state'] = $_GET['state']; } if (!empty($_GET['id'])) { $args['post__in'] = explode(',', $_GET['id']); } if (!empty($_GET['invoice'])) { $args['meta_query']['invoice_id'] = array('key' => 'invoice_id', 'value' => explode(',', $_GET['invoice']), 'compare' => 'IN'); } if (!empty($_GET['gateway_id'])) { $args['meta_query']['gateway_id'] = array('key' => 'gateway_id', 'value' => $_GET['gateway_id']); } $total_items = MS_Model_Transactionlog::get_item_count($args); $this->items = apply_filters('ms_helper_listtable_transactionlog_items', MS_Model_Transactionlog::get_items($args)); $this->set_pagination_args(array('total_items' => $total_items, 'per_page' => $per_page)); }
/** * Loads the items that are displayed on the current list page. * * @since 1.0.1.2 */ public function prepare_items() { $this->_column_headers = array($this->get_columns(), $this->get_hidden_columns(), $this->get_sortable_columns()); $current_page = $this->get_pagenum(); $args = array('posts_per_page' => -1, 'offset' => 0); if (!empty($_GET['source']) && !empty($_GET['source_id'])) { $this->matching_type = $_GET['source']; $this->matching_type_id = $_GET['source_id']; $args['state'] = array('err', 'ignore'); $args['source'] = array($this->matching_type_id, $this->matching_type); $total_items = MS_Model_Transactionlog::get_item_count($args); $this->items = apply_filters('ms_helper_listtable_transactionmatching_items', MS_Model_Transactionlog::get_items($args)); $this->set_pagination_args(array('total_items' => $total_items, 'per_page' => $per_page)); } }