Home › Forums › General Issues › True/False field never evaluates to true › Reply To: True/False field never evaluates to true
Hi @john.marcello
I suspect the issue is that you are using teh get_field function within a repeater loop, when you shoudl be using get_sub_field instead!
Could that explain the issue?
@astrixoblix – the get_field function will return a true / false without the 2 ‘false’ parameters. In fact, the value saved into the DB is either ‘1’ or ‘0’, so it is best to loosly compare like so:
if( get_sub_field('field_name') ):
Thanks
E
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.