translation_file_format
Filters the preferred file format for translation files.
Can be used to disable the use of PHP files for translations.
Usage
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(string)
- Preferred file format. Possible values: 'php', 'mo'.
Default: 'php' - $domain(string)
- The text domain.
Changelog
| Since 6.5.0 | Introduced. |
Where the hook is called
translation_file_format
wp-includes/l10n.php 816
$preferred_format = apply_filters( 'translation_file_format', 'php', $domain );