load_script_translation_file
Filters the file path for loading script translations for the given script handle and text domain.
Usage
add_filter( 'load_script_translation_file', 'wp_kama_load_script_translation_file_filter', 10, 3 ); /** * Function for `load_script_translation_file` filter-hook. * * @param string|false $file Path to the translation file to load. False if there isn't one. * @param string $handle Name of the script to register a translation domain to. * @param string $domain The text domain. * * @return string|false */ function wp_kama_load_script_translation_file_filter( $file, $handle, $domain ){ // filter... return $file; }
- $file(string|false)
- Path to the translation file to load. False if there isn't one.
- $handle(string)
- Name of the script to register a translation domain to.
- $domain(string)
- The text domain.
Changelog
Since 5.0.2 | Introduced. |
Where the hook is called
wp-includes/l10n.php 1248
$file = apply_filters( 'load_script_translation_file', $file, $handle, $domain );