Created
March 3, 2010 05:39
-
-
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+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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