Changeset 35339 for trunk/src/wp-includes/comment-functions.php
- Timestamp:
- 10/21/2015 06:34:06 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/comment-functions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-functions.php
r35331 r35339 1759 1759 1760 1760 // Only send notifications for pending comments. 1761 if ( '0' != $comment->comment_approved ) { 1761 $maybe_notify = ( '0' == $comment->comment_approved ); 1762 1763 /** This filter is documented in wp-includes/comment-functions.php */ 1764 $maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_ID ); 1765 1766 if ( ! $maybe_notify ) { 1762 1767 return false; 1763 1768 } … … 1771 1776 * @since 4.4.0 1772 1777 * 1773 * @param int $comment_ID ID of the comment. 1778 * Uses the {@see 'notify_post_author'} filter to determine whether the post author 1779 * should be notified when a new comment is added, overriding site setting. 1780 * 1781 * @param int $comment_ID Comment ID. 1774 1782 * @return bool True on success, false on failure. 1775 1783 */ … … 1777 1785 $comment = get_comment( $comment_ID ); 1778 1786 1787 $maybe_notify = get_option( 'comments_notify' ); 1788 1789 /** 1790 * Filter whether to send the post author new comment notification emails, 1791 * overriding the site setting. 1792 * 1793 * @since 4.4.0 1794 * 1795 * @param bool $maybe_notify Whether to notify the post author about the new comment. 1796 * @param int $comment_ID The ID of the comment for the notification. 1797 */ 1798 $maybe_notify = apply_filters( 'notify_post_author', $maybe_notify, $comment_ID ); 1799 1779 1800 /* 1780 * `wp_notify_postauthor()`checks if notifying the author of their own comment.1801 * wp_notify_postauthor() checks if notifying the author of their own comment. 1781 1802 * By default, it won't, but filters can override this. 1782 1803 */ 1783 if ( ! get_option( 'comments_notify' )) {1804 if ( ! $maybe_notify ) { 1784 1805 return false; 1785 1806 } … … 1801 1822 * @since 1.0.0 1802 1823 * 1803 * global wpdb $wpdb1824 * @global wpdb $wpdb WordPress database abstraction object. 1804 1825 * 1805 1826 * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.
Note: See TracChangeset
for help on using the changeset viewer.