WordPress.org

Make WordPress Core

Ticket #7738: 7738.diff

File 7738.diff, 959 bytes (added by DD32, 10 years ago)
  • wp-admin/includes/comment.php

     
    106106
    107107// Add avatars to relevant places in admin, or try to
    108108
     109add_action('admin_init', 'floated_admin_avatar_handler');
     110function floated_admin_avatar_handler() {
     111        global $pagenow;
     112        if ( 'edit-comments.php' == $pagenow || 'edit.php' == $pagenow ) {
     113                if ( get_option('show_avatars') )
     114                        add_filter( 'comment_author', 'floated_admin_avatar' );
     115        }
     116}
     117
    109118function floated_admin_avatar( $name ) {
    110119        global $comment;
    111120
     
    121130        return "$avatar $name";
    122131}
    123132
    124 if ( is_admin() && ('edit-comments.php' == $pagenow || 'edit.php' == $pagenow) ) {
    125         if ( get_option('show_avatars') )
    126                 add_filter( 'comment_author', 'floated_admin_avatar' );
    127 }
    128 
    129133function wp_get_inbox_items() {
    130134        $r = array();
    131135        $r[] = (object) array(