Hook floated_admin_avatar to admin_init. Props DD32. fixes #7738

git-svn-id: http://svn.automattic.com/wordpress/trunk@8881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-09-13 18:16:42 +00:00
parent 9c89b7fb9e
commit 32c9a1f7c4
1 changed files with 9 additions and 5 deletions

View File

@ -106,6 +106,15 @@ function get_pending_comments_num( $post_id ) {
// Add avatars to relevant places in admin, or try to
add_action('admin_init', 'floated_admin_avatar_handler');
function floated_admin_avatar_handler() {
global $pagenow;
if ( 'edit-comments.php' == $pagenow || 'edit.php' == $pagenow ) {
if ( get_option('show_avatars') )
add_filter( 'comment_author', 'floated_admin_avatar' );
}
}
function floated_admin_avatar( $name ) {
global $comment;
@ -121,11 +130,6 @@ function floated_admin_avatar( $name ) {
return "$avatar $name";
}
if ( is_admin() && ('edit-comments.php' == $pagenow || 'edit.php' == $pagenow) ) {
if ( get_option('show_avatars') )
add_filter( 'comment_author', 'floated_admin_avatar' );
}
function wp_get_inbox_items() {
$r = array();
$r[] = (object) array(