Home › Forums › General Issues › Empty previous entered field-data on save? › Reply To: Empty previous entered field-data on save?
I actually just answered a similar question. http://support.advancedcustomfields.com/forums/topic/delete-repeater-row-not-staying-deleted-with-onditional-logic/
In you case, rather than
if (get_field('content_field'))
You should do
$selection = get_field('radio_field');
if ($selections == 'choice 1') {
// output code for choice 1
}
if ($selections == 'choice 2') {
// output code for choice 2
}
Or you could combine them into an if elseif else statement. Of even better yet I would probably choose a switch statement.
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!
ACF’s Repeater field is a versatile solution for repeating content in #WordPress.
— Advanced Custom Fields (@wp_acf) December 29, 2022
What’s your favorite use case for the Repeater field?
What’s the weirdest thing you’ve ever used it for?
Let us know!👇
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.