<!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][9256] trunk/src/bp-activity: Activity: Introduce new class - `BP_Activity_Query`.</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/9256">9256</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/9256","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>r-a-y</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2014-12-22 21:38:24 +0000 (Mon, 22 Dec 2014)</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'>Activity: Introduce new class - `BP_Activity_Query`.

`BP_Activity_Query` is a helper class, which extends the
`BP_Recursive_Query` class, for generating complex queries against data in
the activity database table.

A `'filter_query'` argument has been introduced to the `bp_has_activities()`
stack to support the use of `BP_Activity_Query` across the majority of
activity fetching functions.

See <a href="http://buddypress.trac.wordpress.org/ticket/4988">#4988</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpactivitybpactivityclassesphp">trunk/src/bp-activity/bp-activity-classes.php</a></li>
<li><a href="#trunksrcbpactivitybpactivityfunctionsphp">trunk/src/bp-activity/bp-activity-functions.php</a></li>
<li><a href="#trunksrcbpactivitybpactivitytemplatephp">trunk/src/bp-activity/bp-activity-template.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpactivitybpactivityclassesphp"></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/bp-activity-classes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-activity/bp-activity-classes.php     2014-12-22 20:43:35 UTC (rev 9255)
+++ trunk/src/bp-activity/bp-activity-classes.php       2014-12-22 21:38:24 UTC (rev 9256)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -270,6 +270,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *     @type array       $meta_query        Array of meta_query conditions. See WP_Meta_Query::queries.
</span><span class="cx" style="display: block; padding: 0 10px">         *     @type array       $date_query        Array of date_query conditions. See first parameter of
</span><span class="cx" style="display: block; padding: 0 10px">         *                                          WP_Date_Query::__construct().
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         *     @type array       $filter_query      Array of advanced query conditions. See BP_Activity_Query::__construct().
</ins><span class="cx" style="display: block; padding: 0 10px">          *     @type array       $filter            See BP_Activity_Activity::get_filter_sql().
</span><span class="cx" style="display: block; padding: 0 10px">         *     @type string      $search_terms      Limit results by a search term. Default: false.
</span><span class="cx" style="display: block; padding: 0 10px">         *     @type bool        $display_comments  Whether to include activity comments. Default: false.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,6 +318,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'in'                => false,      // Array of ids to limit query by (IN)
</span><span class="cx" style="display: block; padding: 0 10px">                        'meta_query'        => false,      // Filter by activitymeta
</span><span class="cx" style="display: block; padding: 0 10px">                        'date_query'        => false,      // Filter by date
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        'filter_query'      => false,      // Advanced filtering - see BP_Activity_Query
</ins><span class="cx" style="display: block; padding: 0 10px">                         'filter'            => false,      // See self::get_filter_sql()
</span><span class="cx" style="display: block; padding: 0 10px">                        'search_terms'      => false,      // Terms to search by
</span><span class="cx" style="display: block; padding: 0 10px">                        'display_comments'  => false,      // Whether to include activity comments
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -340,6 +342,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                // Excluded types
</span><span class="cx" style="display: block; padding: 0 10px">                $excluded_types = array();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // Advanced filtering
+               if ( ! empty( $r['filter_query'] ) ) {
+                       $filter_query = new BP_Activity_Query( $r['filter_query'] );
+                       if ( $sql = $filter_query->get_sql() ) {
+                               $where_conditions['filter_query_sql'] = $sql;
+                       }
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 // Regular filtering
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $r['filter'] && $filter_sql = BP_Activity_Activity::get_filter_sql( $r['filter'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $where_conditions['filter_sql'] = $filter_sql;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1491,6 +1501,251 @@
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Class for generating the WHERE SQL clause for advanced activity fetching.
+ *
+ * This is notably used in {@link BP_Activity_Activity::get()} with the
+ * 'filter_query' parameter.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+class BP_Activity_Query extends BP_Recursive_Query {
+       /**
+        * Array of activity queries.
+        *
+        * See {@see BP_Activity_Query::__construct()} for information on query arguments.
+        *
+        * @since BuddyPress (2.2.0)
+        * @access public
+        * @var array
+        */
+       public $queries = array();
+
+       /**
+        * Table alias.
+        *
+        * @since BuddyPress (2.2.0)
+        * @access public
+        * @var string
+        */
+       public $table_alias = '';
+
+       /**
+        * Supported DB columns.
+        *
+        * See the 'wp_bp_activity' DB table schema.
+        *
+        * @since BuddyPress (2.2.0)
+        * @access public
+        * @var array
+        */
+       public $db_columns = array(
+               'id', 'user_id', 'component', 'type', 'action', 'content',
+               'item_id', 'secondary_item_id', 'hide_sitewide', 'is_spam',
+       );
+
+       /**
+        * Constructor.
+        *
+        * @since BuddyPress (2.2.0)
+        *
+        * @param array $query {
+        *     Array of query clauses.
+        *
+        *     @type array {
+        *         @type string $column   Required. The column to query against. Basically, any DB column in the main
+        *                                'wp_bp_activity' table.
+        *         @type string $value    Required. Value to filter by.
+        *         @type string $compare  Optional. The comparison operator. Default '='.
+        *                                Accepts '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN', 'LIKE',
+        *                                'NOT LIKE', BETWEEN', 'NOT BETWEEN', 'REGEXP', 'NOT REGEXP', 'RLIKE'
+        *         @type string $relation Optional. The boolean relationship between the activity queries.
+        *                                Accepts 'OR', 'AND'. Default 'AND'.
+        *         @type array {
+        *             Optional. Another fully-formed activity query. See parameters above.
+        *         }
+        *     }
+        * }
+        */
+       public function __construct( $query = array() ) {
+               if ( ! is_array( $query ) ) {
+                       return;
+               }
+
+               $this->queries = $this->sanitize_query( $query );
+       }
+
+       /**
+        * Generates WHERE SQL clause to be appended to a main query.
+        *
+        * @since BuddyPress (2.2.0)
+        * @access public
+        *
+        * @param string $alias An existing table alias that is compatible with the current query clause.
+        *               Default: 'a'. BP_Activity_Activity::get() uses 'a', so we default to that.
+        * @return string SQL fragment to append to the main WHERE clause.
+        * }
+        */
+       public function get_sql( $alias = 'a' ) {
+               if ( ! empty( $alias ) ) {
+                       $this->table_alias = sanitize_title( $alias );
+               }
+
+               $sql = $this->get_sql_clauses();
+
+               // we only need the 'where' clause
+               //
+               // also trim trailing "AND" clause from parent BP_Recursive_Query class
+               // since it's not necessary for our needs
+               return preg_replace( '/^\sAND/', '', $sql['where'] );
+       }
+
+       /**
+        * Generate WHERE clauses for a first-order clause.
+        *
+        * @since BuddyPress (2.2.0)
+        * @access protected
+        *
+        * @param  array $clause       Array of arguments belonging to the clause.
+        * @param  array $parent_query Parent query to which the clause belongs.
+        * @return array {
+        *     @type array $where Array of subclauses for the WHERE statement.
+        *     @type array $join  Empty array. Not used.
+        * }
+        */
+       protected function get_sql_for_clause( $clause, $parent_query ) {
+               global $wpdb;
+
+               $sql_chunks = array(
+                       'where' => array(),
+                       'join' => array(),
+               );
+
+               $column = isset( $clause['column'] ) ? $this->validate_column( $clause['column'] ) : '';
+               $value  = isset( $clause['value'] )  ? $clause['value'] : '';
+               if ( empty( $column ) || ! isset( $clause['value'] ) ) {
+                       return $sql_chunks;
+               }
+
+               if ( isset( $clause['compare'] ) ) {
+                       $clause['compare'] = strtoupper( $clause['compare'] );
+               } else {
+                       $clause['compare'] = isset( $clause['value'] ) && is_array( $clause['value'] ) ? 'IN' : '=';
+               }
+
+               // default 'compare' to '=' if no valid operator is found
+               if ( ! in_array( $clause['compare'], array(
+                       '=', '!=', '>', '>=', '<', '<=',
+                       'LIKE', 'NOT LIKE',
+                       'IN', 'NOT IN',
+                       'BETWEEN', 'NOT BETWEEN',
+                       'REGEXP', 'NOT REGEXP', 'RLIKE'
+               ) ) ) {
+                       $clause['compare'] = '=';
+               }
+
+               $compare = $clause['compare'];
+
+               $alias = ! empty( $this->table_alias ) ? "{$this->table_alias}." : '';
+
+               // Next, Build the WHERE clause.
+               $where = '';
+
+               // value.
+               if ( isset( $clause['value'] ) ) {
+                       if ( in_array( $compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
+                               if ( ! is_array( $value ) ) {
+                                       $value = preg_split( '/[,\s]+/', $value );
+                               }
+                       }
+
+                       // tinyint
+                       if ( ! empty( $column ) && true === in_array( $column, array( 'hide_sitewide', 'is_spam' ) ) ) {
+                               $sql_chunks['where'][] = $wpdb->prepare( "{$alias}{$column} = %d", $value );
+
+                       } else {
+                               switch ( $compare ) {
+                                       // IN uses different syntax
+                                       case 'IN' :
+                                       case 'NOT IN' :
+                                               $in_sql = BP_Activity_Activity::get_in_operator_sql( "{$alias}{$column}", $value );
+
+                                               // 'NOT IN' operator is as easy as a string replace!
+                                               if ( 'NOT IN' === $compare ) {
+                                                       $in_sql = str_replace( 'IN', 'NOT IN', $in_sql );
+                                               }
+
+                                               $sql_chunks['where'][] = $in_sql;
+                                               break;
+
+                                       case 'BETWEEN' :
+                                       case 'NOT BETWEEN' :
+                                               $value = array_slice( $value, 0, 2 );
+                                               $where = $wpdb->prepare( '%s AND %s', $value );
+                                               break;
+
+                                       case 'LIKE' :
+                                       case 'NOT LIKE' :
+                                               $value = '%' . bp_esc_like( $value ) . '%';
+                                               $where = $wpdb->prepare( '%s', $value );
+                                               break;
+
+                                       default :
+                                               $where = $wpdb->prepare( '%s', $value );
+                                               break;
+
+                               }
+                       }
+
+                       if ( $where ) {
+                               $sql_chunks['where'][] = "{$alias}{$column} {$compare} {$where}";
+                       }
+               }
+
+               /*
+                * Multiple WHERE clauses should be joined in parentheses.
+                */
+               if ( 1 < count( $sql_chunks['where'] ) ) {
+                       $sql_chunks['where'] = array( '( ' . implode( ' AND ', $sql_chunks['where'] ) . ' )' );
+               }
+
+               return $sql_chunks;
+       }
+
+       /**
+        * Determine whether a clause is first-order.
+        *
+        * @since BuddyPress (2.2.0)
+        * @access protected
+        *
+        * @param  array $q Clause to check.
+        * @return bool
+        */
+        protected function is_first_order_clause( $query ) {
+               return isset( $query['column'] ) || isset( $query['value'] );
+        }
+
+       /**
+        * Validates a column name parameter.
+        *
+        * Column names are checked against a whitelist of known tables.
+        * See {@link BP_Activity_Query::db_tables}.
+        *
+        * @since BuddyPress (2.2.0)
+        * @access public
+        *
+        * @param string $column The user-supplied column name.
+        * @return string A validated column name value.
+        */
+       public function validate_column( $column = '' ) {
+               if ( in_array( $column, $this->db_columns ) ) {
+                       return $column;
+               } else {
+                       return '';
+               }
+       }
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * Create a RSS feed using the activity component.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * You should only construct a new feed when you've validated that you're on
</span></span></pre></div>
<a id="trunksrcbpactivitybpactivityfunctionsphp"></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/bp-activity-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-activity/bp-activity-functions.php   2014-12-22 20:43:35 UTC (rev 9255)
+++ trunk/src/bp-activity/bp-activity-functions.php     2014-12-22 21:38:24 UTC (rev 9256)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1416,6 +1416,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'search_terms'      => false,        // Pass search terms as a string
</span><span class="cx" style="display: block; padding: 0 10px">                'meta_query'        => false,        // Filter by activity meta. See WP_Meta_Query for format
</span><span class="cx" style="display: block; padding: 0 10px">                'date_query'        => false,        // Filter by date. See first parameter of WP_Date_Query for format
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'filter_query'      => false,
</ins><span class="cx" style="display: block; padding: 0 10px">                 'show_hidden'       => false,        // Show activity items that are hidden site-wide?
</span><span class="cx" style="display: block; padding: 0 10px">                'exclude'           => false,        // Comma-separated list of activity IDs to exclude
</span><span class="cx" style="display: block; padding: 0 10px">                'in'                => false,        // Comma-separated list or array of activity IDs to which you want to limit the query
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1437,7 +1438,7 @@
</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">        // Attempt to return a cached copy of the first page of sitewide activity.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( ( 1 === (int) $r['page'] ) && empty( $r['max'] ) && empty( $r['search_terms'] ) && empty( $r['meta_query'] ) && empty( $r['date_query'] ) && empty( $r['filter'] ) && empty( $r['exclude'] ) && empty( $r['in'] ) && ( 'DESC' === $r['sort'] ) && empty( $r['exclude'] ) && ( 'ham_only' === $r['spam'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ( 1 === (int) $r['page'] ) && empty( $r['max'] ) && empty( $r['search_terms'] ) && empty( $r['meta_query'] ) && empty( $r['date_query'] ) && empty( $r['filter_query'] ) && empty( $r['filter'] ) && empty( $r['exclude'] ) && empty( $r['in'] ) && ( 'DESC' === $r['sort'] ) && empty( $r['exclude'] ) && ( 'ham_only' === $r['spam'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' );
</span><span class="cx" style="display: block; padding: 0 10px">                if ( false === $activity ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1450,6 +1451,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'search_terms'      => $r['search_terms'],
</span><span class="cx" style="display: block; padding: 0 10px">                                'meta_query'        => $r['meta_query'],
</span><span class="cx" style="display: block; padding: 0 10px">                                'date_query'        => $r['date_query'],
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                'filter_query'      => $r['filter_query'],
</ins><span class="cx" style="display: block; padding: 0 10px">                                 'filter'            => $r['filter'],
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_comments'  => $r['display_comments'],
</span><span class="cx" style="display: block; padding: 0 10px">                                'show_hidden'       => $r['show_hidden'],
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1470,6 +1472,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'search_terms'     => $r['search_terms'],
</span><span class="cx" style="display: block; padding: 0 10px">                        'meta_query'       => $r['meta_query'],
</span><span class="cx" style="display: block; padding: 0 10px">                        'date_query'       => $r['date_query'],
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        'filter_query'     => $r['filter_query'],
</ins><span class="cx" style="display: block; padding: 0 10px">                         'filter'           => $r['filter'],
</span><span class="cx" style="display: block; padding: 0 10px">                        'display_comments' => $r['display_comments'],
</span><span class="cx" style="display: block; padding: 0 10px">                        'show_hidden'      => $r['show_hidden'],
</span></span></pre></div>
<a id="trunksrcbpactivitybpactivitytemplatephp"></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/bp-activity-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-activity/bp-activity-template.php    2014-12-22 20:43:35 UTC (rev 9255)
+++ trunk/src/bp-activity/bp-activity-template.php      2014-12-22 21:38:24 UTC (rev 9256)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -204,6 +204,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'search_terms'      => false,
</span><span class="cx" style="display: block; padding: 0 10px">                        'meta_query'        => false,
</span><span class="cx" style="display: block; padding: 0 10px">                        'date_query'        => false,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        'filter_query'      => false,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'display_comments'  => 'threaded',
</span><span class="cx" style="display: block; padding: 0 10px">                        'show_hidden'       => false,
</span><span class="cx" style="display: block; padding: 0 10px">                        'spam'              => 'ham_only',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,6 +250,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'search_terms'      => $search_terms,
</span><span class="cx" style="display: block; padding: 0 10px">                                'meta_query'        => $meta_query,
</span><span class="cx" style="display: block; padding: 0 10px">                                'date_query'        => $date_query,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                'filter_query'      => $filter_query,
</ins><span class="cx" style="display: block; padding: 0 10px">                                 'filter'            => $filter,
</span><span class="cx" style="display: block; padding: 0 10px">                                'show_hidden'       => $show_hidden,
</span><span class="cx" style="display: block; padding: 0 10px">                                'exclude'           => $exclude,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -461,6 +463,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">  *                                               {@link WP_Meta_Query::queries} for a description of the syntax.
</span><span class="cx" style="display: block; padding: 0 10px">  *     @type array             $date_query       Limit by date by passing an array of date_query conditions. See first
</span><span class="cx" style="display: block; padding: 0 10px">  *                                               parameter of {@link WP_Date_Query::__construct()} for syntax.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *     @type array             $filter_query     Advanced activity filtering.  See {@link BP_Activity_Query::__construct()}.
</ins><span class="cx" style="display: block; padding: 0 10px">  *     @type string            $search_terms     Limit results by a search term. Default: false.
</span><span class="cx" style="display: block; padding: 0 10px">  *     @type string            $scope            Use a BuddyPress pre-built filter.
</span><span class="cx" style="display: block; padding: 0 10px">  *                                                 - 'just-me' retrieves items belonging only to a user; this is equivalent
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -588,6 +591,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                'meta_query'        => false,        // filter on activity meta. See WP_Meta_Query for format
</span><span class="cx" style="display: block; padding: 0 10px">                'date_query'        => false,        // filter by date. See first parameter of WP_Date_Query for format
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'filter_query'      => false,        // advanced filtering.  See BP_Activity_Query for format
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Searching
</span><span class="cx" style="display: block; padding: 0 10px">                'search_terms'      => false,        // specify terms to search on
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -711,6 +715,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'search_terms'      => $search_terms,
</span><span class="cx" style="display: block; padding: 0 10px">                'meta_query'        => $meta_query,
</span><span class="cx" style="display: block; padding: 0 10px">                'date_query'        => $date_query,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'filter_query'      => $filter_query,
</ins><span class="cx" style="display: block; padding: 0 10px">                 'display_comments'  => $display_comments,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_hidden'       => $show_hidden,
</span><span class="cx" style="display: block; padding: 0 10px">                'spam'              => $spam,
</span></span></pre>
</div>
</div>

</body>
</html>