WordPress.org

Ready to get started?Download WordPress

Forums

Comment email notification per author (2 posts)

  1. Contemplative Computing
    Member
    Posted 1 year ago #

    This seems pretty simple but I cannot find an existing plugin or hack anywhere after lots of searching.

    I have a blog with many authors. Some want to receive comment notification emails, some do not. The setting available doesn't address this. Would anybody be able to to point me in the right direction as to how to hack this function to create an option per user, rather than the only global option currently?

    I'm only a beginner PHP developer, but with some pointers I'd be willing to put some work into this, or possibly pay someone to develop this plugin.

    -Matthew

  2. bcworkz
    Member
    Posted 1 year ago #

    The function that sends the email is wp_notify_postauthor() in wp-includes/pluggable.php. As a pluggable function, you can define your own version in a plugin or child theme and it will be used instead.

    So you just need to modify this function to only send email if a particular user meta option is set to True. Which means you will also need to modify the user options page so that it's easy to set or unset this option. See the Settings API for how to do this.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.