Home › Forums › Add-ons › Repeater Field › Deleted row in repeater keeps showing › Reply To: Deleted row in repeater keeps showing
Hi John.
Yes it is in a IF statement like you pointed out.
But I think I’ve solved it already.
I did a check if the image and/or video field was not empty, and if so, render it.
But I also needed to check if the switch with the radiobuttons is present/set.
So instead of:
$image = get_sub_field('afbeelding');
$video = get_sub_field('video');
if ($image) {
... do something
}
if ($video) {
... do something
}
I now have this one:
$image = get_sub_field('afbeelding');
$video = get_sub_field('video');
// This is the radio switch
$image_or_video = get_sub_field('image_or_video');
if ($image && $image_or_video == 'Afbeelding') {
... do something
}
if ($video && $image_or_video == 'Video') {
... do something
}
This solved the front-end rendering issue.
But apparantly, even if you delete the row with the video, the data is still present.
And that is strange, because it doesn’t happen when I delete a row with an image.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.