Ticket #761: comment.php.r19734.diff
File comment.php.r19734.diff, 3.3 KB (added by , 13 years ago) |
---|
-
wp-includes/comment.php
569 569 return update_metadata('comment', $comment_id, $meta_key, $meta_value, $prev_value); 570 570 } 571 571 572 /** 573 * Sets the cookies used to store an unauthenticated commentator's identity. Typically used 574 * to recall previous comments by this commentator that are still held in moderation. 575 * 572 /** 573 * Sets the cookies used to store an unauthenticated commentator's identity. Typically used 574 * to recall previous comments by this commentator that are still held in moderation. 575 * 576 576 * @param object $comment Comment object. 577 577 * @param object $user Comment author's object. 578 578 * 579 579 * @since 3.4.0 580 */ 581 function wp_set_comment_cookies($comment, $user) { 580 */ 581 function wp_set_comment_cookies($comment, $user) { 582 582 if ( $user->ID ) 583 583 return; 584 584 … … 586 586 setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN); 587 587 setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN); 588 588 setcookie('comment_author_url_' . COOKIEHASH, esc_url($comment->comment_author_url), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN); 589 } 589 } 590 590 591 591 /** 592 592 * Sanitizes the cookies sent to the user already. … … 1331 1331 * 1332 1332 * @since 1.5.0 1333 1333 * @uses apply_filters() Calls 'preprocess_comment' hook on $commentdata parameter array before processing 1334 * @uses apply_filters() Calls 'notify_postauthor' hook on get_option('comments_notify') before processing 1334 1335 * @uses do_action() Calls 'comment_post' hook on $comment_ID returned from adding the comment and if the comment was approved. 1335 1336 * @uses wp_filter_comment() Used to filter comment before adding comment. 1336 1337 * @uses wp_allow_comment() checks to see if comment is approved. … … 1372 1373 1373 1374 $post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment 1374 1375 1375 if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) ) 1376 $do_notify = apply_filters( 'notify_postauthor', get_option('comments_notify'), $comment_ID ); 1377 1378 if ( $do_notify && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) ) 1376 1379 wp_notify_postauthor($comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' ); 1377 1380 } 1378 1381 … … 1390 1393 * 1391 1394 * @since 1.0.0 1392 1395 * @uses wp_transition_comment_status() Passes new and old comment status along with $comment object 1396 * @uses apply_filters() Calls 'notify_postauthor' hook on get_option('comments_notify') before processing 1393 1397 * 1394 1398 * @param int $comment_id Comment ID. 1395 1399 * @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'delete'. … … 1408 1412 case 'approve': 1409 1413 case '1': 1410 1414 $status = '1'; 1411 if ( get_option('comments_notify') ) { 1415 $do_notify = apply_filters( 'notify_postauthor', get_option('comments_notify'), $comment_id ); 1416 if ( $do_notify ) { 1412 1417 $comment = get_comment($comment_id); 1413 1418 wp_notify_postauthor($comment_id, $comment->comment_type); 1414 1419 }