How to use local JSON in ACF theme?

How to use local JSON in ACF theme?

To start using the local JSON feature, simply create a new folder in your theme and name it acf-json. This folder must have permissions for the server to read and write (in most cases 755 will work well). Once this folder exists, each time you save a field group a JSON file will be created (or updated) with the field group and field settings.

How is a JSON file named in ACF?

The JSON file will be named using the field group’s unique key. Now that the JSON file exists, ACF will load the relevant field group and field settings from this file which reduces the number of database calls during your page load! Each time you save a field group a JSON file will be created (or updated) with the field group and field settings.

Can a callback function be changed in ACF?

You can make changes to your block template or callback function at any time. ACF blocks are 100% dynamic meaning that they are rendered by the server each time they are loaded. This allows changes to block templates to be applied all existing block content. Can I register a block without fields?

How are ACF blocks compatible with all fields?

ACF blocks offer full compatibility with all field types including both the Repeater and Clone fields! It’s a similar story for template functions too. Whether you are loading a field value via get_field (), or looping over a Repeater field using have_rows (), the experience remains familiar and consistent to regular theme development.

How to save a field group in JSON?

Each time you save a field group a JSON file will be created (or updated) with the field group and field settings. The JSON file will be named using the field group’s unique key. Only 1 save point (folder) exists and can be customized by adding the following code to your theme.

How to add a new load point in ACF?

To add a new load point (folder) for ACF to look in, please add the following code to your theme or plugin. This filter will allow plugin and theme developers to easily register field groups which cannot be edited by clients. The real power in ‘local JSON’ is the ability to sync changes.