Plugin: Notification Disabler

This plugin has been deprecated! It is no longer necessary as its functionality has been integrated into WordPress. There will not be any continued support for it. Comments to this post are also now closed.

When I released the plugin, I also simultaneously made a bug report and patch for the WP core, where it met with little discussion and was summarily closed as a “won’t fix”. Six months later, Matt posted a bug report on the same issue and a fix was proposed and committed.

Originally reported as a bug in trac ticket #1263.
Later reported as a bug in trac ticket #1670.
Fixed in WordPress in changeset #3031.

Name:
Notification Disabler
Author:
Scott Reilly
Version:
0.9
Last updated:
29 March 2005
Download:
Description:

Disable notification emails about new and/or moderated comments, pingbacks, and/or trackbacks en masse or on an individual author basis.

Notes:

Granted, this plugin/hack may only be of use to a limited number of people, most likely in a multi-author blog where some authors prefer to have e-mail notifications sent to them while others don’t.

The core changes necessary for this plugin to work are noted via a WordPress feature request, bug 761 at the WP bug tracker site.

The changes are as follows, both in wp-includes/comment-functions.php:

  • The function wp_notify_postauthor() begins like so:

    function wp_notify_postauthor($comment_id, $comment_type='') { global $wpdb;

    Immediately after the above, add this:

    $do_notify = apply_filters('notify_postauthor', $comment_id); if (! $do_notify ) return false;

  • The function wp_notify_moderator() begins like so:

    function wp_notify_moderator($comment_id) { global $wpdb; if( get_settings( "moderation_notify" ) == 0 ) return true;

    Immediately after the above, add this:

    $do_notify = apply_filters('notify_moderator', $comment_id); if (! $do_notify ) return true;

Installation:
  1. Download the file notification-disabler.zip and unzip it into your /wp-content/plugins/ directory.
    -OR-
    Copy and paste the the code ( notification-disabler.phps ) into a file called notification-disabler.php, and put that file into your /wp-content/plugins/ directory. Please ensure you do not introduce any spaces or other characters before the <?php or after the ?>
  2. Unfortunately, you need to modify a core WP file. The changes are slight (two lines added in two places), but necessary. See notes above.
  3. Optional: Change configuration options in the file to your liking. In-code comments should help you there.
  4. Activate the plugin from your WordPress admin ‘Plugins’ page.
Functions:

function c2c_disable_author_notification( $comment_id, $authors='' )

function c2c_disable_moderation_notification( $comment_id, $authors='' )

function c2c_disable_pingback_notification( $comment_id, $authors='', $comment_type='pingback' )

function c2c_disable_trackback_notification( $comment_id, $authors='' )

  • $comment_id : The id of the comment being checked for notification approval. This is automatically sent by WP.
  • $authors : A space-separated list of author IDs who want each particular notification disabled. Leave blank and nothing will happen. use ‘all’ to disable the respective notification for everyone.
Tips & Examples:

Assuming the users with author IDs of 2 and 4 don’t want to receive trackback notifications, specify the $authors argument for c2c_disable_trackback_notification( $comment_id, $authors='' ) like so:

function c2c_disable_trackback_notification( $comment_id, $authors='2 4' ) {

Release Log:
  • 29 Mar 2005 : v0.9 — Released to the public
Copyright & Disclaimer:

Copyright (c) 2005 by Scott Reilly (aka coffee2code)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Acknowledgements:
N/A

2 thoughts on “Plugin: Notification Disabler

  1. Looks VERY useful, but the download link is dead, and I hesitate to use the “.phps” link because the displayed code says “Version: 0.5″ — which may simply be a typo (not encouraging when considering PHP modifications). I’ll check back later.

Comments are closed.