Home › Forums › ACF PRO › Get all Fields and Subfields from a page (pageID) › Reply To: Get all Fields and Subfields from a page (pageID)
acf get_fields() does get the field names and values of repeaters and flex fields. For Example it returns this for a repeater
[repeater] => Array
(
[0] => Array
(
[field_1] => value 1
[field_2] => value 2
)
[1] => Array
(
[field_1] => value 1
[field_2] => value 2
)
)
Each sub array represents a row and the values are in field name => value pairs just like the top level fields.
A flex field is returned like this
[flex] => Array
(
[0] => Array
(
[acf_fc_layout] => layout_1
[field_1] => value 1
[field_2] => value 2
)
[1] => Array
(
[acf_fc_layout] => layout_2
[field_1] => value 1
[field_2] => value 2
)
)
again, of the values of the array is a row of the flex field.
maybe I’m missing what it is you’re really looking for. I think the real difficulty will be in telling the difference between flex fields, repeaters and other field types that store array values like select and checkbox fields.
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.