WC_Admin_List_Table_Products::render_is_in_stock_column()protectedWC 1.0

Render column: is_in_stock.

{} It's a method of the class: WC_Admin_List_Table_Products{}

Hooks from the method

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->render_is_in_stock_column();

Code of WC_Admin_List_Table_Products::render_is_in_stock_column() WC 6.7.0

protected function render_is_in_stock_column() {
	if ( $this->object->is_on_backorder() ) {
		$stock_html = '<mark class="onbackorder">' . __( 'On backorder', 'woocommerce' ) . '</mark>';
	} elseif ( $this->object->is_in_stock() ) {
		$stock_html = '<mark class="instock">' . __( 'In stock', 'woocommerce' ) . '</mark>';
	} else {
		$stock_html = '<mark class="outofstock">' . __( 'Out of stock', 'woocommerce' ) . '</mark>';
	}

	if ( $this->object->managing_stock() ) {
		$stock_html .= ' (' . wc_stock_amount( $this->object->get_stock_quantity() ) . ')';
	}

	echo wp_kses_post( apply_filters( 'woocommerce_admin_stock_html', $stock_html, $this->object ) );
}