Changeset 34250 for trunk/src/wp-includes/comment-functions.php
- Timestamp:
- 09/16/2015 09:59:16 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-functions.php
r34161 r34250 1649 1649 * @param int $comment_ID ID of the comment. 1650 1650 * @param int $comment_approved Whether the comment is approved. 1651 * @return bool True on success, false on failure. 1651 1652 */ 1652 1653 function wp_new_comment_notify_moderator( $comment_ID, $comment_approved ) { 1653 if ( '0' == $comment_approved ) { 1654 wp_notify_moderator( $comment_ID ); 1655 } 1654 // Only send notifications for pending comments. 1655 if ( '0' != $comment_approved ) { 1656 return false; 1657 } 1658 1659 return wp_notify_moderator( $comment_ID ); 1656 1660 } 1657 1661 … … 1662 1666 * 1663 1667 * @param int $comment_ID ID of the comment. 1668 * @return bool True on success, false on failure. 1664 1669 */ 1665 1670 function wp_new_comment_notify_postauthor( $comment_ID ) { … … 1670 1675 * By default, it won't, but filters can override this. 1671 1676 */ 1672 if ( get_option( 'comments_notify' ) && $comment->comment_approved ) { 1673 wp_notify_postauthor( $comment_ID ); 1674 } 1677 if ( ! get_option( 'comments_notify' ) ) { 1678 return false; 1679 } 1680 1681 // Only send notifications for approved comments. 1682 if ( 'spam' === $comment->comment_approved || ! $comment->comment_approved ) { 1683 return false; 1684 } 1685 1686 return wp_notify_postauthor( $comment_ID ); 1675 1687 } 1676 1688
Note: See TracChangeset
for help on using the changeset viewer.