WordPress.org

Make WordPress Core

Changeset 33965


Ignore:
Timestamp:
09/09/2015 03:04:38 AM (6 years ago)
Author:
wonderboymusic
Message:

Use get_comment() instead of a global in touch_time().

See #33638.

File:
1 edited

Legend:

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

    r33904 r33965  
    757757 *
    758758 * @global WP_Locale  $wp_locale
    759  * @global WP_Comment $comment
    760759 *
    761760 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
     
    766765 */
    767766function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
    768     global $wp_locale, $comment;
     767    global $wp_locale;
    769768    $post = get_post();
    770 
     769   
    771770    if ( $for_post )
    772771        $edit = ! ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) );
     
    780779
    781780    $time_adj = current_time('timestamp');
    782     $post_date = ($for_post) ? $post->post_date : $comment->comment_date;
     781    $post_date = ($for_post) ? $post->post_date : get_comment()->comment_date;
    783782    $jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj );
    784783    $mm = ($edit) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj );
Note: See TracChangeset for help on using the changeset viewer.