Support

Account

Home Forums Bug Reports ACF Repeater sub-fields are losing / swapping content when re-ordered Reply To: ACF Repeater sub-fields are losing / swapping content when re-ordered

  • This works in latest ACF PRO. It will make all hidden fields to be saved even tho they are hidden. Fixes issue with re-ordering flexible content rows and data being messed up.

    
    function my_acf_input_admin_footer() {
      ?>
      <script type="text/javascript">
        (function($) {
          acf.add_action('hide_field', function($field, context) {
            // bail early if not conditional logic (may be tab field)
            if (context !== 'conditional_logic') {
              return;
            }
    
            // remove disable attr so value gets saved even tho field was hidden
            $field.find(':disabled').removeAttr('disabled');
          });
        })(jQuery);
      </script>
      <?php
    }
    
    add_action('acf/input/admin_footer', 'my_acf_input_admin_footer');