Skip to content

Commit 98c2873

Browse files
Add separate notes notification setting
1 parent 8da27bc commit 98c2873

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

src/wp-admin/includes/schema.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ function populate_options( array $options = array() ) {
421421
'use_smilies' => 1,
422422
'require_name_email' => 1,
423423
'comments_notify' => 1,
424+
'notes_notify' => 1,
424425
'posts_per_rss' => 10,
425426
'rss_use_excerpt' => 0,
426427
'mailserver_url' => 'mail.example.com',

src/wp-admin/options-discussion.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,16 @@
155155
<td><fieldset><legend class="screen-reader-text"><span><?php echo $email_me_whenever_title; ?></span></legend>
156156
<label for="comments_notify">
157157
<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked( '1', get_option( 'comments_notify' ) ); ?> />
158-
<?php _e( 'Anyone posts a comment or note' ); ?> </label>
158+
<?php _e( 'Anyone posts a comment' ); ?> </label>
159159
<br />
160160
<label for="moderation_notify">
161161
<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked( '1', get_option( 'moderation_notify' ) ); ?> />
162162
<?php _e( 'A comment is held for moderation' ); ?> </label>
163+
<br />
164+
<label for="notes_notify">
165+
<input name="notes_notify" type="checkbox" id="notes_notify" value="1" <?php checked( '1', get_option( 'notes_notify' ) ); ?> />
166+
<?php _e( 'Anyone posts a note' ); ?> </label>
167+
163168
</fieldset></td>
164169
</tr>
165170
<?php $before_comment_appears_title = __( 'Before a comment appears' ); ?>

src/wp-admin/options.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
'comment_order',
126126
'comment_registration',
127127
'show_comments_cookies_opt_in',
128+
'notes_notify',
128129
),
129130
'media' => array(
130131
'thumbnail_size_w',

src/wp-includes/comment.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,8 +2425,9 @@ function wp_new_comment_notify_moderator( $comment_id ) {
24252425
*/
24262426
function wp_new_comment_notify_postauthor( $comment_id ) {
24272427
$comment = get_comment( $comment_id );
2428+
$isNote = ( 'note' === $comment->comment_type );
24282429

2429-
$maybe_notify = get_option( 'comments_notify' );
2430+
$maybe_notify = $isNote ? get_option( 'notes_notify' ) : get_option( 'comments_notify' );
24302431

24312432
/**
24322433
* Filters whether to send the post author new comment notification emails,
@@ -2450,7 +2451,7 @@ function wp_new_comment_notify_postauthor( $comment_id ) {
24502451
// Send notifications for approved comments and all notes.
24512452
if (
24522453
! isset( $comment->comment_approved ) ||
2453-
( '1' !== $comment->comment_approved && 'note' !== $comment->comment_type ) ) {
2454+
( '1' !== $comment->comment_approved && $isNote ) ) {
24542455
return false;
24552456
}
24562457

0 commit comments

Comments
 (0)