Filters whether to short-circuit loading .mo file.
Description
Returning a non-null value from the filter will effectively short-circuit the loading, returning the passed value instead.
Parameters
$loaded
bool|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.
Source
*/
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |
Optimization if you don’t need languages added
In case you want to prevent languages from loading if your site will be only in English (en_US), stop this hook:
add_filter(‘pre_load_textdomain’, ‘__return_false’, -42);