<!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>[33891] trunk/src: Introduce `WP_Comment` class to model/strongly-type rows from the comments database table.</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/33891">33891</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/33891","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-03 18:16:35 +0000 (Thu, 03 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'>Introduce `WP_Comment` class to model/strongly-type rows from the comments database table. Inclusion of this class is a pre-req for some more general comment cleanup and sanity.
* Takes inspiration from `WP_Post` and adds sanity to comment caching.
* Clarifies when the current global value for `$comment` is returned. The current implementation in `get_comment()` introduces side effects and an occasion stale global value for `$comment` when comment caches are cleaned.
* Strongly-types `@param` docs
* This class is marked `final` for now
Props wonderboymusic, nacin.
See <a href="https://core.trac.wordpress.org/ticket/32619">#32619</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmineditformcommentphp">trunk/src/wp-admin/edit-form-comment.php</a></li>
<li><a href="#trunksrcwpadminincludescommentphp">trunk/src/wp-admin/includes/comment.php</a></li>
<li><a href="#trunksrcwpadminincludesdashboardphp">trunk/src/wp-admin/includes/dashboard.php</a></li>
<li><a href="#trunksrcwpadminincludesexportphp">trunk/src/wp-admin/includes/export.php</a></li>
<li><a href="#trunksrcwpadminincludestemplatephp">trunk/src/wp-admin/includes/template.php</a></li>
<li><a href="#trunksrcwpcommentspostphp">trunk/src/wp-comments-post.php</a></li>
<li><a href="#trunksrcwpincludesclasswpcommentqueryphp">trunk/src/wp-includes/class-wp-comment-query.php</a></li>
<li><a href="#trunksrcwpincludesclasswpxmlrpcserverphp">trunk/src/wp-includes/class-wp-xmlrpc-server.php</a></li>
<li><a href="#trunksrcwpincludescommentfunctionsphp">trunk/src/wp-includes/comment-functions.php</a></li>
<li><a href="#trunksrcwpincludescommenttemplatephp">trunk/src/wp-includes/comment-template.php</a></li>
<li><a href="#trunksrcwpincludescommentphp">trunk/src/wp-includes/comment.php</a></li>
<li><a href="#trunksrcwpincludesfeedphp">trunk/src/wp-includes/feed.php</a></li>
<li><a href="#trunksrcwpincludeslinktemplatephp">trunk/src/wp-includes/link-template.php</a></li>
<li><a href="#trunksrcwpincludespluggablephp">trunk/src/wp-includes/pluggable.php</a></li>
<li><a href="#trunksrcwpincludesqueryphp">trunk/src/wp-includes/query.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasswpcommentphp">trunk/src/wp-includes/class-wp-comment.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmineditformcommentphp"></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/edit-form-comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/edit-form-comment.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-admin/edit-form-comment.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -171,7 +171,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.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 object $comment Comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Comment $comment Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'add_meta_boxes_comment', $comment );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludescommentphp"></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/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/comment.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-admin/includes/comment.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,12 +74,12 @@
</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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Returns a comment object based on comment ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Returns a WP_Comment object based on comment ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $id ID of comment to retrieve.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return object|false Comment if found. False on failure.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return WP_Comment|false Comment if found. False on failure.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_comment_to_edit( $id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !$comment = get_comment($id) )
</span></span></pre></div>
<a id="trunksrcwpadminincludesdashboardphp"></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/dashboard.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/dashboard.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-admin/includes/dashboard.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -548,10 +548,10 @@
</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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @global object $comment
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global WP_Comment $comment
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param object $comment
- * @param bool $show_date
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Comment $comment
+ * @param bool $show_date
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['comment'] =& $comment;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -603,10 +603,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.6.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 array $actions An array of comment actions. Default actions include:
- * 'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',
- * 'Delete', and 'Trash'.
- * @param object $comment The comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $actions An array of comment actions. Default actions include:
+ * 'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',
+ * 'Delete', and 'Trash'.
+ * @param WP_Comment $comment The comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesexportphp"></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/export.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/export.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-admin/includes/export.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -473,7 +473,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </wp:postmeta>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endforeach;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
+ $comments = array_map( 'get_comment', $_comments );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $comments as $c ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <wp:comment>
</span><span class="cx" style="display: block; padding: 0 10px"> <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
</span></span></pre></div>
<a id="trunksrcwpadminincludestemplatephp"></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/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/template.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-admin/includes/template.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -743,8 +743,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @global WP_Locale $wp_locale
- * @global object $comment
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global WP_Locale $wp_locale
+ * @global WP_Comment $comment
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|bool $edit Accepts 1|true for editing the date, 0|false for adding the date.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|bool $for_post Accepts 1|true for applying the date to a post, 0|false for a comment.
</span></span></pre></div>
<a id="trunksrcwpcommentspostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-comments-post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-comments-post.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-comments-post.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,8 +146,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.4.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 object $comment Comment object.
- * @param WP_User $user User object. The user may not exist.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Comment $comment Comment object.
+ * @param WP_User $user User object. The user may not exist.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'set_comment_cookies', $comment, $user );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -158,8 +158,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.5
</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 string $location The 'redirect_to' URI sent via $_POST.
- * @param object $comment Comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $location The 'redirect_to' URI sent via $_POST.
+ * @param WP_Comment $comment Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $location = apply_filters( 'comment_post_redirect', $location, $comment );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcommentqueryphp"></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/class-wp-comment-query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-comment-query.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-includes/class-wp-comment-query.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -665,8 +665,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $results An array of comments.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Comment_Query &$this Current instance of WP_Comment_Query, passed by reference.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $comments = apply_filters_ref_array( 'the_comments', array( $results, &$this ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $_comments = apply_filters_ref_array( 'the_comments', array( $results, &$this ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Convert to WP_Comment instances
+ $comments = array_map( 'get_comment', $_comments );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_cache_add( $cache_key, $comments, 'comment' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( '*' === $fields ) {
</span><span class="cx" style="display: block; padding: 0 10px"> update_comment_cache( $comments );
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcommentphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-includes/class-wp-comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-comment.php (rev 0)
+++ trunk/src/wp-includes/class-wp-comment.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,118 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+ /**
+ * WordPress Comment class
+ *
+ * @since 4.4.0
+ */
+final class WP_Comment {
+ /**
+ * @var int
+ */
+ public $comment_ID;
+ /**
+ * @var int
+ */
+ public $comment_post_ID = 0;
+ /**
+ * @var int
+ */
+ public $comment_author;
+ /**
+ * @var string
+ */
+ public $comment_author_email = '';
+ /**
+ * @var string
+ */
+ public $comment_author_url = '';
+ /**
+ * @var string
+ */
+ public $comment_author_IP = '';
+ /**
+ * @var string
+ */
+ public $comment_date = '0000-00-00 00:00:00';
+ /**
+ * @var string
+ */
+ public $comment_date_gmt = '0000-00-00 00:00:00';
+ /**
+ * @var string
+ */
+ public $comment_content;
+ /**
+ * @var int
+ */
+ public $comment_karma = 0;
+ /**
+ * @var string
+ */
+ public $comment_approved = '1';
+ /**
+ * @var string
+ */
+ public $comment_agent = '';
+ /**
+ * @var string
+ */
+ public $comment_type = '';
+ /**
+ * @var int
+ */
+ public $comment_parent = 0;
+ /**
+ * @var int
+ */
+ public $user_id = 0;
+
+ /**
+ * Retrieve WP_Comment instance.
+ *
+ * @static
+ * @access public
+ *
+ * @global wpdb $wpdb
+ *
+ * @param int $id Comment ID.
+ * @return WP_Comment|false Comment object, false otherwise.
+ */
+ public static function get_instance( $id ) {
+ global $wpdb;
+
+ $comment_id = (int) $id;
+ if ( ! $comment_id ) {
+ return false;
+ }
+
+ $_comment = wp_cache_get( $comment_id, 'comment' );
+
+ if ( ! $_comment ) {
+ $_comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id ) );
+
+ if ( ! $_comment ) {
+ return false;
+ }
+
+ wp_cache_add( $_comment->comment_ID, $_comment, 'comment' );
+ }
+
+ return new WP_Comment( $_comment );
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param WP_Comment $comment Comment object.
+ */
+ public function __construct( $comment ) {
+ foreach ( get_object_vars( $comment ) as $key => $value ) {
+ $this->$key = $value;
+ }
+ }
+
+ public function to_array() {
+ return get_object_vars( $this );
+ }
+}
</ins></span></pre></div>
<a id="trunksrcwpincludesclasswpxmlrpcserverphp"></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/class-wp-xmlrpc-server.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-xmlrpc-server.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-includes/class-wp-xmlrpc-server.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1042,8 +1042,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.4.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 array $_comment An array of prepared comment data.
- * @param object $comment Comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $_comment An array of prepared comment data.
+ * @param WP_Comment $comment Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'xmlrpc_prepare_comment', $_comment, $comment );
</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-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-includes/comment-functions.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,32 +164,27 @@
</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"> * @global object $comment
</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 object|string|int $comment Comment to retrieve.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Comment|string|int $comment Comment to retrieve.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return object|array|null Depends on $output value.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return WP_Comment|array|null Depends on $output value.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_comment(&$comment, $output = OBJECT) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global $wpdb;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $comment ) && isset( $GLOBALS['comment'] ) ) {
+ $comment = $GLOBALS['comment'];
+ }
</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 ( empty($comment) ) {
- if ( isset($GLOBALS['comment']) )
- $_comment = & $GLOBALS['comment'];
- else
- $_comment = null;
- } elseif ( is_object($comment) ) {
- wp_cache_add($comment->comment_ID, $comment, 'comment');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $comment instanceof WP_Comment ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $_comment = $comment;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( is_object( $comment ) ) {
+ $_comment = new WP_Comment( $comment );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset($GLOBALS['comment']) && ($GLOBALS['comment']->comment_ID == $comment) ) {
- $_comment = & $GLOBALS['comment'];
- } elseif ( ! $_comment = wp_cache_get($comment, 'comment') ) {
- $_comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment));
- if ( ! $_comment )
- return null;
- wp_cache_add($_comment->comment_ID, $_comment, 'comment');
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $_comment = WP_Comment::get_instance( $comment );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $_comment ) {
+ return null;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires after a comment is retrieved.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,14 +197,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $output == OBJECT ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $_comment;
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $output == ARRAY_A ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $__comment = get_object_vars($_comment);
- return $__comment;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $_comment->to_array();
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $output == ARRAY_N ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $__comment = array_values(get_object_vars($_comment));
- return $__comment;
- } else {
- return $_comment;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return array_values( $_comment->to_array() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $_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 class="lines" style="display: block; padding: 0 10px; color: #888">@@ -479,8 +471,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Sets the cookies used to store an unauthenticated commentator's identity. Typically used
</span><span class="cx" style="display: block; padding: 0 10px"> * to recall previous comments by this commentator that are still held in moderation.
</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 object $comment Comment object.
- * @param object $user Comment author's object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Comment $comment Comment object.
+ * @param object $user Comment author's object.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -760,7 +752,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global WP_Query $wp_query
</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 array $comments Optional array of comment objects. Defaults to $wp_query->comments
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $comments Optional array of WP_Comment objects. Defaults to $wp_query->comments
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $per_page Optional comments per page.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $threaded Optional control over flat or threaded comments.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return int Number of comment pages.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1288,7 +1280,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.7.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 object $comment Comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Comment $comment Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( "comment_{$old_status}_to_{$new_status}", $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1303,8 +1295,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.7.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 The comment ID.
- * @param obj $comment Comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $comment_ID The comment ID.
+ * @param WP_Comment $comment Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( "comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1423,8 +1415,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.8.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 $id The comment ID.
- * @param obj $comment Comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $id The comment ID.
+ * @param WP_Comment $comment Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'wp_insert_comment', $id, $comment );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludescommenttemplatephp"></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-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/comment-template.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-includes/comment-template.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,9 +37,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
</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 string $author The comment author's username.
- * @param int $comment_ID The comment ID.
- * @param object $comment The comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $author The comment author's username.
+ * @param int $comment_ID The comment ID.
+ * @param WP_Comment $comment The comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_comment_author', $author, $comment_ID, $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,9 +83,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
</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 string $comment_author_email The comment author's email address.
- * @param int $comment_ID The comment ID.
- * @param object $comment The comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $comment_author_email The comment author's email address.
+ * @param int $comment_ID The comment ID.
+ * @param WP_Comment $comment The comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment_ID, $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,8 +170,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.1.0 The `$comment` parameter was added.
</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 string $comment_author_email The comment author's email address.
- * @param object $comment The comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $comment_author_email The comment author's email address.
+ * @param WP_Comment $comment The comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> if ((!empty($email)) && ($email != '@')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -250,9 +250,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
</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 string $comment_author_IP The comment author's IP address.
- * @param int $comment_ID The comment ID.
- * @param object $comment The comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $comment_author_IP The comment author's IP address.
+ * @param int $comment_ID The comment ID.
+ * @param WP_Comment $comment The comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment_ID, $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -289,9 +289,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
</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 string $url The comment author's URL.
- * @param int $comment_ID The comment ID.
- * @param object $comment The comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $url The comment author's URL.
+ * @param int $comment_ID The comment ID.
+ * @param WP_Comment $comment The comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_comment_author_url', $url, $comment_ID, $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -508,7 +508,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|int $date Formatted date string or Unix timestamp.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $d The format of the date.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param object $comment The comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Comment $comment The comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_comment_date', $date, $d, $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -563,9 +563,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
</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 string $excerpt The comment excerpt text.
- * @param int $comment_ID The comment ID.
- * @param object $comment The comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $excerpt The comment excerpt text.
+ * @param int $comment_ID The comment ID.
+ * @param WP_Comment $comment The comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_comment_excerpt', $excerpt, $comment_ID, $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -611,8 +611,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.1.0 The `$comment_ID` parameter was added.
</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 The current comment ID.
- * @param object $comment The comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $comment_ID The current comment ID.
+ * @param WP_Comment $comment The comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_comment_ID', $comment->comment_ID, $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -636,8 +636,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @global WP_Rewrite $wp_rewrite
</span><span class="cx" style="display: block; padding: 0 10px"> * @global bool $in_comment_loop
</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 mixed $comment Comment to retrieve. Default current comment.
- * @param array $args Optional. An array of arguments to override the defaults.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Comment|int|null $comment Comment to retrieve. Default current comment.
+ * @param array $args Optional. An array of arguments to override the defaults.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string The permalink to the given comment.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_comment_link( $comment = null, $args = array() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -681,9 +681,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_page_of_comment()
</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 string $link The comment permalink with '#comment-$id' appended.
- * @param object $comment The current comment object.
- * @param array $args An array of arguments to override the defaults.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $link The comment permalink with '#comment-$id' appended.
+ * @param WP_Comment $comment The current comment object.
+ * @param array $args An array of arguments to override the defaults.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_comment_link', $link, $comment, $args );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -825,9 +825,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see Walker_Comment::comment()
</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 string $comment_content Text of the comment.
- * @param object $comment The comment object.
- * @param array $args An array of arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $comment_content Text of the comment.
+ * @param WP_Comment $comment The comment object.
+ * @param array $args An array of arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_comment_text', $comment->comment_content, $comment, $args );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -853,9 +853,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see Walker_Comment::comment()
</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 string $comment_text Text of the current comment.
- * @param object $comment The comment object.
- * @param array $args An array of arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $comment_text Text of the current comment.
+ * @param WP_Comment $comment The comment object.
+ * @param array $args An array of arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> echo apply_filters( 'comment_text', $comment_text, $comment, $args );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -890,7 +890,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $d Date format.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $gmt Whether the GMT date is in use.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $translate Whether the time is translated.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param object $comment The comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Comment $comment The comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_comment_time', $date, $d, $gmt, $translate, $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -925,9 +925,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
</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 string $comment_type The type of comment, such as 'comment', 'pingback', or 'trackback'.
- * @param int $comment_ID The comment ID.
- * @param object $comment The comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $comment_type The type of comment, such as 'comment', 'pingback', or 'trackback'.
+ * @param int $comment_ID The comment ID.
+ * @param WP_Comment $comment The comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_comment_type', $comment->comment_type, $comment_ID, $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1858,10 +1858,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see Walker::end_el()
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_list_comments()
</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 string $output Passed by reference. Used to append additional content.
- * @param object $comment The comment object. Default current comment.
- * @param int $depth Depth of comment.
- * @param array $args An array of arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $output Passed by reference. Used to append additional content.
+ * @param WP_Comment $comment The comment object. Default current comment.
+ * @param int $depth Depth of comment.
+ * @param array $args An array of arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function end_el( &$output, $comment, $depth = 0, $args = array() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !empty( $args['end-callback'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1884,9 +1884,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_list_comments()
</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 object $comment The comment object.
- * @param int $depth Depth of comment.
- * @param array $args An array of arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Comment $comment The comment object.
+ * @param int $depth Depth of comment.
+ * @param array $args An array of arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function ping( $comment, $depth, $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $tag = ( 'div' == $args['style'] ) ? 'div' : 'li';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2048,7 +2048,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type bool $short_ping Whether to output short pings. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type bool $echo Whether to echo the output or return it. Default true.
</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 array $comments Optional. Array of comment objects.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $comments Optional. Array of WP_Comment objects.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_list_comments( $args = array(), $comments = null ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop;
</span></span></pre></div>
<a id="trunksrcwpincludescommentphp"></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.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/comment.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-includes/comment.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,5 +6,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @subpackage Comment
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+require_once( ABSPATH . WPINC . '/class-wp-comment.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/class-wp-comment-query.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/comment-functions.php' );
</span></span></pre></div>
<a id="trunksrcwpincludesfeedphp"></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/feed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/feed.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-includes/feed.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,7 +264,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.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|object $comment_id Optional comment object or id. Defaults to global comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
+ * user email, WP_User object, WP_Post object, or WP_Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function comment_guid($comment_id = null) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo esc_url( get_comment_guid($comment_id) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -275,7 +276,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.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|object $comment_id Optional comment object or id. Defaults to global comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
+ * user email, WP_User object, WP_Post object, or WP_Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string false on failure or guid for comment on success.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_comment_guid($comment_id = null) {
</span></span></pre></div>
<a id="trunksrcwpincludeslinktemplatephp"></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/link-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/link-template.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-includes/link-template.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3454,7 +3454,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * user email, WP_User object, WP_Post object, or comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * user email, WP_User object, WP_Post object, or WP_Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * Optional. Arguments to return instead of the default arguments.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3485,8 +3485,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.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 mixed $id_or_email The Gravatar to check the data against. Accepts a user_id, gravatar md5 hash,
- * user email, WP_User object, WP_Post object, or comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
+ * user email, WP_User object, WP_Post object, or WP_Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * Optional. Arguments to return instead of the default arguments.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3586,8 +3586,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.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 array $args Arguments passed to get_avatar_data(), after processing.
- * @param int|object|string $id_or_email A user ID, email address, or comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $args Arguments passed to get_avatar_data(), after processing.
+ * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
+ * user email, WP_User object, WP_Post object, or WP_Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $args = apply_filters( 'pre_get_avatar_data', $args, $id_or_email );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3616,9 +3617,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $id_or_email instanceof WP_Post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Post Object
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_by( 'id', (int) $id_or_email->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) {
- // Comment Object
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( $id_or_email instanceof WP_Comment ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filter the list of allowed comment types for retrieving avatars.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3681,9 +3680,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.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 string $url The URL of the avatar.
- * @param int|object|string $id_or_email A user ID, email address, or comment object.
- * @param array $args Arguments passed to get_avatar_data(), after processing.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $url The URL of the avatar.
+ * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
+ * user email, WP_User object, WP_Post object, or WP_Comment object.
+ * @param array $args Arguments passed to get_avatar_data(), after processing.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $args['url'] = apply_filters( 'get_avatar_url', $url, $id_or_email, $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3692,8 +3692,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.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 array $args Arguments passed to get_avatar_data(), after processing.
- * @param int|object|string $id_or_email A user ID, email address, or comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $args Arguments passed to get_avatar_data(), after processing.
+ * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
+ * user email, WP_User object, WP_Post object, or WP_Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_avatar_data', $args, $id_or_email );
</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-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-includes/pluggable.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2190,7 +2190,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0 Optional `$args` parameter added.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * user email, WP_User object, WP_Post object, or comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * user email, WP_User object, WP_Post object, or WP_Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $size Optional. Height and width of the avatar image file in pixels. Default 96.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $default Optional. URL for the default image or a default type. Accepts '404'
</span><span class="cx" style="display: block; padding: 0 10px"> * (return a 404 instead of a default image), 'retro' (8bit), 'monsterid'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2258,9 +2258,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.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 string $avatar HTML for the user's avatar. Default null.
- * @param int|object|string $id_or_email A user ID, email address, or comment object.
- * @param array $args Arguments passed to get_avatar_url(), after processing.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $avatar HTML for the user's avatar. Default null.
+ * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
+ * user email, WP_User object, WP_Post object, or WP_Comment object.
+ * @param array $args Arguments passed to get_avatar_url(), after processing.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $avatar = apply_filters( 'pre_get_avatar', null, $id_or_email, $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2314,12 +2315,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0 The `$args` parameter was added.
</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 string $avatar <img> tag for the user's avatar.
- * @param int|object|string $id_or_email A user ID, email address, or comment object.
- * @param int $size Square avatar width and height in pixels to retrieve.
- * @param string $alt Alternative text to use in the avatar image tag.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $avatar <img> tag for the user's avatar.
+ * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
+ * user email, WP_User object, WP_Post object, or WP_Comment object.
+ * @param int $size Square avatar width and height in pixels to retrieve.
+ * @param string $alt Alternative text to use in the avatar image tag.
</ins><span class="cx" style="display: block; padding: 0 10px"> * Default empty.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $args Arguments passed to get_avatar_data(), after processing.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $args Arguments passed to get_avatar_data(), after processing.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesqueryphp"></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/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/query.php 2015-09-03 18:04:27 UTC (rev 33890)
+++ trunk/src/wp-includes/query.php 2015-09-03 18:16:35 UTC (rev 33891)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3186,7 +3186,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
</span><span class="cx" style="display: block; padding: 0 10px"> $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits");
+ // Convert to WP_Comment
+ $this->comments = array_map( 'get_comment', $comments );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->comment_count = count($this->comments);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_ids = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3557,7 +3559,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->comments = $wpdb->get_results($comments_request);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $comments = $wpdb->get_results($comments_request);
+ // Convert to WP_Comment
+ $this->comments = array_map( 'get_comment', $comments );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->comment_count = count($this->comments);
</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">@@ -3812,12 +3816,12 @@
</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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Iterate current comment index and return comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Iterate current comment index and return WP_Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return object Comment object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return WP_Comment Comment object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function next_comment() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->current_comment++;
</span></span></pre>
</div>
</div>
</body>
</html>