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');
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.