{"id":35048283,"url":"https://github.com/jpfleury/acf-json-field","last_synced_at":"2026-04-07T23:31:26.854Z","repository":{"id":247300870,"uuid":"824399382","full_name":"jpfleury/acf-json-field","owner":"jpfleury","description":"WordPress plugin that adds a new ACF field type for editing, saving, and displaying JSON data","archived":false,"fork":false,"pushed_at":"2025-05-25T06:22:50.000Z","size":591,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-28T23:04:34.781Z","etag":null,"topics":["acf","acf-addon","acf-field","javascript","json","json-data","json-editor","php","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpfleury.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-05T04:00:14.000Z","updated_at":"2025-05-25T06:22:45.000Z","dependencies_parsed_at":"2024-07-08T00:24:34.760Z","dependency_job_id":"6851bb47-b9d3-48d9-940a-4dec030394b4","html_url":"https://github.com/jpfleury/acf-json-field","commit_stats":null,"previous_names":["misaki-web/acf-json-field","jpfleury/acf-json-field"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/jpfleury/acf-json-field","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpfleury%2Facf-json-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpfleury%2Facf-json-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpfleury%2Facf-json-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpfleury%2Facf-json-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpfleury","download_url":"https://codeload.github.com/jpfleury/acf-json-field/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpfleury%2Facf-json-field/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31533823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acf","acf-addon","acf-field","javascript","json","json-data","json-editor","php","wordpress","wordpress-plugin"],"created_at":"2025-12-27T09:02:47.813Z","updated_at":"2026-04-07T23:31:26.824Z","avatar_url":"https://github.com/jpfleury.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![release.yml](https://github.com/jpfleury/acf-json-field/actions/workflows/release.yml/badge.svg)](https://github.com/jpfleury/acf-json-field/releases)\n\n# ACF JSON Field\n\nACF JSON Field is a WordPress plugin that adds a new ACF field type for editing, saving, and displaying JSON data.\n\n## Installation\n\n- Download the [latest version from GitHub](https://github.com/jpfleury/acf-json-field/releases/latest/download/acf-json-field.zip).\n\n- Extract the archive and copy the folder (`acf-json-field`) into your WordPress plugins directory (`/wp-content/plugins/`).\n\n- In your WordPress admin dashboard (`https://.../wp-admin/plugins.php`), enable the **ACF JSON Field** plugin. Note: You can enable auto-updates.\n\n## Usage\n\nGo to the ACF administration page (`https://.../wp-admin/edit.php?post_type=acf-field-group`), create a new field group, and choose the **JSON** field type. Adjust the field settings as needed.\n\n![JSON Field in the list of ACF fields](assets/screenshots/json-field.png)\n\nWhen editing a post or page with a JSON field, a dedicated editor will allow users to modify the JSON content:\n\n![JSON editor](assets/screenshots/editor.png)\n\n### Utilities and shortcode\n\nThe 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.\n\nTo retrieve JSON data, use the `get_json_field` method:\n\n```php\nuse \\AcfJsonField\\JsonUtils;\n\n// Retrieve the JSON data as a PHP type (array, boolean, etc.) for the current post\n$json_data = JsonUtils::get_json_field('field_name_or_key');\n$json_data = JsonUtils::get_json_field('field_name_or_key', false);\n$json_data = JsonUtils::get_json_field('field_name_or_key', null);\n\n// For a specific post ID\n$json_data = JsonUtils::get_json_field('field_name_or_key', 125);\n\n// For the current user\n$json_data = JsonUtils::get_json_field('field_name_or_key', 'user');\n\n// For a specific user\n$json_data = JsonUtils::get_json_field('field_name_or_key', 'user_24');\n\n// Retrieve the JSON data as an HTML-formatted string\n$json_html = JsonUtils::get_json_field('field_name_or_key', $id, 'html');\n```\n\nAlternatively:\n\n```php\n$json_data = \\AcfJsonField\\JsonUtils::get_json_field('field_name_or_key');\n```\n\nTo set JSON data for a specific ACF field, use the `set_json_field` method:\n\n```php\n$php_data = ['lorem1' =\u003e 'ipsum2', 'lorem2' =\u003e 'ipsum2'];\n$success = JsonUtils::set_json_field('field_name_or_key', $php_data, 125);\n\n$json_encoded = json_encode($php_data);\n$success = JsonUtils::set_json_field('field_name_or_key', $json_encoded, 125, true);\n```\n\nTo encode PHP data into a JSON string with pretty-print formatting, use the `encode` method:\n\n```php\n$json_encoded = JsonUtils::encode($php_data);\n```\n\nTo display the field value on the front end, use the `acf_json_field` shortcode. By default, it fetches the field value from the current post:\n\n\t[acf_json_field field=\"field_name_or_key\"]\n\nTo fetch the value from a different post, specify the `id`:\n\n\t[acf_json_field field=\"field_name_or_key\" id=\"125\"]\n\nIf the field is linked to the current user:\n\n\t[acf_json_field field=\"field_name_or_key\" id=\"user\"]\n\nOr for a specific user:\n\n\t[acf_json_field field=\"field_name_or_key\" id=\"user_24\"]\n\n## License\n\nACF JSON Field: A WordPress plugin that adds a new ACF field for editing, saving, and displaying JSON data\n\nCopyright (C) 2024  Jean-Philippe Fleury\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n### Third-party code\n\n- ACF JSON Field uses [Plugin Update Checker](https://github.com/YahnisElsts/plugin-update-checker) under the [MIT License](https://github.com/YahnisElsts/plugin-update-checker/blob/master/license.txt) to manage auto-updates within the WordPress plugin manager.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpfleury%2Facf-json-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpfleury%2Facf-json-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpfleury%2Facf-json-field/lists"}