In a small plugin Iâve written to add an IP address column to the comments list I want to remove the avatars.
In line 156 I tried to use remove_filter
:
remove_filter( 'comment_author', 'floated_admin_avatar', 50 );
Well ⦠I know this function fails sometimes, but why does it fail here?
My workaround is:
$_GET['comment_status'] == 'spam'
and add_filter( 'pre_option_show_avatars', '__return_zero' );
I guess I stared too long at this code to see what went wrong. I need a hint into the right direction.
As usual with hooks this is issue of timing.
WP_Comments_List_Table
class, and object is created inedit-comments.php
after admin loader had been processed.In my plugin for similar stuff I am removing it at
manage_edit-comments_columns
hook.Simplified example from my class:
May be its the priority 50. Instead let it be default.
From http://codex.wordpress.org/Function_Reference/remove_filter
$priority
(int) (optional) The priority of the function (as defined when the function was originally hooked).
Default: 10
So change
to