From 7d09b0bb0d032aaa123640fcae67bd9bcf1e0693 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 27 Oct 2016 06:39:16 +0000 Subject: [PATCH] I18N: Apply the `locale` filter when returning early in `get_locale()`. See [38976]. See #29783. git-svn-id: https://develop.svn.wordpress.org/trunk@38978 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/l10n.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/l10n.php b/src/wp-includes/l10n.php index 30cacf4a67..2c227bc1da 100644 --- a/src/wp-includes/l10n.php +++ b/src/wp-includes/l10n.php @@ -53,10 +53,11 @@ function get_locale() { // If $wpdb hasn't been initialised yet, we can only return what we have. if ( ! $wpdb ) { if ( ! $locale ) { - return 'en_US'; + $locale = 'en_US'; } - return $locale; + /** This filter is documented in wp-includes/l10n.php */ + return apply_filters( 'locale', $locale ); } // If multisite, check options.