Home › Forums › General Issues › extract all checkbox values on a page › Reply To: extract all checkbox values on a page
Because you are on a page and not in the template that showss the posts you need to supply a post ID from a post that the field is attached to.
This means that the first thing you’re going to need to do is to get a post and set a valued for $post_id, then add that argument to the get_field_object call.
<?php echo implode(', ', get_field_object('example', $post_id)[choices]); ?>
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.