override_load_textdomain
Filters whether to override the .mo file loading.
Usage
add_filter( 'override_load_textdomain', 'wp_kama_override_load_textdomain_filter', 10, 4 ); /** * Function for `override_load_textdomain` filter-hook. * * @param bool $override Whether to override the .mo file loading. * @param string $domain Text domain. Unique identifier for retrieving translated strings. * @param string $mofile Path to the MO file. * @param string|null $locale Locale. * * @return bool */ function wp_kama_override_load_textdomain_filter( $override, $domain, $mofile, $locale ){ // filter... return $override; }
- $override(true|false)
- Whether to override the .mo file loading.
Default: false - $domain(string)
- Text domain. Unique identifier for retrieving translated strings.
- $mofile(string)
- Path to the MO file.
- $locale(string|null)
- Locale.
Changelog
Since 2.9.0 | Introduced. |
Since 6.2.0 | Added the $locale parameter. |
Where the hook is called
override_load_textdomain
wp-includes/l10n.php 768
$plugin_override = apply_filters( 'override_load_textdomain', false, $domain, $mofile, $locale );