acf/json/save_file_name
Filters the filename used when saving JSON.
Использование
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(строка)
- The default filename.
- $post(массив)
- The main post array for the item being saved.
- $load_path(строка)
- The path that the item was loaded from.
Список изменений
| С версии 6.2 | Введена. |
Где вызывается хук
acf/json/save_file_name
acf/includes/local-json.php 392
$filename = apply_filters( 'acf/json/save_file_name', $key . '.json', $post, $load_path );