Changeset 34106
- Timestamp:
- 09/14/2015 02:16:02 AM (9 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-functions.php
r33964 r34106 1630 1630 do_action( 'comment_post', $comment_ID, $commentdata['comment_approved'] ); 1631 1631 1632 if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching1633 if ( '0' == $commentdata['comment_approved'] ) {1634 wp_notify_moderator( $comment_ID );1635 }1636 1637 // wp_notify_postauthor() checks if notifying the author of their own comment.1638 // By default, it won't, but filters can override this.1639 if ( get_option( 'comments_notify' ) && $commentdata['comment_approved'] ) {1640 wp_notify_postauthor( $comment_ID );1641 }1642 }1643 1644 1632 return $comment_ID; 1633 } 1634 1635 /** 1636 * Send a comment moderation notification to the comment moderator. 1637 * 1638 * @since 4.4.0 1639 * 1640 * @param int $comment_ID ID of the comment. 1641 * @param int $comment_approved Whether the comment is approved. 1642 */ 1643 function wp_new_comment_notify_moderator( $comment_ID, $comment_approved ) { 1644 if ( '0' == $comment_approved ) { 1645 wp_notify_moderator( $comment_ID ); 1646 } 1647 } 1648 1649 /** 1650 * Send a notification of a new comment to the post author. 1651 * 1652 * @since 4.4.0 1653 * 1654 * @param int $comment_ID ID of the comment. 1655 */ 1656 function wp_new_comment_notify_postauthor( $comment_ID ) { 1657 $comment = get_comment( $comment_ID ); 1658 1659 /* 1660 * `wp_notify_postauthor()` checks if notifying the author of their own comment. 1661 * By default, it won't, but filters can override this. 1662 */ 1663 if ( get_option( 'comments_notify' ) && $comment->comment_approved ) { 1664 wp_notify_postauthor( $comment_ID ); 1665 } 1645 1666 } 1646 1667 -
trunk/src/wp-includes/default-filters.php
r33615 r34106 335 335 add_action( 'wp_split_shared_term_batch', '_wp_batch_split_terms' ); 336 336 337 // Email notifications. 338 add_action( 'comment_post', 'wp_new_comment_notify_moderator', 10, 2 ); 339 add_action( 'comment_post', 'wp_new_comment_notify_postauthor' ); 340 337 341 /** 338 342 * Filters formerly mixed into wp-includes
Note: See TracChangeset
for help on using the changeset viewer.