• I’ve added mailing triggers to wp_notify_postauthor and wp_notify_moderator to know when each one is called.

    Testing procedure
    I create test user with role of author.
    I author test post by that user.
    I post anonymous comment on that post.

    Expected behavior
    I should receive an email to the admin/moderation account triggered by wp_notify_moderator and one to the test user triggered by wp_notify_postauthor.

    Experienced behavior
    I receive emails to both admin and author triggered by wp_notify_moderator. I can’t get the wp_notify_postauthor to fire.

    Do I misunderstand the expected behavior of these functions? I really want to turn off author notifications, so I thought I could just redefine wp_notify_postauthor to return true but it doesn’t seem to work.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter traffas

    (@traffas)

    So after further digging, it seems I was wrong about my expectations. It seems ( around line 1400 in wp_includes/comment.php) that wp_notify_postauthor is only triggered when the comment is a approved.

    So why, then, is the post author being notified by wp_notify_moderator? Shouldn’t this function only notify the moderator and not the author?

    Thread Starter traffas

    (@traffas)

    I think I figured it out. The wp_notify_moderator checks to see if the post author (why?!?) can “edit_comment” – a capability that is listed as added in WordPress 3.1 but not explained in the Codex – https://codex.www.ads-software.com/Roles_and_Capabilities#edit_comment

    I ended up having to redefine wp_notify_moderator to disable author comment notifications.

    Hopefully this explanation helps someone else.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp_notify_postauthor doesn't appear to be active’ is closed to new replies.