load_translation_file filter-hookWP 6.5.0

Filters the file path for loading translations for the given text domain.

Similar to the load_textdomain_mofile filter with the difference that the file path could be for an MO or PHP file.

Usage

add_filter( 'load_translation_file', 'wp_kama_load_translation_file_filter', 10, 3 );

/**
 * Function for `load_translation_file` filter-hook.
 * 
 * @param string $file   Path to the translation file to load.
 * @param string $domain The text domain.
 * @param string $locale The locale.
 *
 * @return string
 */
function wp_kama_load_translation_file_filter( $file, $domain, $locale ){

	// filter...
	return $file;
}
$file(string)
Path to the translation file to load.
$domain(string)
The text domain.
$locale(string)
The locale.

Changelog

Since 6.5.0 Introduced.
Since 6.6.0 Added the $locale parameter.

Where the hook is called

load_textdomain()
load_translation_file
wp-includes/l10n.php 843
$file = (string) apply_filters( 'load_translation_file', $file, $domain, $locale );

Where the hook is used in WordPress

Usage not found.