Home › Forums › ACF PRO › get_field('field')['subfield'] vs get_field('field_subfield') › Reply To: get_field('field')['subfield'] vs get_field('field_subfield')
A group field can have more calls to the DB or the same number. This depends on if the values for the sub fields are already in the WP meta cache. Usually they are, but there are conditions where they are not. Each sub field of a group field is stored separately in the database.
In the normal course of actions WP runs setup_postdata on the current post and all meta fields retrieved in a single query and stored in the cache.
When getting values for a post that does not already have its meta fields stored then there is one db query for the group field and an additional db query for each sub field.
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.