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!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.