Make WordPress Core


Ignore:
Timestamp:
03/07/2019 09:11:37 AM (6 years 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-admin/includes/ajax-actions.php

    r44785 r44809  
    14651465            $post_data['post_type']   = $post->post_type;
    14661466            $post_data['post_status'] = 'draft';
    1467             $now                      = current_time( 'timestamp', 1 );
     1467            $now                      = time();
    14681468            /* translators: 1: Post creation date, 2: Post creation time */
    14691469            $post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), date( __( 'F j, Y' ), $now ), date( __( 'g:i a' ), $now ) );
Note: See TracChangeset for help on using the changeset viewer.