From 900b4b22fac09d0f956f6ee0519d4d6fe24a9973 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 4 May 2024 17:27:09 +0000 Subject: [PATCH] I18N: Pass the `$locale` variable to the `load_translation_file` filter. This avoids the need for the locale to be recalculated by code that hooks into this filter. Props swissspidy, mukesh27, johnbillion Fixes #61108 Built from https://develop.svn.wordpress.org/trunk@58095 git-svn-id: http://core.svn.wordpress.org/trunk@57560 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/l10n.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 9e2a86a759..038b916049 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -833,11 +833,13 @@ function load_textdomain( $domain, $mofile, $locale = null ) { * the file path could be for an MO or PHP file. * * @since 6.5.0 + * @since 6.6.0 Added the `$locale` parameter. * * @param string $file Path to the translation file to load. * @param string $domain The text domain. + * @param string $locale The locale. */ - $file = (string) apply_filters( 'load_translation_file', $file, $domain ); + $file = (string) apply_filters( 'load_translation_file', $file, $domain, $locale ); $success = $i18n_controller->load_file( $file, $domain, $locale ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 50cc8e925c..bb36779962 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-58094'; +$wp_version = '6.6-alpha-58095'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.