Changeset 34106 for trunk/src/wp-includes/comment-functions.php
- Timestamp:
- 09/14/2015 02:16:02 AM (10 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.