Home › Forums › ACF PRO › Get field values by group › Reply To: Get field values by group
So basically I would loop through acf_get_field_groups() to get the field keys, then loop through acf_get_fields() with the keys to get the field IDs, then loop through acf_get_value() with the field ID and post ID.
I am creating an array with posts from a post type and their post meta and setting it as a transient (is this unnecessary?). I am currently using get_fields which works well but I wish I could separate the fields by group inside of the array easily so if there are any fields added I won’t have to go in and update the PHP.
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.