JSON field for Advanced Custom Fields
Clone or download
Latest commit dc0565d Jun 28, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets initial version Jun 28, 2018
fields initial version Jun 28, 2018
lang initial version Jun 28, 2018
.editorconfig initial version Jun 28, 2018
.gitignore initial version Jun 28, 2018
README.md docs Jun 28, 2018
acf-json.php initial version Jun 28, 2018
composer.json initial version Jun 28, 2018
readme.txt delete stuff from map field Jun 28, 2018
screenshot.png initial version Jun 28, 2018

README.md

ACF JSON Field

JSON field for Advanced Custom Fields.

Preview Field in Wordpress admin

Usage

Basic usage

// Get encoded JSON
$json = get_field('json_field');

// Decode JSON to object
$value = json_decode($json);

// Use the values
echo $value->something;

Pass to javascript variable

<script type="text/javascript">
  window.my_acf_name = <?php echo get_field('json_field') ?>;
</script>

Description

JSON field for Advanced Custom Fields.

Compatibility

This ACF field type is compatible with:

  • ACF 5

Installation

  1. Copy the acf-field-type-json folder into your wp-content/plugins folder
  2. Activate the Advanced Custom Fields: JSON plugin via the plugins admin page
  3. Create a new field via ACF and select the JSON type
  4. Please refer to the description for more info regarding the field type settings

Changelog

Please see readme.txt for changelog

Credits

This ACF field relies heavily on great package https://github.com/josdejong/jsoneditor