<!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>[BuddyPress][10588] trunk/src/bp-activity/classes/class-bp-activity-activity.php: More @since tags and some doc cleanup for BP-Activty-Activity class.</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="http://buddypress.trac.wordpress.org/changeset/10588">10588</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/10588","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>tw2113</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-02-13 20:21:29 +0000 (Sat, 13 Feb 2016)</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 @since tags and some doc cleanup for BP-Activty-Activity class.
See <a href="http://buddypress.trac.wordpress.org/ticket/6396">#6396</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpactivityclassesclassbpactivityactivityphp">trunk/src/bp-activity/classes/class-bp-activity-activity.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpactivityclassesclassbpactivityactivityphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-activity/classes/class-bp-activity-activity.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-activity/classes/class-bp-activity-activity.php 2016-02-13 19:32:53 UTC (rev 10587)
+++ trunk/src/bp-activity/classes/class-bp-activity-activity.php 2016-02-13 20:21:29 UTC (rev 10588)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,7 +12,6 @@
</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"> * Database interaction class for the BuddyPress activity component.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><span class="cx" style="display: block; padding: 0 10px"> * Instance methods are available for creating/editing an activity,
</span><span class="cx" style="display: block; padding: 0 10px"> * static methods for querying activities.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,6 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * ID of the activity item.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.0.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,6 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * ID of the associated item.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.0.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $item_id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,6 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * ID of the associated secondary item.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.0.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $secondary_item_id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,6 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * ID of user associated with the activity item.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.0.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $user_id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,6 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The primary URL for the activity in RSS feeds.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.0.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $primary_link;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,6 +64,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * BuddyPress component the activity item relates to.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.2.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $component;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,6 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Activity type, eg 'new_blog_post'.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.2.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $type;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,6 +80,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Description of the activity, eg 'Alex updated his profile.'.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.2.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $action;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,6 +88,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The content of the activity item.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.2.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $content;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,6 +96,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The date the activity item was recorded, in 'Y-m-d h:i:s' format.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.0.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $date_recorded;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,6 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether the item should be hidden in sitewide streams.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.1.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $hide_sitewide = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,6 +112,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Node boundary start for activity or activity comment.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.5.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $mptt_left;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,6 +120,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Node boundary end for activity or activity comment.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.5.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $mptt_right;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,6 +128,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether this item is marked as spam.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.6.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var $is_spam;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,6 +136,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Constructor method.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.5.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int|bool $id Optional. The ID of a specific activity item.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct( $id = false ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,6 +149,8 @@
</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"> * Populate the object with data about the specific activity item.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @since 1.0.0
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function populate() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,12 +186,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false !== $action ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->action = $action;
</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 no callback is available, use the literal string from
- // the database row.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If no callback is available, use the literal string from
+ // the database row.
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! empty( $row->action ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->action = $row->action;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Provide a fallback to avoid PHP notices.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Provide a fallback to avoid PHP notices.
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->action = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -183,6 +200,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Save the activity item to the database.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.0.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on success.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function save() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -239,7 +258,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $this->id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->id = $wpdb->insert_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 an existing activity item, prevent any changes to the content generating new @mention notifications.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If an existing activity item, prevent any changes to the content generating new @mention notifications.
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_activity_at_name_do_notifications', '__return_false' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -261,7 +280,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get activity items, as specified by parameters.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 1.0.0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.2.0
</ins><span class="cx" style="display: block; padding: 0 10px"> * @since 2.4.0 Introduced the `$fields` parameter.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see BP_Activity_Activity::get_filter_sql() for a description of the
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -372,7 +391,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $r = self::array_replace_recursive( $r, $scope_query['override'] );
</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">- // Advanced filtering.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Advanced filtering.
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! empty( $r['filter_query'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $filter_query = new BP_Activity_Query( $r['filter_query'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $sql = $filter_query->get_sql();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -893,7 +912,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_array( $scope ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $scopes = $scope;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Explode a comma separated string of scopes.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Explode a comma separated string of scopes.
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( is_string( $scope ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $scopes = explode( ',', $scope );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -925,13 +944,14 @@
</span><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"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array {
</ins><span class="cx" style="display: block; padding: 0 10px"> * Activity query clauses.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type array {
</span><span class="cx" style="display: block; padding: 0 10px"> * Activity arguments for your custom scope.
</span><span class="cx" style="display: block; padding: 0 10px"> * See {@link BP_Activity_Query::_construct()} for more details.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array $override Optional. Override existing activity arguments passed by $r.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type array $override Optional. Override existing activity arguments passed by $r.
+ * }
</ins><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $r Current activity arguments passed in BP_Activity_Activity::get().
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -996,6 +1016,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the first activity ID that matches a set of criteria.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.2.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @todo Should parameters be optional?
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $user_id User ID to filter by.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1236,11 +1258,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * use it going forward, and use BP_Activity_Activity::delete() instead.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.2.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @deprecated 2.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $activity_ids Activity IDs whose comments should be deleted.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $delete_meta Should we delete the activity meta items for these comments.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on success.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function delete_activity_item_comments( $activity_ids = array(), $delete_meta = true ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1339,7 +1361,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'none' === $comments ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $comments = 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">- // A true cache miss.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // A true cache miss.
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( empty( $comments ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $bp = buddypress();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1350,7 +1372,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $fullname_from = ", {$bp->profile->table_name_data} pd ";
</span><span class="cx" style="display: block; padding: 0 10px"> $fullname_where = "AND pd.user_id = a.user_id AND pd.field_id = 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">- // Prevent debug errors.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Prevent debug errors.
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $fullname_select = $fullname_from = $fullname_where = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1393,8 +1415,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $descendants = $wpdb->get_results( $sql );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // We use the mptt BETWEEN clause to limit returned
- // descendants to the correct part of the tree.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // We use the mptt BETWEEN clause to limit returned
+ // descendants to the correct part of the tree.
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $sql = $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} a WHERE a.type = 'activity_comment' {$spam_sql} AND a.item_id = %d and a.mptt_left > %d AND a.mptt_left < %d ORDER BY a.date_recorded ASC", $top_level_parent_id, $left, $right );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1414,7 +1436,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ref[ $d->secondary_item_id ]->children[ $d->id ] = $d;
</span><span class="cx" style="display: block; padding: 0 10px"> $ref[ $d->id ] =& $ref[ $d->secondary_item_id ]->children[ $d->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 we don't have a reference on the parent, put in the root level.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If we don't have a reference on the parent, put in the root level.
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $comments[ $d->id ] = $d;
</span><span class="cx" style="display: block; padding: 0 10px"> $ref[ $d->id ] =& $comments[ $d->id ];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1477,9 +1499,9 @@
</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 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 $parent_id ID of an activity or activity comment.
- * @param int $left Node boundary start for activity or activity comment.
- * @return int Right Node boundary of activity or activity comment.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $parent_id ID of an activity or activity comment.
+ * @param int $left Node boundary start for activity or activity comment.
+ * @return int Right Node boundary of activity or activity comment.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function rebuild_activity_comment_tree( $parent_id, $left = 1 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1531,6 +1553,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get a list of components that have recorded activity associated with them.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.2.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $skip_last_activity If true, components will not be
</span><span class="cx" style="display: block; padding: 0 10px"> * included if the only activity type associated with them is
</span><span class="cx" style="display: block; padding: 0 10px"> * 'last_activity'. (Since 2.0.0, 'last_activity' is stored in
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1555,6 +1579,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get sitewide activity items for use in an RSS feed.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.0.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $limit Optional. Number of items to fetch. Default: 35.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array $activity_feed List of activity items, with RSS data added.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1618,7 +1644,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $filter_array {
</span><span class="cx" style="display: block; padding: 0 10px"> * Fields and values to filter by.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type array|string|int $user_id User ID(s).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type array|string|int $user_id User ID(s).
</ins><span class="cx" style="display: block; padding: 0 10px"> * @type array|string $object Corresponds to the 'component'
</span><span class="cx" style="display: block; padding: 0 10px"> * column in the database.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type array|string $action Corresponds to the 'type' column
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1727,6 +1753,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Check whether an activity item exists with a given string content.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $content The content to filter by.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return int|bool The ID of the first matching item if found, otherwise false.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1741,6 +1769,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Hide all activity for a given user.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 1.2.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $user_id The ID of the user whose activity you want to mark hidden.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return mixed
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre>
</div>
</div>
</body>
</html>