File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -2457,6 +2457,19 @@ function wp_new_comment_notify_postauthor( $comment_id ) {
24572457 return wp_notify_postauthor ( $ comment_id );
24582458}
24592459
2460+ /**
2461+ * Send a notification to the post author when a new note is added via the REST API.
2462+ *
2463+ * @since 6.9.1
2464+ *
2465+ * @param WP_Comment $comment The comment object.
2466+ */
2467+ function wp_new_comment_via_rest_notify_postauthor ( $ comment ) {
2468+ if ( 'note ' === $ comment ->comment_type ) {
2469+ wp_new_comment_notify_postauthor ( $ comment ->comment_ID );
2470+ }
2471+ }
2472+
24602473/**
24612474 * Sets the status of a comment.
24622475 *
Original file line number Diff line number Diff line change 522522// Email notifications.
523523add_action ( 'comment_post ' , 'wp_new_comment_notify_moderator ' );
524524add_action ( 'comment_post ' , 'wp_new_comment_notify_postauthor ' );
525- add_action ( 'rest_insert_comment ' , 'wp_new_comment_notify_moderator ' );
525+ add_action ( 'rest_insert_comment ' , 'wp_new_comment_via_rest_notify_postauthor ' );
526526
527527add_action ( 'after_password_reset ' , 'wp_password_change_notification ' );
528528add_action ( 'register_new_user ' , 'wp_send_new_user_notifications ' );
You can’t perform that action at this time.
0 commit comments