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
This commit is contained in:
Scott Taylor 2015-09-09 03:05:24 +00:00
parent 71f955dc84
commit 246f2a6bd9
2 changed files with 4 additions and 5 deletions

View File

@ -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,7 +764,7 @@ 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 )
@ -779,7 +778,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
// 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 />';
$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 );

View File

@ -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.