Fix warnings after [33826]. Only only one function call needs a global `$comment`, we shall hamburger it.
See #11566. Built from https://develop.svn.wordpress.org/trunk@33828 git-svn-id: http://core.svn.wordpress.org/trunk@33796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cf7694717b
commit
d0a1a47708
|
@ -42,8 +42,9 @@ class WP_Comments_List_Table extends WP_List_Table {
|
|||
|
||||
$post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0;
|
||||
|
||||
if ( get_option('show_avatars') )
|
||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||
if ( get_option( 'show_avatars' ) ) {
|
||||
add_filter( 'comment_author', array( $this, 'floated_admin_avatar' ), 10, 2 );
|
||||
}
|
||||
|
||||
parent::__construct( array(
|
||||
'plural' => 'comments',
|
||||
|
@ -53,6 +54,12 @@ class WP_Comments_List_Table extends WP_List_Table {
|
|||
) );
|
||||
}
|
||||
|
||||
public function floated_admin_avatar( $name, $comment_ID ) {
|
||||
$comment = get_comment( $comment_ID );
|
||||
$avatar = get_avatar( $comment, 32, 'mystery' );
|
||||
return "$avatar $name";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -591,8 +598,8 @@ class WP_Comments_List_Table extends WP_List_Table {
|
|||
/* translators: 2: comment date, 3: comment time */
|
||||
printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ), $comment_url,
|
||||
/* translators: comment date format. See http://php.net/date */
|
||||
get_comment_date( __( 'Y/m/d' ) ),
|
||||
get_comment_date( get_option( 'time_format' ) )
|
||||
get_comment_date( __( 'Y/m/d' ), $comment->comment_ID ),
|
||||
get_comment_date( get_option( 'time_format' ), $comment->comment_ID )
|
||||
);
|
||||
|
||||
if ( $comment->comment_parent ) {
|
||||
|
@ -603,7 +610,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
|||
}
|
||||
|
||||
echo '</div>';
|
||||
comment_text();
|
||||
comment_text( $comment->comment_ID );
|
||||
if ( $this->user_can ) { ?>
|
||||
<div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
|
||||
<textarea class="comment" rows="1" cols="1"><?php
|
||||
|
@ -628,7 +635,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
|||
public function column_author( $comment ) {
|
||||
global $comment_status;
|
||||
|
||||
$author_url = get_comment_author_url();
|
||||
$author_url = get_comment_author_url( $comment->comment_ID );
|
||||
if ( 'http://' == $author_url ) {
|
||||
$author_url = '';
|
||||
}
|
||||
|
@ -639,18 +646,20 @@ class WP_Comments_List_Table extends WP_List_Table {
|
|||
}
|
||||
|
||||
|
||||
echo "<strong>"; comment_author(); echo '</strong><br />';
|
||||
echo "<strong>"; comment_author( $comment->comment_ID ); echo '</strong><br />';
|
||||
if ( !empty( $author_url ) ) {
|
||||
echo "<a title='$author_url' href='$author_url'>$author_url_display</a><br />";
|
||||
}
|
||||
|
||||
if ( $this->user_can ) {
|
||||
if ( !empty( $comment->comment_author_email ) ) {
|
||||
$GLOBALS['comment'] = $comment;
|
||||
comment_author_email_link();
|
||||
echo '<br />';
|
||||
unset( $GLOBALS['comment'] );
|
||||
}
|
||||
|
||||
$author_ip = get_comment_author_IP();
|
||||
$author_ip = get_comment_author_IP( $comment->comment_ID );
|
||||
if ( $author_ip ) {
|
||||
$author_ip_url = add_query_arg( array( 's' => $author_ip, 'mode' => 'detail' ), 'edit-comments.php' );
|
||||
if ( 'spam' == $comment_status ) {
|
||||
|
@ -665,8 +674,8 @@ class WP_Comments_List_Table extends WP_List_Table {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function column_date() {
|
||||
return get_comment_date( __( 'Y/m/d \a\t g:i a' ) );
|
||||
public function column_date( $comment ) {
|
||||
return get_comment_date( __( 'Y/m/d \a\t g:i a' ), $comment->comment_ID );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-33827';
|
||||
$wp_version = '4.4-alpha-33828';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue