ACF JSON Field
WordPress plugin that adds a new ACF field type for editing, saving, and displaying JSON data
by Jean-Philippe Fleury · github.com/jpfleury/acf-json-field
★ 0stars
4release downloads
0forks
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/jpfleury/acf-json-field/releases/download/1.0.14/acf-json-field.zipFrom the readme
ACF JSON Field
ACF JSON Field is a WordPress plugin that adds a new ACF field type for editing, saving, and displaying JSON data.
Installation
- Download the latest version from GitHub.
- Extract the archive and copy the folder (acf-json-field) into your WordPress plugins directory (/wp-content/plugins/).
- In your WordPress admin dashboard (https://.../wp-admin/plugins.php), enable the ACF JSON Field plugin. Note: You can enable auto-updates.
Usage
Go to the ACF administration page (https://.../wp-admin/edit.php?posttype=acf-field-group), create a new field group, and choose the JSON field type. Adjust the field settings as needed.
When editing a post or page with a JSON field, a dedicated editor will allow users to modify the JSON content:
Utilities and shortcode
The plugin provides utility methods to retrieve, format, and set JSON data for a given ACF field, as well as a shortcode for displaying this data on the front end.
To retrieve JSON data, use the getjsonfield method:
Alternatively:
To set JSON data for a specific ACF field, use the setjsonfield method:
To encode PHP data into a JSON string with pretty-print formatting, use the encode method:
To display the
Read the full README on GitHub →