Ensure only approved comments trigger post author notifications

Posts that are trashed shouldn't trigger post author notifications.  Adds unit tests to enforce this.

Props scottbrownconsulting, peterwilsoncc, swissspidy
Fixes #35006


Built from https://develop.svn.wordpress.org/trunk@36119


git-svn-id: http://core.svn.wordpress.org/trunk@36085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Aaron Jorbin 2015-12-29 17:54:28 +00:00
parent f106974374
commit 09688bd59c
2 changed files with 2 additions and 2 deletions

View File

@ -1802,7 +1802,7 @@ function wp_new_comment_notify_postauthor( $comment_ID ) {
}
// Only send notifications for approved comments.
if ( ! isset( $comment->comment_approved ) || 'spam' === $comment->comment_approved || ! $comment->comment_approved ) {
if ( ! isset( $comment->comment_approved ) || '1' != $comment->comment_approved ) {
return false;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36117';
$wp_version = '4.5-alpha-36119';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.