Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Okay I know the title is pretty vague but I didn't know how to articulate it.

Basically, I want a plugin that sends email notifications to users who opted-in only if they specifically got replied to.

WordPress has its built-in functionality for comment threading/replying, so instead of bombarding the user with emails each time a new comment is posted on a post they've subscribed to, I'd like to give them the option to only be notified when they specifically get replied to.

I can develop this myself if need be, in fact, a preliminary search yielding no results seems to point at this.

My question is, what hooks would I take a look at? Looking at other notifier plugins, I see they make use of comment_post and others which I can come up with myself. More specifically, how would I go about knowing if user x got a direct reply?

I understand how the subscription system and all of that would work, my only concern is how to tell if a subscribed user received a direct reply through the built-in commenting system.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I figured it out. Each comment row in the wp_comments table has a field named comment_parent which stores the comment_ID of the parent comment. If the comment has no parent, then the default is 0.

So I guess on each comment post I would check the database for the posted comment's parent, and if it matched the comment of a subscriber, notify him or her.

Sounds like a plan.

share|improve this answer
    
Do have any code Jorge Israel Peña, where you did this. I want to do this same thing but need a bit of help with starting snippet or something. Thanks! –  Zach Reed Mar 7 '12 at 20:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.