Bug? PHP AutoSync
-
Hi,
when I change the php auto sync path, the deleting doesn’t work properly.
After adding the filter to the “delete_field_group” function it worked seamless.Is this a bug or am I doing something wrong?
function delete_field_group($field_group){ // bail early if(!$this->is_php_enabled()){ return; } // bail early if(!acfe_has_php_sync($field_group)){ return; } // vars $id = $field_group['ID']; $key = $field_group['key']; $path = untrailingslashit(acf_get_setting('acfe/php_save')); // backup path $new_path = $path; // filters $new_path = apply_filters("acfe/settings/php_save/all", $new_path, $field_group); $new_path = apply_filters("acfe/settings/php_save/ID={$id}", $new_path, $field_group); $new_path = apply_filters("acfe/settings/php_save/key={$key}", $new_path, $field_group); $diff = $path !== $new_path; // custom path if($diff){ acf_update_setting('acfe/php_save', $new_path); } // wp appends '__trashed' to end of 'key' (post_name) $key = str_replace('__trashed', '', $field_group['key']); // delete file $this->delete_file($key); // restore if($diff){ acf_update_setting('acfe/php_save', $path); } }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Bug? PHP AutoSync’ is closed to new replies.