ACF_WPML_Compatibility::settings_save_json
settings_save_json
Modifies the json path.
Method of the class: ACF_WPML_Compatibility{}
No Hooks.
Returns
string.
Usage
$ACF_WPML_Compatibility = new ACF_WPML_Compatibility(); $ACF_WPML_Compatibility->settings_save_json( $path );
- $path(string) (required)
- The json save path.
Changelog
| Since 5.0.0 | Introduced. |
ACF_WPML_Compatibility::settings_save_json() ACF WPML Compatibility::settings save json code ACF 6.8.8
function settings_save_json( $path ) {
// bail early if dir does not exist
if ( ! wp_is_writable( $path ) ) {
return $path;
}
// ammend
$path = untrailingslashit( $path ) . '/' . acf_get_setting( 'current_language' );
// make dir if does not exist
if ( ! file_exists( $path ) ) {
mkdir( $path, 0777, true ); //phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_mkdir -- Allow legacy mkdir call as this may fire outside admin.
}
// return
return $path;
}