Home › Forums › Feature Requests › Reusable Fields
Say I have a select field with a list of colors to choose from. I’d like to be able to reuse the list of colors in multiple custom field groups. The point being it’d be managed by one instance.
As far as I can tell, the only way to do this now is to just create a duplicate select field (which is a pain because I have to manually create them all). And then if they ever change, I need to go edit them all. Ideally, I could create once, reuse wherever in different custom field groups, edit from one instance.
This doesn’t seem to warrant creating a custom field type, but it’s somewhat related. Perhaps a field type of custom field group. Then it would let me select from the saved field groups and just bring in an instance of that group. Is this a possibility?
Hi @circlecube
The best solution is to export your field groups to PHP.
That way, you can store this array as a variable and use it in multiple register_field_group functions.
Cheers
E
Yea, I guess that could work.
Feature request then: Would it be possible to create a new field type of a custom field group? Selecting this type would give you a select list of all the custom field groups and selecting one would pull it into this group (maybe not in this edit screen, but where the actual content is entered. Just an idea.
This weekend I started looking at the available plugins for reusable field groups. Testing and research turned into an entire weekend and at the end I had created my own version of a reusable field group field.
It works a bit differently than the others, it works by rebuilding field groups that include a reusable field group field ans local field groups which override the original field groups. This only works in ACF5, ACF4 does not support acf_local()
.
I have not completely tested it and would be interested in feedback or bug reports. I’ll also answer question. There’s not documentation yet, mostly because I think that the instructions when creating the field are pretty self explanatory.
https://github.com/Hube2/acf-reusable-field-group-field
The new clone field solves this! Amazing work @elliot, as usual!
https://www.advancedcustomfields.com/resources/clone/
The topic ‘Reusable Fields’ is closed to new replies.
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.