pre_load_textdomain
Filters whether to short-circuit loading .mo file.
Returning a non-null value from the filter will effectively short-circuit the loading, returning the passed value instead.
Usage
add_filter( 'pre_load_textdomain', 'wp_kama_pre_load_textdomain_filter', 10, 4 );
/**
* Function for `pre_load_textdomain` filter-hook.
*
* @param bool|null $loaded The result of loading a .mo file.
* @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|null
*/
function wp_kama_pre_load_textdomain_filter( $loaded, $domain, $mofile, $locale ){
// filter...
return $loaded;
}
- $loaded(true|false|null)
- The result of loading a .mo file.
Default: null - $domain(string)
- Text domain. Unique identifier for retrieving translated strings.
- $mofile(string)
- Path to the MO file.
- $locale(string|null)
- Locale.
Changelog
| Since 6.3.0 | Introduced. |
Where the hook is called
pre_load_textdomain
wp-includes/l10n.php 749
$loaded = apply_filters( 'pre_load_textdomain', null, $domain, $mofile, $locale );