Use current_time() to calculate current time. Props filosofo. fixes #10915
git-svn-id: http://svn.automattic.com/wordpress/trunk@12590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
00df0c3f5f
commit
d375ef7d54
|
@ -2610,7 +2610,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
|
|||
|
||||
// echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
|
||||
|
||||
$time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
|
||||
$time_adj = current_time('timestamp');
|
||||
$post_date = ($for_post) ? $post->post_date : $comment->comment_date;
|
||||
$jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj );
|
||||
$mm = ($edit) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj );
|
||||
|
|
|
@ -1123,7 +1123,7 @@ function get_calendar($initial = true) {
|
|||
echo "\n\t</tr>\n\t<tr>\n\t\t";
|
||||
$newrow = false;
|
||||
|
||||
if ( $day == gmdate('j', (time() + (get_option('gmt_offset') * 3600))) && $thismonth == gmdate('m', time()+(get_option('gmt_offset') * 3600)) && $thisyear == gmdate('Y', time()+(get_option('gmt_offset') * 3600)) )
|
||||
if ( $day == gmdate('j', current_time('timestamp')) && $thismonth == gmdate('m', current_time('timestamp')) && $thisyear == gmdate('Y', current_time('timestamp')) )
|
||||
echo '<td id="today">';
|
||||
else
|
||||
echo '<td>';
|
||||
|
|
|
@ -289,7 +289,7 @@ function get_attachment_link($id = false) {
|
|||
function get_year_link($year) {
|
||||
global $wp_rewrite;
|
||||
if ( !$year )
|
||||
$year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
|
||||
$year = gmdate('Y', current_time('timestamp'));
|
||||
$yearlink = $wp_rewrite->get_year_permastruct();
|
||||
if ( !empty($yearlink) ) {
|
||||
$yearlink = str_replace('%year%', $year, $yearlink);
|
||||
|
@ -311,9 +311,9 @@ function get_year_link($year) {
|
|||
function get_month_link($year, $month) {
|
||||
global $wp_rewrite;
|
||||
if ( !$year )
|
||||
$year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
|
||||
$year = gmdate('Y', current_time('timestamp'));
|
||||
if ( !$month )
|
||||
$month = gmdate('m', time()+(get_option('gmt_offset') * 3600));
|
||||
$month = gmdate('m', current_time('timestamp'));
|
||||
$monthlink = $wp_rewrite->get_month_permastruct();
|
||||
if ( !empty($monthlink) ) {
|
||||
$monthlink = str_replace('%year%', $year, $monthlink);
|
||||
|
@ -337,11 +337,11 @@ function get_month_link($year, $month) {
|
|||
function get_day_link($year, $month, $day) {
|
||||
global $wp_rewrite;
|
||||
if ( !$year )
|
||||
$year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
|
||||
$year = gmdate('Y', current_time('timestamp'));
|
||||
if ( !$month )
|
||||
$month = gmdate('m', time()+(get_option('gmt_offset') * 3600));
|
||||
$month = gmdate('m', current_time('timestamp'));
|
||||
if ( !$day )
|
||||
$day = gmdate('j', time()+(get_option('gmt_offset') * 3600));
|
||||
$day = gmdate('j', current_time('timestamp'));
|
||||
|
||||
$daylink = $wp_rewrite->get_day_permastruct();
|
||||
if ( !empty($daylink) ) {
|
||||
|
|
Loading…
Reference in New Issue