Skip to content

Instantly share code, notes, and snippets.

@mjangda
Created March 3, 2010 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjangda/320360 to your computer and use it in GitHub Desktop.
Save mjangda/320360 to your computer and use it in GitHub Desktop.
Quick an easy way to remove author and current user from the notification recipients. Works in Edit Flow 0.4+
<?php
function filter_recipients($recipients, $post) {
// grab the users we want to filter
$author = get_userdata($post->post_author);
$current_user = wp_get_current_user();
// Remove author and user who made the change from notification
$recipients = array_values( array_diff( $recipients,array($author->user_email, $current_user->user_email) ) ); // sorta hacky way to remove the element, found here: http://www.bin-co.com/php/scripts/array_remove.php
return $recipients;
}
add_filter('ef_notfication_recipients', 'filter_recipients', 10, 2);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment