title: Woocommerce get attribute custom field in wc attribute labels function
body: <pre><code>add_filter('woocommerce_attribute_label', 'custom_attribute_label', 10, 3);
  function custom_attribute_label($label, $name, $product) {
      $term_meta = get_term_meta($name, 'attribute_description', true);
      switch ($label)  {
          case 'size':
              $label .= '&lt;div class=&quot;custom-label&quot;&gt;' . __('MY TEXT AFTER LOGO', 'woocommerce') . '&lt;/div&gt;';
              break;
          case 'color':
              $label .= '&lt;div class=&quot;custom-label&quot;&gt;' . __('MY TEXT AFTER COLOR', 'woocommerce') . '&lt;/div&gt;';
              break;
      }
  
      return $label;
  }
  </code></pre>
  <p>Hello, is it possible to get custom registered field into attribute backend page in <code>woocommerce_attribute_label</code> hook.
  Field is with id '<strong>attribute_description</strong>', and I am stuck with a way to show frontend.</p>
  <p>Any help will be appreciated!</p>
  <p><a href="https://i.stack.imgur.com/Sjybg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sjybg.png" alt="enter image description here" /></a></p>
  <p>Code for registered field ( I follow online topic and learned from it ):</p>
  <pre><code>// Add variation description
  function my_edit_wc_attribute_my_field() {
      $id = isset( $_GET['edit'] ) ? absint( $_GET['edit'] ) : 0;
      $value = $id ? get_option( &quot;wc_attribute_attribute_description-$id&quot; ) : '';
      ?&gt;
  &lt;div id=&quot;attr-desc&quot;&gt;
          &lt;tr class=&quot;form-field&quot;&gt;
              &lt;th scope=&quot;row&quot; valign=&quot;top&quot;&gt;
                  &lt;label for=&quot;attribute-description&quot;&gt;Attribute Description&lt;/label&gt;
              &lt;/th&gt;
              &lt;td&gt;
                  &lt;textarea name=&quot;attribute_description&quot; id=&quot;attribute-description&quot; rows=&quot;5&quot; cols=&quot;40&quot;&gt;&lt;?php echo esc_attr( $value ); ?&gt;&lt;/textarea&gt;
                  &lt;!--&lt;input name=&quot;my_field&quot; id=&quot;my-field&quot; value=&quot;&lt;?php //echo esc_attr( $value ); ?&gt;&quot; /&gt;--&gt;
                  &lt;p class=&quot;description&quot;&gt;Add unique description that will appear in balloon field in single product page.&lt;/p&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
  &lt;/div&gt;
  &lt;script&gt;
      jQuery(function($) {
          $('#attr-desc').appendTo('.form-field:eq(1)');
          //$('#attr-desc').hide();
      });
  &lt;/script&gt;
      &lt;?php
  }
  add_action( 'woocommerce_after_add_attribute_fields', 'my_edit_wc_attribute_my_field' );
  add_action( 'woocommerce_after_edit_attribute_fields', 'my_edit_wc_attribute_my_field' );
  
  // Save variation description
  function my_save_wc_attribute_my_field( $id ) {
      if ( is_admin() &amp;&amp; isset( $_POST['attribute_description'] ) ) {
          $option = &quot;wc_attribute_attribute_description-$id&quot;;
          update_option( $option, sanitize_text_field( $_POST['attribute_description'] ) );
      }
  }
  add_action( 'woocommerce_attribute_added', 'my_save_wc_attribute_my_field' );
  add_action( 'woocommerce_attribute_updated', 'my_save_wc_attribute_my_field' );
  
  // Delete option, when attribute is deleted
  add_action( 'woocommerce_attribute_deleted', function ( $id ) {
      delete_option( &quot;wc_attribute_attribute_description-$id&quot; );
  });
  
  // Then for example, on a taxonomy/term archive page, you can get the My Field value like so:
  /*
  $term = get_queried_object();
  $attr_id = wc_attribute_taxonomy_id_by_name( $term-&gt;taxonomy );
  $my_field = get_option( &quot;wc_attribute_my_field-$attr_id&quot; );
  */
  </code></pre>