WordPress.org

Make WordPress Core

Changeset 8881


Ignore:
Timestamp:
09/13/2008 06:16:42 PM (10 years ago)
Author:
ryan
Message:

Hook floated_admin_avatar to admin_init. Props DD32. fixes #7738

File:
1 edited

Legend:

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

    r8691 r8881  
    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;
     
    120129
    121130    return "$avatar $name";
    122 }
    123 
    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' );
    127131}
    128132
Note: See TracChangeset for help on using the changeset viewer.