From da5ca1d1c64ea812e22679f71e07b3f5ccd9b49d Mon Sep 17 00:00:00 2001 From: westi 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: http://svn.automattic.com/wordpress/trunk@17841 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 622a9279a..575b78ce1 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;