[wp-trac] [WordPress Trac] #33717: Send Notification Email When a Comment is Approved From Moderation

WordPress Trac noreply at wordpress.org
Sun Sep 6 18:23:53 UTC 2015


#33717: Send Notification Email When a Comment is Approved From Moderation
-------------------------------------------------+-------------------------
 Reporter:  jeffr0                               |       Owner:  swissspidy
     Type:  feature request                      |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.4
Component:  Comments                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch needs-      |     Focuses:
  testing                                        |
-------------------------------------------------+-------------------------

Comment (by mrahmadawais):

 Replying to [comment:21 swissspidy]:
 > Replying to [comment:20 mrahmadawais]:
 >
 > > Added a check for if in case // The comment was left by the author &
 The author moderated a comment on their own post
 >
 > Thanks, good catch. However I noticed the following things with your
 patch:
 >
 > * Indentation is wrong throughout the function.
 > * `$author` isn't used anywhere
 > * `$notify_author` isn't defined anywhere, which would lead to an error.
 >

 Thanks for the fix. I had actually completed writing a function inside
 pluggable.php when you uploaded the patch. I think I just copied this
 check and forgot about the two variables, should have submitted it after
 second cup of coffee.

 > [attachment:33717.4.diff 33717.4.diff] accommodates for that. Plus it
 fixes the one multi-line comment.
 >
 > > BTW we can use a better action i.e. `comment_unapproved_to_approved`
 action is defined in function  `wp_transition_comment_status` 1286
 comment-functions.php.
 >
 > I'd say the `transition_comment_status` hook can be more easily found
 and debugged as the dynamic `comment_{$old_status}_to_{$new_status}` hook.
 > Also, does this work when the comment was previously trashed /
 mistakenly marked as spam but then approved?

 I haven't tested that, but in theory, it should work whenever a comment
 goes from unapproved to approved status.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33717#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list