acf/json/save_file_name filter-hookACF 6.2

Filters the filename used when saving JSON.

Usage

add_filter( 'acf/json/save_file_name', 'wp_kama_acf_json_save_file_name_filter', 10, 3 );

/**
 * Function for `acf/json/save_file_name` filter-hook.
 * 
 * @param string $filename  The default filename.
 * @param array  $post      The main post array for the item being saved.
 * @param string $load_path The path that the item was loaded from.
 *
 * @return string
 */
function wp_kama_acf_json_save_file_name_filter( $filename, $post, $load_path ){

	// filter...
	return $filename;
}
$filename(string)
The default filename.
$post(array)
The main post array for the item being saved.
$load_path(string)
The path that the item was loaded from.

Changelog

Since 6.2 Introduced.

Where the hook is called

ACF_Local_JSON::get_filename()
acf/json/save_file_name
acf/includes/local-json.php 484
$filename = apply_filters( 'acf/json/save_file_name', $key . '.json', $post, $load_path );

Where the hook is used in Advanced Custom Fields PRO

Usage not found.