Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

ACF – Local json for plugin

<?php
/*
Plugin Name: ACF Local JSON plugin
Plugin URI: 
Description: Put this file in a plugin folder and create an /acf directory inside the plugin, ie: /my-plugin/acf
Author: khromov
Version: 0.1
*/
 
//Change ACF Local JSON save location to /acf folder inside this plugin
add_filter('acf/settings/save_json', function() {
    return dirname(__FILE__) . '/acf';
});
 
//Include the /acf folder in the places to look for ACF Local JSON files
add_filter('acf/settings/load_json', function($paths) {
    $paths[] = dirname(__FILE__) . '/acf';
    return $paths;
});