Title: PHP Sync issue
Last modified: August 27, 2021

---

# PHP Sync issue

 *  Resolved [Begin](https://wordpress.org/support/users/bentalgad/)
 * (@bentalgad)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-sync-issue/)
 * Hi there,
 * So i tried to add this code to my plugin:
 *     ```
       add_filter('acfe/settings/php_save/key=group_6125011e58c70', 'my_acfe_php_save_point', 10, 2);
       function my_acfe_php_save_point($path, $field_group){
   
           return plugin_dir_path(__DIR__).'my-settings/inc';
   
       }
       ```
   
 * Where ‘group_6125011e58c70’ is of course the id of my fields group, and the folder
   is my folder of choice to save php to. Also i checked the “PHP” checkbox on that
   fields group “Advenced Settings” metabox.
 * Now i was expecting that when i update this fields group it would save a php 
   file to this folder (am i wrong to expect this behaviour?) but nothing happend
   when i updated the fields group.
 * *When hovering the “PHP” Checkbox is see this error:
    “Awaiting save. Save path
   not found in theme: /acfe-php”
 * Do i have to add this folder to the current theme? (I Need this php file in my
   plugin’s folder…)
 * Thanks,
    Ben
    -  This topic was modified 4 years, 9 months ago by [Begin](https://wordpress.org/support/users/bentalgad/).
    -  This topic was modified 4 years, 9 months ago by [Begin](https://wordpress.org/support/users/bentalgad/).
    -  This topic was modified 4 years, 9 months ago by [Begin](https://wordpress.org/support/users/bentalgad/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-sync-issue/#post-14827380)
 * Hello,
 * Thanks for the feedback!
 * Your expectations are correct, the PHP file will created and updated at the location
   designated in the filter everytime you update the Field Group in the ACF admin.
 * However, there is a problem in your code. In fact `plugin_dir_path(__DIR__)` 
   will return the path to the WP Plugins folder: `/wp-content/plugins/` and not
   the folder of your plugin: `/wp-content/plugins/my-plugin/`.
 * I would recommend to use `plugin_dir_path(__FILE__)` in order to correctly return
   the full plugin path:
 *     ```
       add_filter('acfe/settings/php_save/key=group_6125011e58c70', 'my_acfe_php_save_point', 10, 2);
       function my_acfe_php_save_point($path, $field_group){
   
           // 2 possible solutions:
           // plugin_dir_path(__DIR__) . 'my-plugin/my-settings/inc'
           // plugin_dir_path(__FILE__) . 'my-settings/inc'
   
           return plugin_dir_path(__FILE__) . 'my-settings/inc';
   
       }
       ```
   
 * Hope it helps!
 * Have a nice day!
 * Regards.
 *  Thread Starter [Begin](https://wordpress.org/support/users/bentalgad/)
 * (@bentalgad)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-sync-issue/#post-14827698)
 * Wow, that was a basic mistake 🙂
 * Thank you very much!
 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-sync-issue/#post-14827779)
 * Hello,
 * I’m glad to hear your issue has been fixed!
 * If you enjoy this plugin and its support, feel free to [submit a review](https://wordpress.org/support/plugin/acf-extended/reviews/#new-post).
   It always helps and it’s much appreciated 🙂
 * Have a nice day!
 * Regards.
 *  Thread Starter [Begin](https://wordpress.org/support/users/bentalgad/)
 * (@bentalgad)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-sync-issue/#post-14828021)
 * I will!
 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-sync-issue/#post-14828075)
 * Thank you very much 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘PHP Sync issue’ 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/)

## Tags

 * [ACF](https://wordpress.org/support/topic-tag/acf/)

 * 5 replies
 * 2 participants
 * Last reply from: [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/php-sync-issue/#post-14828075)
 * Status: resolved