Home › Forums › Feature Requests › Static Definitions of Fields
Hi,
I absolutely love using the ACF plugin and addons, but one thing that I seem to get a bit irky with is when it comes to synchronise changes between different install locations of a WordPress site.
Say, for example, I have a local and remote copy of a website for a client. My work is done locally, and then uploaded to the remote copy for the client to see at regular intervals. If, for whatever reason, a new field needs to be added, then I need to do one of the following:
The former being better for larger additions or alterations, the latter being better for smaller additions or alterations.
I would like to see a better, easier solution, a way to easily synch changes between two installs. A solution would be to be able to statically declare field groups and fields, done most likely in one of two ways:
Obviously both have pros and cons. The former would require a lot more initial setup, but allows the field decelerations to be stored in the DB in the exact same way they are now, only requiring you to add a method to import them. The latter requires you to add an extra check each time the field definitions are required to see if any exist in the code and would raise issues like compatibility between code / server field definitions (overwriting names, etc), but would provide instant sync when code is uploaded.
Either way, you would need to define a setup of some sort to be able to easily create/define fields and field groups.
Thanks for reading!
ACF does have a method to load fields from code using “Export as PHP”. However, this does require that the fields are first created using the GUI, then exported, deleted via GUI, and included via PHP file… got me thinking about an “ACF field generator” which would basically be a web-based version of the GUI that outputs PHP code (like generatewp.com but for ACF). Of course, then there’s always the issue of name conflicts, incompatibility with custom field types, etc…
A static field is in programming languages is the declaration for a variable that will be held in common by all instances of a class. The static modifier determines the class variable as one that will be applied universally to all instances of a particular class. uspstracking.com A static field may also be called a class variable.
The topic ‘Static Definitions of 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!
The most recent ACF Chat Friday featured a live demo of how to register CPTs directly in the plugin, one of our most requested features. Check out the summary below for a replay of the demo, and don’t forget to register for the next session! https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 9, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.