Title: Change folder for PHP sync files
Last modified: December 25, 2019

---

# Change folder for PHP sync files

 *  Resolved [patricktobias](https://wordpress.org/support/users/patricktobias/)
 * (@patricktobias)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/change-folder-for-php-sync-files/)
 * Is it possible to change the folder for PHP files for `acfe/php_save` and `acfe/
   php_save`?
 * I tried to add these lines to a custom plugin I’ve built without any success,
   I want to sync the files to the plugin instead of the theme folder.
 *     ```
       add_filter('acfe/php_save', plugin_dir_path( __FILE__ ) . '/includes/acfe-php/' );
       add_filter('acfe/php_load', plugin_dir_path( __FILE__ ) . '/includes/acfe-php/' );
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/change-folder-for-php-sync-files/#post-12271130)
 * Hello,
 * Yes, it is possible to change de ACF Extended PHP AutoSync Save/Load paths. However,
   those are ACF settings, and not filters.
 * BTW, there’s some errors in your code, you should use callback functions, and
   not directly set the path in the filter. Please ready the `add_filter()` here:
   [https://developer.wordpress.org/reference/functions/add_filter/](https://developer.wordpress.org/reference/functions/add_filter/).
 * There are two different ways to change ACF settings ([https://www.advancedcustomfields.com/resources/acf-settings/](https://www.advancedcustomfields.com/resources/acf-settings/)).
   You can use `acf_update_setting('acf/settings/acfe/php_save')` or `add_filter('
   acf/settings/acfe/php_save')`.
 * Here is a code example to change the PHP AutoSync Save/load paths:
 *     ```
       add_action('acf/init', 'my_acfe_php_paths');
       function my_acfe_php_paths(){
   
           /*
            * Change PHP Save Path
            */
           acf_update_setting('acfe/php_save', plugin_dir_path( __FILE__ ) . '/includes/acfe-php/');
   
           /*
            * Change PHP Load Path
            */
           acf_update_setting('acfe/php_load', array(plugin_dir_path( __FILE__ ) . '/includes/acfe-php/'));
   
           /*
            * OR: Add a new PHP Load Path
            */
   
           // Get original paths
           $load_paths = acf_get_setting('acfe/php_load');
   
           // Add our custom path
           $load_paths[] = plugin_dir_path( __FILE__ ) . '/includes/acfe-php/';
   
           // Update the setting
           acf_update_setting('acfe/php_load', $load_paths);
   
       }
       ```
   
 * Note: Load path should always be an `array()` (just like the native ACF Json 
   paths: [https://www.advancedcustomfields.com/resources/local-json/](https://www.advancedcustomfields.com/resources/local-json/)).
 * Hope it helps!
 * Have a nice day.
 * Regards.

Viewing 1 replies (of 1 total)

The topic ‘Change folder for PHP sync files’ is closed to new replies.

 * ![](https://ps.w.org/acf-extended/assets/icon-256x256.png?rev=2071550)
 * [Advanced Custom Fields: Extended](https://wordpress.org/plugins/acf-extended/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-extended/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-extended/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-extended/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-extended/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-extended/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/change-folder-for-php-sync-files/#post-12271130)
 * Status: resolved