I would need to implement a functionality where different post categories have different field groups, each containing a text field.
Since I couldn’t think of a better solution, I’m thinking I could set up an Options Page where the admin of the site would specify the post category and the name of the field group, in a repeater field.
Then, these field groups would be programmatically added using acf_add_local_field_group, registering fields while looping through the repeater of the options page.
Then I would get the actual field values of specific posts using get_fields.
I hope that makes sense.
Now, my question is: is this a bad practice or is there any issue with it? Or is it fine?
Also, anyone knows what would happen if I added a repeater row on the Options page, then deleted it? Would the field groups generated by it be deleted as well?
I will try it out but not sure if this is flawed logic or not.
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
2022 was a big year for Advanced Custom Fields, with more capabilities, a new generation of ACF Blocks, a refreshed UI, and a new home. Our year in review post looks at advancements we’ve made and offers a glimpse of the future. https://t.co/HahJUCcyH4