Home › Forums › Bug Reports › Flexible Content data still in wp_postmeta after layout removed › Reply To: Flexible Content data still in wp_postmeta after layout removed
So, the problem here isn’t that the layout stays in the db, the problem is that you need to check these conditional fields for more than if they have content or not. This code is not exactly what you’ll need to use in your case but it should give you an idea.
$condition = get_field('your_condition_field');
if ($condition == '100') {
if (get_field('content_1')) {
// do stuff to output content 1
}
}
if ($condition == '33/66') {
if (get_field('content_2')) {
// do stuff to output content 2
}
}
if ($condition == '33/33/33') {
if (get_field('content_3')) {
// do stuff to output content 3
}
}
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.