Skip to content

Commit f089d47

Browse files
Skip notifications for empty notes
1 parent cbfef88 commit f089d47

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/wp-includes/pluggable.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,11 @@ function wp_notify_postauthor( $comment_id, $deprecated = null ) {
17461746
return false;
17471747
}
17481748

1749+
// Skip notifications for empty notes.
1750+
if ( 'note' === $comment->comment_type && empty( $comment->comment_content ) ) {
1751+
return false;
1752+
}
1753+
17491754
$post = get_post( $comment->comment_post_ID );
17501755
$author = get_userdata( $post->post_author );
17511756

@@ -1939,8 +1944,6 @@ function wp_notify_postauthor( $comment_id, $deprecated = null ) {
19391944
$notify_message .= sprintf( __( 'Permalink: %s' ), get_comment_link( $comment ) ) . "\r\n";
19401945
}
19411946

1942-
error_log( $subject );
1943-
19441947
if ( 'note' !== $comment->comment_type && user_can( $post->post_author, 'edit_comment', $comment->comment_ID ) ) {
19451948
if ( EMPTY_TRASH_DAYS ) {
19461949
/* translators: Comment moderation. %s: Comment action URL. */

0 commit comments

Comments
 (0)