help with writing a plugin
-
Bear with me here, I’ve never tried writing a plugin before…
I’m trying to write a plugin that will highlight the comment_author where the comment has been posted by a specific email address (ie, comments made by the blog author). I know this can be done easily by editing the coding, but I thought I might try my hand at plugins, because I have nothing better to do at the moment ??
So far, I’ve got it working as a filter on the comment_author hook
However, if I activate the plugin it adds the span class to every comment author, even those comments posted without an email address.
here is my function:
function hilite_author($comment_author) {
if ($comment_author_email == $youremail) {
$comment_author="<span class=\"adminhilite\">$comment_author</span>";
}
return $comment_author;
}
Help!
Any suggestions would be much appreciated
- The topic ‘help with writing a plugin’ is closed to new replies.