Hook floated_admin_avatar to admin_init. Props DD32. fixes #7738
git-svn-id: https://develop.svn.wordpress.org/trunk@8881 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d39e61cd74
commit
cd225e64bd
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user