Q: Comment Display Filter
-
i’m looking for tips and advice on how to write a certain kind of plugin. i’ve written some very simple plugins before, but this one is much more complex (relatively) than what i’ve done, and i’m not sure where to start…
here’s the scenario: i occasionally run trivia contests on my blog, and i want people to be able to leave their answers in comments without anyone else seeing their answers, until the contest answering period is over. so, a user goes to the quiz post, leaves his answers in comments, and that comment should only be visible to the user who made it (go by IP address) and the moderator – nobody else can see it. moderator comments are visible to everybody. so, at this point it works like a private messaging system. and, finally, this style of commenting needs to be en/disabled per-post – i only want this to happen on “quiz” posts. and i need to be able to turn it off when the post ends.
the basic filtering seems easy in theory:
if (post_has_private_comments && user_IP != comment_IP) SkipThisComment;
but, i just don’t know where to put that logic.
also, i don’t know anything about WP UI or where to store the “post_has_private_comments” info.
any tips would be greatly appreciated.
The topic ‘Q: Comment Display Filter’ is closed to new replies.