Home › Forums › Front-end Issues › Getting value from options page when a checkbox is selected › Reply To: Getting value from options page when a checkbox is selected
Hopefully I have this right, I’m assuming you have these people added on an options page.
A better way to do this would be to have a Custom Post Type for adding the people and then use a relationship type of a field on the page editor where you want to allow them to be selected. If you’re not sure about adding CPTs check out Custom Post Type UI. You can set public to false in the post type so the posts are not accessible from the front end.
Using and options page for your people you’re going to need to build a filter on the acf/load_field hook that gets all the values from the option pages and makes them choices for your checkbox field. I think displaying them on the front end would probably be a bit more complicated than the other way.
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!
ποΈ Just one more day until the next session of ACF Chat Fridays! Make sure to register for the latest updates on whatβs coming in ACF 6.1!
— Advanced Custom Fields (@wp_acf) March 30, 2023
π Friday 31st March 3pm UTC
π Register here - https://t.co/3UtvQbDwNm pic.twitter.com/7xtEJakeQN
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.