translation_file_format
Filters the preferred file format for translation files.
Can be used to disable the use of PHP files for translations.
Использование
add_filter( 'translation_file_format', 'wp_kama_translation_file_format_filter', 10, 2 ); /** * Function for `translation_file_format` filter-hook. * * @param string $preferred_format Preferred file format. Possible values: 'php', 'mo'. * @param string $domain The text domain. * * @return string */ function wp_kama_translation_file_format_filter( $preferred_format, $domain ){ // filter... return $preferred_format; }
- $preferred_format(строка)
- Preferred file format. Possible values: 'php', 'mo'.
По умолчанию: 'php' - $domain(строка)
- The text domain.
Список изменений
С версии 6.5.0 | Введена. |
Где вызывается хук
translation_file_format
wp-includes/l10n.php 815
$preferred_format = apply_filters( 'translation_file_format', 'php', $domain );