translation_file_format filter-hookWP 6.5.0

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

load_textdomain()
translation_file_format
wp-includes/l10n.php 815
$preferred_format = apply_filters( 'translation_file_format', 'php', $domain );

Where the hook is used in WordPress

Usage not found.