I am writing a Wordpress plugin that does string processing whenever 'the_author' filter event is fired. However, some widgets also contain 'the_author' event and subsequently my plugin is fired which should not happen. So I am trying to detect if my plugin is called from certain widgets but so far to no avail. One widget that I would like to ignore is called 'Recent Comments'. I have tried:
function wrap_author($the_author) {
if(!is_active_widget('recent_comments')) {
$the_author = '<span class="CA_author">' . $the_author . '</span>';
return $the_author;
}
}
It could be that I am not using the right name for the widget, I have Googled a lot to find the proper internal name for the Recent Comments Widget but can't find it so far. Or maybe I should not be using is_active_widget function.
Your suggestions are much appreciated.