woocommerce_admin_stock_html

woocommerce_admin_stock_html

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_admin_stock_html') is found 2 times:

  • /includes/admin/list-tables/class-wc-admin-list-table-products.php line 328
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
        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 ) );
    }
     
    /**
     * Query vars for custom searches.
     *
     * @param mixed $public_query_vars Array of query vars.
  • /includes/admin/reports/class-wc-report-stock.php line 122
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
            $stock_html = '<mark class="instock">' . __( 'In stock', 'woocommerce' ) . '</mark>';
        } else {
            $stock_html = '<mark class="outofstock">' . __( 'Out of stock', 'woocommerce' ) . '</mark>';
        }
        echo apply_filters( 'woocommerce_admin_stock_html', $stock_html, $product );
        break;
     
    case 'stock_level':
        echo esc_html( $product->get_stock_quantity() );
        break;

See this hook used in plugins: