mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-24 21:32:51 +02:00
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:
parent
f106974374
commit
09688bd59c
@ -1802,7 +1802,7 @@ function wp_new_comment_notify_postauthor( $comment_ID ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only send notifications for approved comments.
|
// 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user