Support

Account

Home Forums General Issues Why does add_field always clear the cache? Reply To: Why does add_field always clear the cache?

  • Because the added fields are not added to the cache and the next time acf gets the fields the new field will be missing, so the cache for the field group’s fields needs to be cleared. Or at least that’s my understanding of it.

    Something similar can happen when you add a field group after getting the field groups… under some conditions. I have a couple of plugins that get all of the ACF field groups, and then adds new field groups based on the existing fields. In these plugins I need to manually clear the acf field group cache to get my new field groups to appear where they are supposed to.