Home › Forums › ACF PRO › Best Approach to Premium Theme Use? › Reply To: Best Approach to Premium Theme Use?
Have to looked at this feature of ACF Pro https://www.advancedcustomfields.com/resources/local-json/
ACF can save the field groups as JSON files that can be automatically loaded. JSON files can be loaded from multiple places, for example if you don’t want the person that purchases the them to have the ability to alter them in the ACF interface. They can also be loaded manually, as an example you can look at this https://github.com/Hube2/ssi-standard-features/blob/master/acf-loader.php. I have this set up so that I can work on the field groups on my dev site in the ACF admin. I then copy the JSON files into my plugin. The loader will load the field groups only if they are not already defined, which means on my dev site the JSON files are ignored and on sites where I have the plugin install the JSON files are loaded.
Changing settings is a little more difficult, if the field is not backwards compatible. Some examples: If you change the default value this could alter the way that it work. Altering the field type would be a problem. Or changing the values so that something that could be selected in the paste is no longer possible. There is nothing in ACF that will automatically update old values to new values. If this is something that needs to be done then you’d need to build an update function that takes care of the details.
Creating default pages that can be modified is something else that you need to do on your own. You’ll need to create a theme activation action that checks for and/or inserts the posts into WP and adds all the necessary values to the ACF fields.
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.