From 246f2a6bd91c1f8a4f68b804ba53e47b2506f102 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 9 Sep 2015 03:05:24 +0000 Subject: [PATCH] Use `get_comment()` instead of a global in `touch_time()`. See #33638. Built from https://develop.svn.wordpress.org/trunk@33965 git-svn-id: http://core.svn.wordpress.org/trunk@33934 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 7 +++---- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 9e91438504..d1ee398d1a 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -756,7 +756,6 @@ function meta_form( $post = null ) { * @since 0.71 * * @global WP_Locale $wp_locale - * @global WP_Comment $comment * * @param int|bool $edit Accepts 1|true for editing the date, 0|false for adding the date. * @param int|bool $for_post Accepts 1|true for applying the date to a post, 0|false for a comment. @@ -765,9 +764,9 @@ function meta_form( $post = null ) { * Default 0|false. */ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { - global $wp_locale, $comment; + global $wp_locale; $post = get_post(); - + if ( $for_post ) $edit = ! ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) ); @@ -779,7 +778,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { // echo '
'; $time_adj = current_time('timestamp'); - $post_date = ($for_post) ? $post->post_date : $comment->comment_date; + $post_date = ($for_post) ? $post->post_date : get_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 ); $aa = ($edit) ? mysql2date( 'Y', $post_date, false ) : gmdate( 'Y', $time_adj ); diff --git a/wp-includes/version.php b/wp-includes/version.php index c76e16c06f..8710b37ff7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-33964'; +$wp_version = '4.4-alpha-33965'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.