Last active
November 3, 2018 03:10
-
-
Save WPprodigy/77578d926dc830e33cf6acc6aaf7c768 to your computer and use it in GitHub Desktop.
Disable WordPress email notifications for pingbacks and trackbacks.
This file contains hidden or 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 | |
// Don't send notification emails for pingbacks and trackbacks. | |
add_filter( 'notify_post_author', function( $maybe_notify, $comment_ID ) { | |
$comment_type = get_comment_type( $comment_ID ); | |
if ( in_array( $comment_type, array( 'pingback', 'trackback' ), true ) ) { | |
$maybe_notify = false; | |
} | |
return $maybe_notify; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment