ACF Pro – ACF JSON save hook not saving
-
I am trying to save my Field Groups as JSON files, so I added the following code to my main plugin file of another plugin:
// acf save to json define( 'MY_PLUGIN_DIR_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); add_filter('acf/settings/save_json', 'my_acf_json_save_point'); function my_acf_json_save_point( $path ) { // Set the path $path = MY_PLUGIN_DIR_PATH . '/acf-json'; // Return path return $path; }
and then made the folder ‘acf-json’ in my plugin directory. Adding this function made a new column appear in my acf ‘Field Groups’ page called “Local JSON”. I then created a new field group to test this out. The new field group says “Awaiting Save” under the new column, but I updated the group and no json file is being written to the acf-json directory. Am I leaving out a step?
What I have Tried:
After a search online, I found that people having similar issues needed to change the permissions on the “acf-json’ directory to allow writing, so I did that but nothing changed.
- The topic ‘ACF Pro – ACF JSON save hook not saving’ is closed to new replies.