Opened 16 years ago
Closed 16 years ago
#12774 closed enhancement (fixed)
Don't fire wp_notify_postauthor() when the author moderated the comment
| Reported by: | nacin | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | Comments | Version: | |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
Description
In wp_notify_postauthor(), there is this bit of code with an inline comment:
// The author moderated a comment on his own post
if ( $comment->user_id == $post->post_author )
return false;
The comment doesn't match the code. The code actually prevents the e-mail whenever the author *made* a comment on their own post.
That said, the comment should have code for it. If the author moderates a comment on their own post (a comment not written by them, that is), the author should not get a comment notification. Thoughts?
Attachments (2)
Change History (15)
#5
@
16 years ago
Attached my attempt at solving the original ticket's issue. (Assumes the moderator is the current user)
#9
@
16 years ago
- Resolution fixed
- Status closed → reopened
Didn't notice an issue with the logic in the patch until now:
( $user->user_id == $moderating_uid )
but:
$moderating_uid = (int) $user->id;
This should be:
$moderating_uid = $moderating_user->id;
Or even better, just get_current_user_id(), and we can clean this up a little in terms of standards.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Makes sense.
Also, an admin shouldn't get a comment notification after moderating any comment. (I have a plugin that deals with this: Filter Email Notifications).