title: Add custom field woocommerce (variable product)
body: <p>I search how can i add a custom field for a viriable product in woocommerce. I already do this, but is only work for simple product.</p>
  
  <pre><code>add_action( 'woocommerce_product_options_general_product_data', 'wc_custom_add_custom_fields' );
  function wc_custom_add_custom_fields() {
      // Print a custom text field
      woocommerce_wp_text_input( array(
          'id' =&gt; '_custom_text_field',
          'label' =&gt; 'Custom Text Field',
          'description' =&gt; 'This is a custom field, you can write here anything you want.',
          'desc_tip' =&gt; 'true',
          'placeholder' =&gt; 'Custom text'
      ) );
  }
  add_action( 'woocommerce_process_product_meta', 'wc_custom_save_custom_fields' );
  function wc_custom_save_custom_fields( $post_id ) {
      if ( ! empty( $_POST['_custom_text_field'] ) ) {
          update_post_meta( $post_id, '_custom_text_field', esc_attr( $_POST['_custom_text_field'] ) );
      }
  }
  </code></pre>
  
  <p>How can I edit this for have it for variable product?</p>