Home › Forums › Add-ons › Repeater Field › True/False in Repeater always returning false › Reply To: True/False in Repeater always returning false
G’day Mate,
the true/false fields always return boolean regardless of what you put in the field setting. The field setting is only for admin UI, and has nothing to do with the return value.
So, you code really only need to check if the return is truethy, not if it’s equal to ‘yes’:
<?php if ( get_field('whats_up_walk_in') ): ?>
Yes
<?php else: ?>
No
<?php endif; ?>
// or just
<?php echo get_field('whats_up_walk_in')? 'yes' : 'no'; ?>
Cheers
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.