woocommerce_wp_hidden_input

Output a hidden input box.

Description

woocommerce_wp_hidden_input( (array) $field ); 

Parameters (1)

0. $field (array)
The field.

Usage

  1. if ( !function_exists( 'woocommerce_wp_hidden_input' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/admin/wc-meta-box-functions.php'; 
  3.  
  4. // The field. 
  5. $field = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = woocommerce_wp_hidden_input($field); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/admin/wc-meta-box-functions.php  
  1. function woocommerce_wp_hidden_input( $field ) { 
  2. global $thepostid, $post; 
  3.  
  4. $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; 
  5. $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); 
  6. $field['class'] = isset( $field['class'] ) ? $field['class'] : ''; 
  7.  
  8. echo '<input type="hidden" class="' . esc_attr( $field['class'] ) . '" name="' . esc_attr( $field['id'] ) . '" id="' . esc_attr( $field['id'] ) . '" value="' . esc_attr( $field['value'] ) . '" /> ';