From bbce167f29a79a1f0db514f95771efedfe6d9c91 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 12 Dec 2015 01:41:24 +0000 Subject: [PATCH] I18N: In `wp_maybe_decline_date()`, bail early if translation functions are not available, e.g. in `SHORTINIT` mode. Fixes #34967 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@35880 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index e3fb35317c..b3781639e2 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -172,6 +172,11 @@ function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) { function wp_maybe_decline_date( $date ) { global $wp_locale; + // i18n functions are not available in SHORTINIT mode + if ( ! function_exists( '_x' ) ) { + return $date; + } + /* translators: If months in your language require a genitive case, * translate this to 'on'. Do not translate into your own language. */