From e766d629b8315436dbcfc6b831bdb52eedfd1dc9 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sun, 8 May 2011 17:14:36 +0000 Subject: [PATCH] Restore the functionality of date_i18n to pre [17747] so that is works without a provided timestamp again. Fixes #17278. git-svn-id: https://develop.svn.wordpress.org/trunk@17841 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 622a9279a8..575b78ce15 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -85,6 +85,16 @@ function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) { global $wp_locale; $i = $unixtimestamp; + if ( false === $i ) { + if ( ! $gmt ) + $i = current_time( 'timestamp' ); + else + $i = time(); + // we should not let date() interfere with our + // specially computed timestamp + $gmt = true; + } + // store original value for language with untypical grammars // see http://core.trac.wordpress.org/ticket/9396 $req_format = $dateformatstring;