custom post type and ACF json syncing
This commit is contained in:
25
app/ACF/JSON.php
Normal file
25
app/ACF/JSON.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user