diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index a0c7bba903..9467a6b19c 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -717,6 +717,28 @@ function load_textdomain( $domain, $mofile, $locale = null ) { $l10n_unloaded = (array) $l10n_unloaded; + /** + * 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. + * + * @since 6.3.0 + * + * @param bool|null $loaded The result of loading a .mo file. Default null. + * @param string $domain Text domain. Unique identifier for retrieving translated strings. + * @param string $mofile Path to the MO file. + * @param string|null $locale Locale. + */ + $loaded = apply_filters( 'pre_load_textdomain', null, $domain, $mofile, $locale ); + if ( null !== $loaded ) { + if ( true === $loaded ) { + unset( $l10n_unloaded[ $domain ] ); + } + + return $loaded; + } + /** * Filters whether to override the .mo file loading. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 0343c7ccee..e334013a70 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55927'; +$wp_version = '6.3-alpha-55928'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.