Closed digisavvy closed 2 years ago
Also, here's the code I placed inside functions.php to change these paths
/**
* Change where the ACFE PHP Save/Load folder is located. We do this
* for Pantheon Compatibility.
*/
add_action('acf/init', 'iwp_acfe_php_paths');
function iwp_acfe_php_paths(){
/*
* Change PHP Save Path
*/
acf_update_setting('acfe/php_save', get_site_url() . '/wp-content/uploads/acfe-php/');
/*
* Change PHP Load Path
*/
acf_update_setting('acfe/php_load', array(get_site_url() . '/wp-content/uploads/acfe-php/'));
}
Hello,
Thanks for the feedback!
The get_site_url()
function will return an URL like https://www.example.com
. PHP need local server path in order to write & include PHP files, like /var/www/example.com/file.php
.
In order to get local path you can use the following methods:
get_stylesheet_directory()
will return /var/www/example.com/wp-content/themes/my-theme
(See documentation)ABSPATH
will return /var/www/example.com/
WP_CONTENT_DIR
will return /var/www/example.com/wp-content
(See documentation)Hope it helps!
Have a nice day!
Regards.
Describe the bug I'm having an issue where ACFE is not saving/syncing to the
acfe-php
folder on my site I'm working with. It's hosted on Pantheon.To Reproduce I created the
acfe-php
folder inside the active theme folder first. But the syncing wasn't happening. I get the errorsave path not found in theme acfe-php
.I tried updating the folder locations using a pair of filters I found in the WP.org plugin support forums, still, I had the same issue. I've tried saving my field groups, adding fields/removing fields and I get the same error. I tried even creating a symlink that points from the theme folder /acfe-php location to a location in uploads folder (which is writeable by Pantheon) and still no joy.
Expected behavior I expect ACFE to be able to write to the appropriate folders
Screenshots Screenshot 1
WordPress & ACF WordPress version: 5.8.2 ACF Pro version: 5.11.4 ACF add-ons: 0.8.8.7
Add any other context about the problem here.