localize( $admin_helpers, $order_data ); parent::__construct( array( 'ajax' => true, 'singular' => 'history-log', 'plural' => 'history-logs', )); } /** * @since 1.0.0 * @param class $admin_helpers * @param array $order_data */ function localize( $admin_helpers, $order_data ) { $this->order_data = $order_data; $this->admin_helpers = $admin_helpers; } /** * @since 1.0.0 * @param array $item * @param string $column_name */ function column_default( $item, $column_name ) { $this->admin_helpers->set_custom_column_content( $column_name, $item['id'] ); } /** * @since 1.0.0 * @return array */ function get_columns() { return $this->admin_helpers->add_columns(); } /** * @since 1.0.0 * @return array */ function get_sortable_columns() { return $this->admin_helpers->add_sortable_columns(); } /** * @since 1.0.0 */ function prepare_items() { $this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns() ); $this->items = $this->order_data; } } } if ( ! function_exists( 'render_alopeyk_history_log_list' ) ) { /** * @since 1.0.0 * @param array $order_data */ function render_alopeyk_history_log_list( $order_data ) { $admin_helpers = new Alopeyk_WooCommerce_Shipping_Admin(); $testListTable = new Alopeyk_History_Log_List_Table( $admin_helpers, $order_data ); $testListTable->prepare_items(); $testListTable->display(); } } $data = $this->vars; if ( isset( $data['history'] ) && $data['history'] ) { render_alopeyk_history_log_list( $data['history'] ); } else { echo __( 'This order is not yet shipped via Alopeyk shipping method.', 'alopeyk-woocommerce-shipping' ); }