acf_sync_check_json_dirs

Plugin Name: ACF Pro JSON Sync Description: Sync Advanced Custom Fields fields stored in json files into the database.

Description

acf_sync_check_json_dirs(); 

Ideal for using ACF in multiple environments or in a team setting. Version: 1.0.1 Author: O3 World Author URI: http://o3world.com


Usage

  1. if ( !function_exists( 'acf_sync_check_json_dirs' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'acf-pro-json-sync/acf-sync.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = acf_sync_check_json_dirs(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/acf-sync.php  
  1. function acf_sync_check_json_dirs() { 
  2. //Get all json save points 
  3. $json_dirs = acf_get_setting('load_json'); 
  4.  
  5. $missing_dirs = array(); 
  6.  
  7. foreach ( $json_dirs as $dir ) { 
  8. if (!file_exists($dir)) { 
  9. $missing_dirs[] = $dir; 
  10.  
  11. if(!empty($missing_dirs)) { 
  12. return $missing_dirs; 
  13.  
  14. return false;