Skip to content

Commit 88731bf

Browse files
Move wp_new_comment_via_rest_notify_postauthor -> comment.php
1 parent 376800e commit 88731bf

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/wp-includes/comment.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,6 +2458,19 @@ function wp_new_comment_notify_postauthor( $comment_id ) {
24582458
return wp_notify_postauthor( $comment_id );
24592459
}
24602460

2461+
/**
2462+
* Send a notification to the post author when a new note is added via the REST API.
2463+
*
2464+
* @since 6.9.0
2465+
*
2466+
* @param WP_Comment $comment The comment object.
2467+
*/
2468+
function wp_new_comment_via_rest_notify_postauthor( $comment ) {
2469+
if ( 'note' === $comment->comment_type ) {
2470+
wp_new_comment_notify_postauthor( $comment->comment_ID );
2471+
}
2472+
}
2473+
24612474
/**
24622475
* Sets the status of a comment.
24632476
*

src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,6 @@ public function __construct() {
3636
$this->meta = new WP_REST_Comment_Meta_Fields();
3737
}
3838

39-
/**
40-
* Send a notification to the post author when a new note is added via the REST API.
41-
*
42-
* @since 6.9.0
43-
*
44-
* @param WP_Comment $comment The comment object.
45-
*/
46-
public static function wp_new_comment_via_rest_notify_postauthor( $comment ) {
47-
if ( 'note' === $comment->comment_type ) {
48-
wp_new_comment_notify_postauthor( $comment->comment_ID );
49-
}
50-
}
5139
/**
5240
* Registers the routes for comments.
5341
*

0 commit comments

Comments
 (0)