Make WordPress Core


Ignore:
Timestamp:
02/11/2020 01:15:31 AM (7 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r47222 r47255  
    776776                <li id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>>
    777777
    778                         <?php echo get_avatar( $comment, 50, 'mystery' ); ?>
     778                        <?php
     779                        $comment_row_class = '';
     780
     781                        if ( get_option( 'show_avatars' ) ) {
     782                                echo get_avatar( $comment, 50, 'mystery' );
     783                                $comment_row_class .= ' has-avatar';
     784                        }
     785                        ?>
    779786
    780787                        <?php if ( ! $comment->comment_type || 'comment' == $comment->comment_type ) : ?>
    781788
    782                         <div class="dashboard-comment-wrap has-row-actions">
     789                        <div class="dashboard-comment-wrap <?php echo $comment_row_class; ?> has-row-actions">
    783790                        <p class="comment-meta">
    784791                                <?php
Note: See TracChangeset for help on using the changeset viewer.