Home › Forums › Front-end Issues › Trying to add conditional display to blog-list › Reply To: Trying to add conditional display to blog-list
empty
depends on what the value is.
https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting.
The values in the field object are the values before acf has formatted them (raw value), a true/false field set to false could be a string value "0"
which is not empty.
Try get_fields() instead of get_field_objects() and then use get_field_object() for non empty fields to get the field label.
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.