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

See #11566. 

Built from https://develop.svn.wordpress.org/trunk@33824


git-svn-id: http://core.svn.wordpress.org/trunk@33792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-08-31 20:31:22 +00:00
parent 1f1b72b5f5
commit 50d0f8f1ae
2 changed files with 3 additions and 8 deletions

View File

@ -964,15 +964,10 @@ class WP_Widget_Recent_Comments extends WP_Widget {
} }
/** /**
* @global array $comments
* @global object $comment
*
* @param array $args * @param array $args
* @param array $instance * @param array $instance
*/ */
public function widget( $args, $instance ) { public function widget( $args, $instance ) {
global $comments, $comment;
$cache = array(); $cache = array();
if ( ! $this->is_preview() ) { if ( ! $this->is_preview() ) {
$cache = wp_cache_get('widget_recent_comments', 'widget'); $cache = wp_cache_get('widget_recent_comments', 'widget');
@ -1026,11 +1021,11 @@ class WP_Widget_Recent_Comments extends WP_Widget {
$post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) ); $post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) );
_prime_post_caches( $post_ids, strpos( get_option( 'permalink_structure' ), '%category%' ), false ); _prime_post_caches( $post_ids, strpos( get_option( 'permalink_structure' ), '%category%' ), false );
foreach ( (array) $comments as $comment) { foreach ( (array) $comments as $comment ) {
$output .= '<li class="recentcomments">'; $output .= '<li class="recentcomments">';
/* translators: comments widget: 1: comment author, 2: post link */ /* translators: comments widget: 1: comment author, 2: post link */
$output .= sprintf( _x( '%1$s on %2$s', 'widgets' ), $output .= sprintf( _x( '%1$s on %2$s', 'widgets' ),
'<span class="comment-author-link">' . get_comment_author_link() . '</span>', '<span class="comment-author-link">' . get_comment_author_link( $comment->comment_ID ) . '</span>',
'<a href="' . esc_url( get_comment_link( $comment->comment_ID ) ) . '">' . get_the_title( $comment->comment_post_ID ) . '</a>' '<a href="' . esc_url( get_comment_link( $comment->comment_ID ) ) . '">' . get_the_title( $comment->comment_post_ID ) . '</a>'
); );
$output .= '</li>'; $output .= '</li>';

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-33823'; $wp_version = '4.4-alpha-33824';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.