Ticket #761: 761.diff
File 761.diff, 2.0 KB (added by , 12 years ago) |
---|
-
wp-includes/comment.php
1326 1326 * 1327 1327 * @since 1.5.0 1328 1328 * @uses apply_filters() Calls 'preprocess_comment' hook on $commentdata parameter array before processing 1329 * @uses apply_filters() Calls 'notify_postauthor' hook on get_option('comments_notify') before processing 1329 1330 * @uses do_action() Calls 'comment_post' hook on $comment_ID returned from adding the comment and if the comment was approved. 1330 1331 * @uses wp_filter_comment() Used to filter comment before adding comment. 1331 1332 * @uses wp_allow_comment() checks to see if comment is approved. … … 1367 1368 1368 1369 $post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment 1369 1370 1370 if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) ) 1371 $do_notify = apply_filters( 'notify_postauthor', get_option( 'comments_notify' ), $comment_ID ); 1372 1373 if ( $do_notify && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) ) 1371 1374 wp_notify_postauthor($comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' ); 1372 1375 } 1373 1376 … … 1382 1385 * 1383 1386 * @since 1.0.0 1384 1387 * @uses wp_transition_comment_status() Passes new and old comment status along with $comment object 1388 * @uses apply_filters() Calls 'notify_postauthor' hook on get_option('comments_notify') before processing 1385 1389 * 1386 1390 * @param int $comment_id Comment ID. 1387 1391 * @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'trash'. … … 1400 1404 case 'approve': 1401 1405 case '1': 1402 1406 $status = '1'; 1403 if ( get_option('comments_notify') ) {1407 if ( apply_filters( 'notify_postauthor', get_option( 'comments_notify' ), $comment_id ) ) { 1404 1408 $comment = get_comment($comment_id); 1405 1409 wp_notify_postauthor($comment_id, $comment->comment_type); 1406 1410 }