Home › Forums › ACF PRO › Disable Remove "Saved" Repeater Rows › Reply To: Disable Remove "Saved" Repeater Rows
Hi Dave,
You can add setting to field by using the ‘acf/render_field_settings’ filter but I don’t know how to change the setting value on post save. I don’t think it’s the best solution but, according to the function I already used, this may works :
To explain a bit more my proposal : The ‘prepare_field’ filter works when the value is already loaded from database, so if the field[‘value’] is not empty that’s means the row was already saved. By adding a class on your repeater subfields which are already saved in database you create some JQuery target. By using the ‘.closest()‘ and ‘.child()‘ Jquery method you can finaly target the ‘‘ of the rows which contain at least one saved subfield and ‘.remove()‘ it.
Hope it’s help. Tell me if you need some code example.
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.