load_script_translations
Filters script translations for the given file, script handle and text domain.
Использование
add_filter( 'load_script_translations', 'wp_kama_load_script_translations_filter', 10, 4 );
/**
* Function for `load_script_translations` filter-hook.
*
* @param string $translations JSON-encoded translation data.
* @param string $file Path to the translation file that was loaded.
* @param string $handle Name of the script to register a translation domain to.
* @param string $domain The text domain.
*
* @return string
*/
function wp_kama_load_script_translations_filter( $translations, $file, $handle, $domain ){
// filter...
return $translations;
}
- $translations(строка)
- JSON-encoded translation data.
- $file(строка)
- Path to the translation file that was loaded.
- $handle(строка)
- Name of the script to register a translation domain to.
- $domain(строка)
- The text domain.
Список изменений
| С версии 5.0.2 | Введена. |
Где вызывается хук
wp-includes/l10n.php 1404
return apply_filters( 'load_script_translations', $translations, $file, $handle, $domain );