Home › Forums › Bug Reports › ACF Pro – Options pages with Repeaters not working › Reply To: ACF Pro – Options pages with Repeaters not working
I do work for the developer, but in the limited capacity of helping people here on this forum.
If you are attempting to build some type of plugin that works with ACF, there are a couple of things to keep in mind, and that information helps. I don’t recall you saying you were adding this to a plugin but I could have missed it.
When adding field groups you need to add them differently than when adding them in a theme. In the theme you can just check to see if the function exists, using the exported code. When adding them in the plugin you need to add them on the acf hook
acf/include_fields or on the WP
init hook. You can probably also use the WP
plugins_loaded hook. More then likely if you’re just checking for the function and your plugin loads before ACF loads then the field group is not being created because the function does not exist… yet.
If you are getting existing fields or field groups and attempting to modify them you can run into trouble as well. ACF stores the field groups and fields in a cache and if you modify them after they have been cached then those changes will not be effective unless you clear the ACF cached value. If this is the case then you’ll want to dig into the ACF functions that you’re calling to get the fields and groups, figure out what cache value is being set and then clear that value before trying to make your changes.
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!
© 2022 Advanced Custom Fields.