custom post type and ACF json syncing

This commit is contained in:
Steve Ross
2024-11-06 22:42:07 +00:00
parent d0733bfc01
commit feebb7c94a
8 changed files with 13592 additions and 0 deletions

25
app/ACF/JSON.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
namespace App\ACF;
class JSON
{
public function __construct()
{
add_filter('acf/settings/save_json', [$this, 'save']);
add_filter('acf/settings/load_json', [$this, 'load']);
}
public function save( $path )
{
$path = get_stylesheet_directory() . '/acf-json';
return $path;
}
public function load( $paths )
{
unset($paths[0]);
$paths[] = get_stylesheet_directory() . '/acf-json';
return $paths;
}
}