From 4b10390b7dfd9bf84272f2811f41332fcd8d54fd Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 7 Mar 2019 09:11:37 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@44809 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/ajax-actions.php | 2 +- src/wp-admin/includes/dashboard.php | 7 ++++--- src/wp-admin/includes/template.php | 23 +++++++++++------------ src/wp-admin/includes/user.php | 2 +- src/wp-includes/general-template.php | 11 +++++------ src/wp-includes/link-template.php | 12 ++++++------ src/wp-includes/ms-functions.php | 6 +++--- 7 files changed, 31 insertions(+), 32 deletions(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index c565817914..f273c4df6f 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -1464,7 +1464,7 @@ function wp_ajax_add_meta() { $post_data['post_ID'] = $pid; $post_data['post_type'] = $post->post_type; $post_data['post_status'] = 'draft'; - $now = current_time( 'timestamp', 1 ); + $now = time(); /* translators: 1: Post creation date, 2: Post creation time */ $post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), date( __( 'F j, Y' ), $now ), date( __( 'g:i a' ), $now ) ); diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 7bebe3ff20..e3e8cca9a7 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -858,8 +858,9 @@ function wp_dashboard_recent_posts( $args ) { echo '