Make WordPress Core

Ticket #10915: use.current_time.10915.diff

File use.current_time.10915.diff, 3.2 KB (added by filosofo, 15 years ago)
  • wp-includes/link-template.php

     
    286286function get_year_link($year) {
    287287        global $wp_rewrite;
    288288        if ( !$year )
    289                 $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
     289                $year = gmdate('Y', current_time('timestamp'));
    290290        $yearlink = $wp_rewrite->get_year_permastruct();
    291291        if ( !empty($yearlink) ) {
    292292                $yearlink = str_replace('%year%', $year, $yearlink);
     
    308308function get_month_link($year, $month) {
    309309        global $wp_rewrite;
    310310        if ( !$year )
    311                 $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
     311                $year = gmdate('Y', current_time('timestamp'));
    312312        if ( !$month )
    313                 $month = gmdate('m', time()+(get_option('gmt_offset') * 3600));
     313                $month = gmdate('m', current_time('timestamp'));
    314314        $monthlink = $wp_rewrite->get_month_permastruct();
    315315        if ( !empty($monthlink) ) {
    316316                $monthlink = str_replace('%year%', $year, $monthlink);
     
    334334function get_day_link($year, $month, $day) {
    335335        global $wp_rewrite;
    336336        if ( !$year )
    337                 $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
     337                $year = gmdate('Y', current_time('timestamp'));
    338338        if ( !$month )
    339                 $month = gmdate('m', time()+(get_option('gmt_offset') * 3600));
     339                $month = gmdate('m', current_time('timestamp'));
    340340        if ( !$day )
    341                 $day = gmdate('j', time()+(get_option('gmt_offset') * 3600));
     341                $day = gmdate('j', current_time('timestamp'));
    342342
    343343        $daylink = $wp_rewrite->get_day_permastruct();
    344344        if ( !empty($daylink) ) {
  • wp-includes/general-template.php

     
    11251125                        echo "\n\t</tr>\n\t<tr>\n\t\t";
    11261126                $newrow = false;
    11271127
    1128                 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)) )
     1128                if ( $day == gmdate('j', current_time('timestamp')) && $thismonth == gmdate('m', current_time('timestamp')) && $thisyear == gmdate('Y', current_time('timestamp')) )
     1129                if ( $day == gmdate('j', current_time('timestamp')) && $thismonth == gmdate('m', current_time('timestamp')) && $thisyear == gmdate('Y', current_time('timestamp')) )
    11291130                        echo '<td id="today">';
    11301131                else
    11311132                        echo '<td>';
  • wp-admin/includes/template.php

     
    25672567
    25682568        // 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 />';
    25692569
    2570         $time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
     2570        $time_adj = current_time('timestamp');
    25712571        $post_date = ($for_post) ? $post->post_date : $comment->comment_date;
    25722572        $jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj );
    25732573        $mm = ($edit) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj );