Administration: Remove a blank space in the Recent Comments dashboard widget if avatars are disabled on Discussion Settings screen.

Props Marius84, shital-patel, GaryJ, ianbelanger, sgastard, lgrev01, donmhico, garrett-eclipse, audrasjb, SergeyBiryukov.
Fixes #42938.

git-svn-id: https://develop.svn.wordpress.org/trunk@47255 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-02-11 01:15:31 +00:00
parent 8650885f85
commit 196fc7ab60
2 changed files with 10 additions and 3 deletions

View File

@ -821,7 +821,7 @@ body #dashboard-widgets .postbox form .submit {
top: 12px; top: 12px;
} }
#activity-widget #the-comment-list .dashboard-comment-wrap { #activity-widget #the-comment-list .dashboard-comment-wrap.has-avatar {
padding-left: 63px; padding-left: 63px;
} }

View File

@ -775,11 +775,18 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
<li id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>> <li id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>>
<?php echo get_avatar( $comment, 50, 'mystery' ); ?> <?php
$comment_row_class = '';
if ( get_option( 'show_avatars' ) ) {
echo get_avatar( $comment, 50, 'mystery' );
$comment_row_class .= ' has-avatar';
}
?>
<?php if ( ! $comment->comment_type || 'comment' == $comment->comment_type ) : ?> <?php if ( ! $comment->comment_type || 'comment' == $comment->comment_type ) : ?>
<div class="dashboard-comment-wrap has-row-actions"> <div class="dashboard-comment-wrap <?php echo $comment_row_class; ?> has-row-actions">
<p class="comment-meta"> <p class="comment-meta">
<?php <?php
// Comments might not have a post they relate to, e.g. programmatically created ones. // Comments might not have a post they relate to, e.g. programmatically created ones.