<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[34129] trunk/src: More comment functions can accept a full object instead of comment_ID to reduce cache/db lookups.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/34129">34129</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/34129","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-09-14 21:39:46 +0000 (Mon, 14 Sep 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>More comment functions can accept a full object instead of comment_ID to reduce cache/db lookups.
See #<a href="https://core.trac.wordpress.org/ticket/33638">#33638</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincommentphp">trunk/src/wp-admin/comment.php</a></li>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpincludescommentfunctionsphp">trunk/src/wp-includes/comment-functions.php</a></li>
<li><a href="#trunksrcwpincludesfunctionsphp">trunk/src/wp-includes/functions.php</a></li>
<li><a href="#trunksrcwpincludespluggablephp">trunk/src/wp-includes/pluggable.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/comment.php 2015-09-14 20:28:29 UTC (rev 34128)
+++ trunk/src/wp-admin/comment.php 2015-09-14 21:39:46 UTC (rev 34129)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -278,11 +278,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $redir = add_query_arg( array('unspammed' => '1'), $redir );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'approvecomment' :
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_set_comment_status( $comment_id, 'approve' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_set_comment_status( $comment, 'approve' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $redir = add_query_arg( array( 'approved' => 1 ), $redir );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'unapprovecomment' :
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_set_comment_status( $comment_id, 'hold' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_set_comment_status( $comment, 'hold' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ajax-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ajax-actions.php 2015-09-14 20:28:29 UTC (rev 34128)
+++ trunk/src/wp-admin/includes/ajax-actions.php 2015-09-14 21:39:46 UTC (rev 34129)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -520,7 +520,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( -1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> check_ajax_referer( "delete-comment_$id" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $status = wp_get_comment_status( $comment->comment_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $status = wp_get_comment_status( $comment );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $delta = -1;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset($_POST['trash']) && 1 == $_POST['trash'] ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -730,15 +730,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && ! current_user_can( 'moderate_comments' ) )
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( -1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $current = wp_get_comment_status( $comment->comment_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $current = wp_get_comment_status( $comment );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_POST['new'] ) && $_POST['new'] == $current )
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( time() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> check_ajax_referer( "approve-comment_$id" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $current, array( 'unapproved', 'spam' ) ) )
- $result = wp_set_comment_status( $comment->comment_ID, 'approve', true );
- else
- $result = wp_set_comment_status( $comment->comment_ID, 'hold', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) {
+ $result = wp_set_comment_status( $comment, 'approve', true );
+ } else {
+ $result = wp_set_comment_status( $comment, 'hold', true );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error($result) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $x = new WP_Ajax_Response( array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1015,7 +1016,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( -1 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( wp_set_comment_status( $parent->comment_ID, 'approve' ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( wp_set_comment_status( $parent, 'approve' ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> $comment_auto_approved = true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludescommentfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/comment-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/comment-functions.php 2015-09-14 20:28:29 UTC (rev 34128)
+++ trunk/src/wp-includes/comment-functions.php 2015-09-14 21:39:46 UTC (rev 34129)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -969,8 +969,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb WordPress database abstraction object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $comment_id Comment ID
- * @param bool $force_delete Whether to bypass trash and force deletion. Default is false.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.
+ * @param bool $force_delete Whether to bypass trash and force deletion. Default is false.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on success, false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_delete_comment($comment_id, $force_delete = false) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -978,7 +978,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$comment = get_comment($comment_id))
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( !$force_delete && EMPTY_TRASH_DAYS && !in_array( wp_get_comment_status($comment_id), array( 'trash', 'spam' ) ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( !$force_delete && EMPTY_TRASH_DAYS && !in_array( wp_get_comment_status( $comment ), array( 'trash', 'spam' ) ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> return wp_trash_comment($comment_id);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -988,21 +988,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id The comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'delete_comment', $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'delete_comment', $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Move children up a level.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $children = $wpdb->get_col( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_parent = %d", $comment_id) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $children = $wpdb->get_col( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_parent = %d", $comment->comment_ID) );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( !empty($children) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $wpdb->update($wpdb->comments, array('comment_parent' => $comment->comment_parent), array('comment_parent' => $comment_id));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $wpdb->update($wpdb->comments, array('comment_parent' => $comment->comment_parent), array('comment_parent' => $comment->comment_ID));
</ins><span class="cx" style="display: block; padding: 0 10px"> clean_comment_cache($children);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Delete metadata
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->commentmeta WHERE comment_id = %d", $comment_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->commentmeta WHERE comment_id = %d", $comment->comment_ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $meta_ids as $mid )
</span><span class="cx" style="display: block; padding: 0 10px"> delete_metadata_by_mid( 'comment', $mid );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $wpdb->delete( $wpdb->comments, array( 'comment_ID' => $comment_id ) ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $wpdb->delete( $wpdb->comments, array( 'comment_ID' => $comment->comment_ID ) ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1012,16 +1012,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id The comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'deleted_comment', $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'deleted_comment', $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = $comment->comment_post_ID;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $post_id && $comment->comment_approved == 1 )
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_comment_count($post_id);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- clean_comment_cache($comment_id);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ clean_comment_cache( $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in wp-includes/comment-functions.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'wp_set_comment_status', $comment_id, 'delete' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'wp_set_comment_status', $comment->comment_ID, 'delete' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_transition_comment_status('delete', $comment->comment_approved, $comment);
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1034,7 +1034,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $comment_id Comment ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on success, false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_trash_comment($comment_id) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1051,13 +1051,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id The comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'trash_comment', $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'trash_comment', $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( wp_set_comment_status($comment_id, 'trash') ) {
- delete_comment_meta( $comment_id, '_wp_trash_meta_status' );
- delete_comment_meta( $comment_id, '_wp_trash_meta_time' );
- add_comment_meta( $comment_id, '_wp_trash_meta_status', $comment->comment_approved );
- add_comment_meta( $comment_id, '_wp_trash_meta_time', time() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( wp_set_comment_status( $comment, 'trash' ) ) {
+ delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
+ delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );
+ add_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', $comment->comment_approved );
+ add_comment_meta( $comment->comment_ID, '_wp_trash_meta_time', time() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires immediately after a comment is sent to Trash.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1066,7 +1066,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id The comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'trashed_comment', $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'trashed_comment', $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1078,12 +1078,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $comment_id Comment ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on success, false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_untrash_comment($comment_id) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! (int)$comment_id )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $comment = get_comment( $comment_id );
+ if ( ! $comment ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires immediately before a comment is restored from the Trash.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1092,15 +1094,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id The comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'untrash_comment', $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'untrash_comment', $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty($status) )
</span><span class="cx" style="display: block; padding: 0 10px"> $status = '0';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( wp_set_comment_status($comment_id, $status) ) {
- delete_comment_meta($comment_id, '_wp_trash_meta_time');
- delete_comment_meta($comment_id, '_wp_trash_meta_status');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( wp_set_comment_status( $comment, $status ) ) {
+ delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );
+ delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires immediately after a comment is restored from the Trash.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1108,7 +1110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id The comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'untrashed_comment', $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'untrashed_comment', $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1120,12 +1122,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $comment_id Comment ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on success, false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wp_spam_comment($comment_id) {
- if ( !$comment = get_comment($comment_id) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_spam_comment( $comment_id ) {
+ $comment = get_comment( $comment_id );
+ if ( ! $comment ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires immediately before a comment is marked as Spam.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1134,13 +1138,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id The comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'spam_comment', $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'spam_comment', $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( wp_set_comment_status($comment_id, 'spam') ) {
- delete_comment_meta( $comment_id, '_wp_trash_meta_status' );
- delete_comment_meta( $comment_id, '_wp_trash_meta_time' );
- add_comment_meta( $comment_id, '_wp_trash_meta_status', $comment->comment_approved );
- add_comment_meta( $comment_id, '_wp_trash_meta_time', time() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( wp_set_comment_status( $comment, 'spam' ) ) {
+ delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
+ delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );
+ add_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', $comment->comment_approved );
+ add_comment_meta( $comment->comment_ID, '_wp_trash_meta_time', time() );
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires immediately after a comment is marked as Spam.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1148,7 +1152,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id The comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'spammed_comment', $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'spammed_comment', $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1167,6 +1171,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! (int)$comment_id )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $comment = get_comment( $comment_id );
+ if ( ! $comment ) {
+ return false;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires immediately before a comment is unmarked as Spam.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1180,7 +1189,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty($status) )
</span><span class="cx" style="display: block; padding: 0 10px"> $status = '0';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( wp_set_comment_status($comment_id, $status) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( wp_set_comment_status( $comment, $status ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> delete_comment_meta( $comment_id, '_wp_trash_meta_status' );
</span><span class="cx" style="display: block; padding: 0 10px"> delete_comment_meta( $comment_id, '_wp_trash_meta_time' );
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1675,9 +1684,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * global wpdb $wpdb
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $comment_id Comment ID.
- * @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'trash'.
- * @param bool $wp_error Whether to return a WP_Error object if there is a failure. Default is false.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.
+ * @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'trash'.
+ * @param bool $wp_error Whether to return a WP_Error object if there is a failure. Default is false.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool|WP_Error True on success, false or WP_Error on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1707,16 +1716,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_old = clone get_comment($comment_id);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( !$wpdb->update( $wpdb->comments, array('comment_approved' => $status), array('comment_ID' => $comment_id) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( !$wpdb->update( $wpdb->comments, array('comment_approved' => $status), array( 'comment_ID' => $comment_old->comment_ID ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $wp_error )
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error('db_update_error', __('Could not update comment status'), $wpdb->last_error);
</span><span class="cx" style="display: block; padding: 0 10px"> else
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- clean_comment_cache($comment_id);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ clean_comment_cache( $comment_old->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $comment = get_comment($comment_id);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $comment = get_comment( $comment_old->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires immediately before transitioning a comment's status from one to another
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1728,7 +1737,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|bool $comment_status Current comment status. Possible values include
</span><span class="cx" style="display: block; padding: 0 10px"> * 'hold', 'approve', 'spam', 'trash', or false.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'wp_set_comment_status', $comment_id, $comment_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'wp_set_comment_status', $comment->comment_ID, $comment_status );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_transition_comment_status($comment_status, $comment_old->comment_approved, $comment);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2316,8 +2325,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|array $ids Comment ID or array of comment IDs to remove from cache
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function clean_comment_cache($ids) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( (array) $ids as $id )
- wp_cache_delete($id, 'comment');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( (array) $ids as $id ) {
+ wp_cache_delete( $id, 'comment' );
+ wp_cache_delete( "comment-{$id}", 'counts' );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( 'last_changed', microtime(), 'comment' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/functions.php 2015-09-14 20:28:29 UTC (rev 34128)
+++ trunk/src/wp-includes/functions.php 2015-09-14 21:39:46 UTC (rev 34129)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4265,7 +4265,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> delete_comment_meta($comment_id, '_wp_trash_meta_time');
</span><span class="cx" style="display: block; padding: 0 10px"> delete_comment_meta($comment_id, '_wp_trash_meta_status');
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_delete_comment($comment_id);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_delete_comment( $del_comment );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludespluggablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/pluggable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/pluggable.php 2015-09-14 20:28:29 UTC (rev 34128)
+++ trunk/src/wp-includes/pluggable.php 2015-09-14 21:39:46 UTC (rev 34129)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1353,8 +1353,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $comment_id Comment ID
- * @param string $deprecated Not used
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.
+ * @param string $deprecated Not used
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on completion. False if no email addresses were specified.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_notify_postauthor( $comment_id, $deprecated = null ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1386,7 +1386,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $emails An array of email addresses to receive a comment notification.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id The comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $emails = apply_filters( 'comment_notification_recipients', $emails, $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $emails = apply_filters( 'comment_notification_recipients', $emails, $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> $emails = array_filter( $emails );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If there are no addresses to send the comment to, bail.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1409,7 +1409,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id The comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $notify_author = apply_filters( 'comment_notification_notify_author', false, $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notify_author = apply_filters( 'comment_notification_notify_author', false, $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The comment was left by the author
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $author && ! $notify_author && $comment->user_id == $post->post_author ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1475,12 +1475,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $notify_message .= sprintf( __('Permalink: %s'), get_comment_link( $comment ) ) . "\r\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( user_can( $post->post_author, 'edit_comment', $comment_id ) ) {
- if ( EMPTY_TRASH_DAYS )
- $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n";
- else
- $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "\r\n";
- $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( user_can( $post->post_author, 'edit_comment', $comment->comment_ID ) ) {
+ if ( EMPTY_TRASH_DAYS ) {
+ $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c={$comment->comment_ID}") ) . "\r\n";
+ } else {
+ $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c={$comment->comment_ID}") ) . "\r\n";
+ }
+ $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c={$comment->comment_ID}") ) . "\r\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1509,7 +1510,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $notify_message The comment notification email text.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id Comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filter the comment notification email subject.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1519,7 +1520,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $subject The comment notification email subject.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id Comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $subject = apply_filters( 'comment_notification_subject', $subject, $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $subject = apply_filters( 'comment_notification_subject', $subject, $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filter the comment notification email headers.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1529,7 +1530,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message_headers Headers for the comment notification email.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $comment_id Comment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment->comment_ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $emails as $email ) {
</span><span class="cx" style="display: block; padding: 0 10px"> @wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
</span></span></pre>
</div>
</div>
</body>
</html>