From 09688bd59c18bcfe7094e905363955972c2fdb6b Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Tue, 29 Dec 2015 17:54:28 +0000 Subject: [PATCH] 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 --- wp-includes/comment.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 7dafa1eaef..c6dd33d911 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -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; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 03c4517baa..6031a3a021 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.