Code Element Lj

Update ACF Local Json Path

You can update the default ACF Local Json path using the native acf/settings filter hook.

Replace:

path/to/new/directory: with your new directory path

/**
 * Add custom ACF json Save Path
 */
add_filter('acf/settings/save_json', function ($path) {
    
    // update path
    $path = 'path/to/new/directory';
    
    // return
    return $path;
});

/**
 * Add custom ACF json Load Path
 */
add_filter('acf/settings/load_json', function ($paths) {
    
    // remove original path (optional)
    unset($paths[0]);
    
    // append path
    $paths[] = 'path/to/new/directory';
    
    // return
    return $paths;
});