Home › Forums › Add-ons › Options Page › Get all fields from option page › Reply To: Get all fields from option page
In order to do this you must register your option pages with separate ID’s. There’s no mention of this in the ACF Docs but you can enter 'post_id'
as a parameter when you use acf_add_options_sub_page
or acf_add_options_page
. Then you’ll be able to use get_fields('your_own_id')
to only get the fields on that particular option page. Otherwise all option pages are registered with the same id: ‘option’.
To see what is happening you can use the function acf_get_options_pages()
to list all your registered option pages and see their parameters.
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.