'stock', 'plural' => 'stock', 'ajax' => false, ) ); } /** * No items found text. */ public function no_items() { _e( 'No products found.', 'woocommerce' ); } /** * Don't need this. * * @param string $position */ public function display_tablenav( $position ) { if ( 'top' !== $position ) { parent::display_tablenav( $position ); } } /** * Output the report. */ public function output_report() { $this->prepare_items(); echo '
is_type( 'variation' ) ? $item->parent : $item->id; $actions['edit'] = array( 'url' => admin_url( 'post.php?post=' . $action_id . '&action=edit' ), 'name' => __( 'Edit', 'woocommerce' ), 'action' => 'edit', ); if ( $product->is_visible() ) { $actions['view'] = array( 'url' => get_permalink( $action_id ), 'name' => __( 'View', 'woocommerce' ), 'action' => 'view', ); } $actions = apply_filters( 'woocommerce_admin_stock_report_product_actions', $actions, $product ); foreach ( $actions as $action ) { printf( '%4$s', esc_attr( $action['action'] ), esc_url( $action['url'] ), sprintf( esc_attr__( '%s product', 'woocommerce' ), $action['name'] ), esc_html( $action['name'] ) ); } ?>
__( 'Product', 'woocommerce' ), 'parent' => __( 'Parent', 'woocommerce' ), 'stock_level' => __( 'Units in stock', 'woocommerce' ), 'stock_status' => __( 'Stock status', 'woocommerce' ), 'wc_actions' => __( 'Actions', 'woocommerce' ), ); return $columns; } /** * Prepare customer list items. */ public function prepare_items() { $this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns() ); $current_page = absint( $this->get_pagenum() ); $per_page = apply_filters( 'woocommerce_admin_stock_report_products_per_page', 20 ); $this->get_items( $current_page, $per_page ); /** * Pagination. */ $this->set_pagination_args( array( 'total_items' => $this->max_items, 'per_page' => $per_page, 'total_pages' => ceil( $this->max_items / $per_page ), ) ); } }