Support

Account

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.