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
This commit is contained in:
Peter Westwood 2011-05-08 17:14:36 +00:00
parent f9eb2a0ed4
commit e766d629b8
1 changed files with 10 additions and 0 deletions

View File

@ -85,6 +85,16 @@ function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) {
global $wp_locale; global $wp_locale;
$i = $unixtimestamp; $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 // store original value for language with untypical grammars
// see http://core.trac.wordpress.org/ticket/9396 // see http://core.trac.wordpress.org/ticket/9396
$req_format = $dateformatstring; $req_format = $dateformatstring;