WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/07/2019 09:11:37 AM (20 months ago)
Author:
SergeyBiryukov
Message:

Date/Time: Reduce explicit local current_time( 'timestamp' ) usage in favor of native PHP functions.

Timestamps don't carry any timezone information, using the intended format directly simplifies the logic and makes the code less confusing.

Props Rarst, jdgrimes.
See #40657.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r44591 r44809  
    471471    global $wp_rewrite;
    472472    if ( ! $year ) {
    473         $year = gmdate( 'Y', current_time( 'timestamp' ) );
     473        $year = current_time( 'Y' );
    474474    }
    475475    $yearlink = $wp_rewrite->get_year_permastruct();
     
    506506    global $wp_rewrite;
    507507    if ( ! $year ) {
    508         $year = gmdate( 'Y', current_time( 'timestamp' ) );
     508        $year = current_time( 'Y' );
    509509    }
    510510    if ( ! $month ) {
    511         $month = gmdate( 'm', current_time( 'timestamp' ) );
     511        $month = current_time( 'm' );
    512512    }
    513513    $monthlink = $wp_rewrite->get_month_permastruct();
     
    547547    global $wp_rewrite;
    548548    if ( ! $year ) {
    549         $year = gmdate( 'Y', current_time( 'timestamp' ) );
     549        $year = current_time( 'Y' );
    550550    }
    551551    if ( ! $month ) {
    552         $month = gmdate( 'm', current_time( 'timestamp' ) );
     552        $month = current_time( 'm' );
    553553    }
    554554    if ( ! $day ) {
    555         $day = gmdate( 'j', current_time( 'timestamp' ) );
     555        $day = current_time( 'j' );
    556556    }
    557557
Note: See TracChangeset for help on using the changeset viewer.