Make WordPress Core


Ignore:
Timestamp:
08/31/2015 08:30:32 PM (9 years ago)
Author:
wonderboymusic
Message:

WP_Widget_Pages::widget() has no reason to set $comment and $comments globals.

See #11566.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-widgets.php

    r33814 r33824  
    965965
    966966    /**
    967      * @global array  $comments
    968      * @global object $comment
    969      *
    970967     * @param array $args
    971968     * @param array $instance
    972969     */
    973970    public function widget( $args, $instance ) {
    974         global $comments, $comment;
    975 
    976971        $cache = array();
    977972        if ( ! $this->is_preview() ) {
     
    10271022            _prime_post_caches( $post_ids, strpos( get_option( 'permalink_structure' ), '%category%' ), false );
    10281023
    1029             foreach ( (array) $comments as $comment) {
     1024            foreach ( (array) $comments as $comment ) {
    10301025                $output .= '<li class="recentcomments">';
    10311026                /* translators: comments widget: 1: comment author, 2: post link */
    10321027                $output .= sprintf( _x( '%1$s on %2$s', 'widgets' ),
    1033                     '<span class="comment-author-link">' . get_comment_author_link() . '</span>',
     1028                    '<span class="comment-author-link">' . get_comment_author_link( $comment->comment_ID ) . '</span>',
    10341029                    '<a href="' . esc_url( get_comment_link( $comment->comment_ID ) ) . '">' . get_the_title( $comment->comment_post_ID ) . '</a>'
    10351030                );
Note: See TracChangeset for help on using the changeset viewer.