woocommerce_wp_text_input()
Output a text input box.
No Hooks.
Return
null
. Nothing (null).
Usage
woocommerce_wp_text_input( $field, ?WC_Data $data );
- $field(array) (required)
- Field data.
- ?WC_Data $data **
- -
Default: null
Examples
#1 Display WooCommerce price field
This example is taken for the "Base Price" field from the code of the WooCommerce plugin itself.
woocommerce_wp_text_input( array( 'id' => '_regular_price', 'value' => $product_object->get_regular_price( 'edit' ), 'label' => __( 'Regular price', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')', 'data_type' => 'price', ) );
Get HTML:
<p class="form-field _regular_price_field "> <label for="_regular_price"> Base price (£) </label> <input type="text" class="short wc_input_price" style="" name="_regular_price" id="_regular_price" value="" placeholder="" /> </p>