title: Gravity forms: ACF fields for radio button labels
body: <p>I am trying to create Gravity forms radio buttons where label is being entered in ACF text fields.</p>
  <p>I have tried using Gravity forms <a href="https://docs.gravityforms.com/custom-field-merge-tags/" rel="nofollow noreferrer">ACF live merge tag</a>. However, when using merge tag the output comes out like:</p>
  <pre><code>&lt;label for=&quot;choice_16_11_0&quot; id=&quot;label_16_11_0&quot;&gt;{custom_field:valg_1}&lt;/label&gt;
  </code></pre>
  <p>The merge tag is just written in plain text and not the actual text from the ACF field. Therefore I figured I had to use <a href="https://docs.gravityforms.com/gform_field_choice_markup_pre_render/" rel="nofollow noreferrer">gform_field_choice_markup_pre_render filter</a> in order to override the label. I have followed the example found in Gravity forms documentation. My code:</p>
  <pre><code>add_filter( 'gform_field_choice_markup_pre_render_16_11', function ( $choice_markup, $choice, $field, $value ) {
      if ( $field-&gt;get_input_type() == 'radio' ) :
  
          switch ( rgar( $choice, 'text' ) ) {
              case &quot;Valg 1&quot;:
                  $description = get_field('valg_1');
                  break;
              case &quot;Valg 2&quot;:
                  $description = get_field('valg_2');
                  break;
              case &quot;Valg 3&quot;:
                  $description = get_field('valg_3');
                  break;
          }
  
      endif;
  
      return str_replace( &quot;&lt;/label&gt;&quot;, &quot;&lt;/label&gt;$description&quot;, $choice_markup );
  
  }, 10, 4 );
  </code></pre>
  <p>16 is my form ID and 11 is the field ID for my radio buttons. However, my code doesn't seem to be doing anything. Any pointers on what I might be missing ??</p>