<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[BuddyPress] [1844] trunk: Added extra filtering on template loops,
  applies to #980 props jeffsayre.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>1844</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-09-10 18:34:52 +0000 (Thu, 10 Sep 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Added extra filtering on template loops, applies to #980 props jeffsayre.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivitytemplatetagsphp">trunk/bp-activity/bp-activity-templatetags.php</a></li>
<li><a href="#trunkbpactivityphp">trunk/bp-activity.php</a></li>
<li><a href="#trunkbpblogsbpblogstemplatetagsphp">trunk/bp-blogs/bp-blogs-templatetags.php</a></li>
<li><a href="#trunkbpforumsbpforumstemplatetagsphp">trunk/bp-forums/bp-forums-templatetags.php</a></li>
<li><a href="#trunkbpfriendsbpfriendstemplatetagsphp">trunk/bp-friends/bp-friends-templatetags.php</a></li>
<li><a href="#trunkbpgroupsbpgroupstemplatetagsphp">trunk/bp-groups/bp-groups-templatetags.php</a></li>
<li><a href="#trunkbpmessagesbpmessagestemplatetagsphp">trunk/bp-messages/bp-messages-templatetags.php</a></li>
<li><a href="#trunkbpwirebpwiretemplatetagsphp">trunk/bp-wire/bp-wire-templatetags.php</a></li>
<li><a href="#trunkbpxprofilebpxprofiletemplatetagsphp">trunk/bp-xprofile/bp-xprofile-templatetags.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivitytemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-templatetags.php (1843 => 1844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-templatetags.php        2009-09-10 17:21:07 UTC (rev 1843)
+++ trunk/bp-activity/bp-activity-templatetags.php        2009-09-10 18:34:52 UTC (rev 1844)
</span><span class="lines">@@ -170,7 +170,7 @@
</span><span class="cx">                 $filter = array( 'object' =&gt; $object, 'action' =&gt; $action, 'primary_id' =&gt; $primary_id, 'secondary_id' =&gt; $secondary_id );
</span><span class="cx">         
</span><span class="cx">         $activities_template = new BP_Activity_Template( $type, $user_id, $per_page, $max, $filter );                
</span><del>-        return $activities_template-&gt;has_activities();
</del><ins>+        return apply_filters( 'bp_has_activities', $activities_template-&gt;has_activities(), &amp;$activities_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_activities() {
</span></span></pre></div>
<a id="trunkbpactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity.php (1843 => 1844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity.php        2009-09-10 17:21:07 UTC (rev 1843)
+++ trunk/bp-activity.php        2009-09-10 18:34:52 UTC (rev 1844)
</span><span class="lines">@@ -161,6 +161,8 @@
</span><span class="cx">                 bp_core_add_message( __( 'Activity deleted', 'buddypress' ) );
</span><span class="cx">         else
</span><span class="cx">                 bp_core_add_message( __( 'There was an error when deleting that activity', 'buddypress' ), 'error' );
</span><ins>+                
+        do_action( 'bp_activity_action_delete_activity', $activity_id );
</ins><span class="cx">         
</span><span class="cx">         bp_core_redirect( $_SERVER['HTTP_REFERER'] );
</span><span class="cx"> }
</span><span class="lines">@@ -333,30 +335,30 @@
</span><span class="cx">                 $content = $before . ' &lt;span class=&quot;time-since&quot;&gt;%s&lt;/span&gt;' . $after;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        return $content;
</del><ins>+        return apply_filters( 'bp_activity_add_timesince_placeholder', $content );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_activity_check_exists_by_content( $content ) {
</span><span class="cx">         /* Insert the &quot;time-since&quot; placeholder to match the existing content in the DB */
</span><span class="cx">         $content = bp_activity_add_timesince_placeholder( $content );
</span><span class="cx"> 
</span><del>-        return BP_Activity_Activity::check_exists_by_content( $content );
</del><ins>+        return apply_filters( 'bp_activity_check_exists_by_content', BP_Activity_Activity::check_exists_by_content( $content ) );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_activity_get_last_updated() {
</span><del>-        return BP_Activity_Activity::get_last_updated();
</del><ins>+        return apply_filters( 'bp_activity_get_last_updated', BP_Activity_Activity::get_last_updated() );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_activity_get_sitewide_activity( $max_items = 30, $pag_num = false, $pag_page = false, $filter = false ) {
</span><del>-        return BP_Activity_Activity::get_sitewide_activity( $max_items, $pag_num, $pag_page, $filter );
</del><ins>+         return apply_filters( 'bp_activity_get_sitewide_activity', BP_Activity_Activity::get_sitewide_activity( $max_items, $pag_num, $pag_page, $filter ), $max_items, $pag_num, $pag_page, $filter );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_activity_get_user_activity( $user_id, $max_items = 30, $pag_num = false, $pag_page = false, $filter = false ) {
</span><del>-        return BP_Activity_Activity::get_activity_for_user( $user_id, $max_items, $pag_num, $pag_page, $filter );
</del><ins>+        return apply_filters( 'bp_activity_get_user_activity', BP_Activity_Activity::get_activity_for_user( $user_id, $max_items, $pag_num, $pag_page, $filter ), $user_id, $max_items, $pag_num, $pag_page, $filter );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_activity_get_friends_activity( $user_id, $max_items = 30, $max_items_per_friend = false, $pag_num = false, $pag_page = false, $filter = false ) {
</span><del>-        return BP_Activity_Activity::get_activity_for_friends( $user_id, $max_items, $max_items_per_friend, $pag_num, $pag_page, $filter );
</del><ins>+        return apply_filters( 'bp_activity_get_friends_activity', BP_Activity_Activity::get_activity_for_friends( $user_id, $max_items, $max_items_per_friend, $pag_num, $pag_page, $filter ), $user_id, $max_items, $max_items_per_friend, $pag_num, $pag_page, $filter );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_activity_remove_data( $user_id ) {
</span><span class="lines">@@ -371,7 +373,7 @@
</span><span class="cx"> 
</span><span class="cx"> /* Ordering function - don't call this directly */
</span><span class="cx"> function bp_activity_order_by_date( $a, $b ) {
</span><del>-        return strcasecmp( $b['date_recorded'], $a['date_recorded'] );        
</del><ins>+        return apply_filters( 'bp_activity_order_by_date', strcasecmp( $b['date_recorded'], $a['date_recorded'] ) );        
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ?&gt;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkbpblogsbpblogstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs/bp-blogs-templatetags.php (1843 => 1844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs/bp-blogs-templatetags.php        2009-09-10 17:21:07 UTC (rev 1843)
+++ trunk/bp-blogs/bp-blogs-templatetags.php        2009-09-10 18:34:52 UTC (rev 1844)
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx"> 
</span><span class="cx">         $blogs_template = new BP_Blogs_User_Blogs_Template( $user_id, $per_page, $max );
</span><del>-        return $blogs_template-&gt;has_blogs();
</del><ins>+        return apply_filters( 'bp_has_blogs', $blogs_template-&gt;has_blogs(), &amp;$blogs_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_blogs() {
</span><span class="lines">@@ -484,7 +484,7 @@
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx"> 
</span><span class="cx">         $posts_template = new BP_Blogs_Blog_Post_Template( $user_id, $per_page, $max );        
</span><del>-        return $posts_template-&gt;has_posts();
</del><ins>+        return apply_filters( 'bp_has_posts', $posts_template-&gt;has_posts(), &amp;$posts_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_posts() {
</span><span class="lines">@@ -919,8 +919,7 @@
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx">         
</span><span class="cx">         $comments_template = new BP_Blogs_Post_Comment_Template( $user_id, $per_page, $max );
</span><del>-        
-        return $comments_template-&gt;has_comments();
</del><ins>+        return apply_filters( 'bp_has_comments', $comments_template-&gt;has_comments(), &amp;$comments_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_comments() {
</span></span></pre></div>
<a id="trunkbpforumsbpforumstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-templatetags.php (1843 => 1844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-templatetags.php        2009-09-10 17:21:07 UTC (rev 1843)
+++ trunk/bp-forums/bp-forums-templatetags.php        2009-09-10 18:34:52 UTC (rev 1844)
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">         else
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        return $forum_template-&gt;has_topics();
</del><ins>+        return apply_filters( 'bp_has_topics', $forum_template-&gt;has_topics(), &amp;$forum_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_topics() {
</span><span class="lines">@@ -599,7 +599,7 @@
</span><span class="cx">         else
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        return $topic_template-&gt;has_posts();
</del><ins>+        return apply_filters( 'bp_has_topic_posts', $topic_template-&gt;has_posts(), &amp;$topic_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_topic_posts() {
</span></span></pre></div>
<a id="trunkbpfriendsbpfriendstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends/bp-friends-templatetags.php (1843 => 1844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends/bp-friends-templatetags.php        2009-09-10 17:21:07 UTC (rev 1843)
+++ trunk/bp-friends/bp-friends-templatetags.php        2009-09-10 18:34:52 UTC (rev 1844)
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx">                 $filter = $_REQUEST['friend-search-box'];
</span><span class="cx"> 
</span><span class="cx">         $friends_template = new BP_Friendship_Template( $user_id, $type, $per_page, $max, $filter );
</span><del>-        return $friends_template-&gt;has_friendships();
</del><ins>+        return apply_filters( 'bp_has_friendships', $friends_template-&gt;has_friendships(), &amp;$friends_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_the_friendship() {
</span><span class="lines">@@ -344,31 +344,38 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_add_friend_button( $potential_friend_id = false ) {
</span><del>-        global $bp, $friends_template;
</del><ins>+        echo bp_get_add_friend_button();
+}
+        function bp_get_add_friend_button( $potential_friend_id = false ) {
+                global $bp, $friends_template;
</ins><span class="cx">         
</span><del>-        if ( is_user_logged_in() ) {
</del><ins>+                $button = false;
</ins><span class="cx">                 
</span><del>-                if ( !$potential_friend_id &amp;&amp; $friends_template-&gt;friendship-&gt;friend )
-                        $potential_friend_id = $friends_template-&gt;friendship-&gt;friend-&gt;id;
-                else if ( !$potential_friend_id &amp;&amp; !$friends_template-&gt;friendship-&gt;friend )
-                        $potential_friend_id = $bp-&gt;displayed_user-&gt;id;
</del><ins>+                if ( is_user_logged_in() ) {
+                
+                        if ( !$potential_friend_id &amp;&amp; $friends_template-&gt;friendship-&gt;friend )
+                                $potential_friend_id = $friends_template-&gt;friendship-&gt;friend-&gt;id;
+                        else if ( !$potential_friend_id &amp;&amp; !$friends_template-&gt;friendship-&gt;friend )
+                                $potential_friend_id = $bp-&gt;displayed_user-&gt;id;
</ins><span class="cx"> 
</span><del>-                if ( $bp-&gt;loggedin_user-&gt;id == $potential_friend_id )
-                        return false;
</del><ins>+                        if ( $bp-&gt;loggedin_user-&gt;id == $potential_friend_id )
+                                return false;
</ins><span class="cx"> 
</span><del>-                $friend_status = BP_Friends_Friendship::check_is_friend( $bp-&gt;loggedin_user-&gt;id, $potential_friend_id );
</del><ins>+                        $friend_status = BP_Friends_Friendship::check_is_friend( $bp-&gt;loggedin_user-&gt;id, $potential_friend_id );
</ins><span class="cx"> 
</span><del>-                echo '&lt;div class=&quot;generic-button friendship-button ' . $friend_status . '&quot; id=&quot;friendship-button-' . $potential_friend_id . '&quot;&gt;';
-                if ( 'pending' == $friend_status ) {
-                        echo '&lt;a class=&quot;requested&quot; href=&quot;' . $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;friends-&gt;slug . '&quot;&gt;' . __( 'Friendship Requested', 'buddypress' ) . '&lt;/a&gt;';
-                } else if ( 'is_friend' == $friend_status ) {
-                        echo '&lt;a href=&quot;' . wp_nonce_url( $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;friends-&gt;slug . '/remove-friend/' . $potential_friend_id, 'friends_remove_friend' ) . '&quot; title=&quot;' . __('Cancel Friendship', 'buddypress') . '&quot; id=&quot;friend-' . $potential_friend_id . '&quot; rel=&quot;remove&quot; class=&quot;remove&quot;&gt;' . __('Cancel Friendship', 'buddypress') . '&lt;/a&gt;';
-                } else {
-                        echo '&lt;a href=&quot;' . wp_nonce_url( $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;friends-&gt;slug . '/add-friend/' . $potential_friend_id, 'friends_add_friend' ) . '&quot; title=&quot;' . __('Add Friend', 'buddypress') . '&quot; id=&quot;friend-' . $potential_friend_id . '&quot; rel=&quot;add&quot; class=&quot;add&quot;&gt;' . __('Add Friend', 'buddypress') . '&lt;/a&gt;';
</del><ins>+                        $button = '&lt;div class=&quot;generic-button friendship-button ' . $friend_status . '&quot; id=&quot;friendship-button-' . $potential_friend_id . '&quot;&gt;';
+                        if ( 'pending' == $friend_status ) {
+                                $button .= '&lt;a class=&quot;requested&quot; href=&quot;' . $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;friends-&gt;slug . '&quot;&gt;' . __( 'Friendship Requested', 'buddypress' ) . '&lt;/a&gt;';
+                        } else if ( 'is_friend' == $friend_status ) {
+                                $button .= '&lt;a href=&quot;' . wp_nonce_url( $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;friends-&gt;slug . '/remove-friend/' . $potential_friend_id, 'friends_remove_friend' ) . '&quot; title=&quot;' . __('Cancel Friendship', 'buddypress') . '&quot; id=&quot;friend-' . $potential_friend_id . '&quot; rel=&quot;remove&quot; class=&quot;remove&quot;&gt;' . __('Cancel Friendship', 'buddypress') . '&lt;/a&gt;';
+                        } else {
+                                $button .= '&lt;a href=&quot;' . wp_nonce_url( $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;friends-&gt;slug . '/add-friend/' . $potential_friend_id, 'friends_add_friend' ) . '&quot; title=&quot;' . __('Add Friend', 'buddypress') . '&quot; id=&quot;friend-' . $potential_friend_id . '&quot; rel=&quot;add&quot; class=&quot;add&quot;&gt;' . __('Add Friend', 'buddypress') . '&lt;/a&gt;';
+                        }
+                        $button .= '&lt;/div&gt;';
</ins><span class="cx">                 }
</span><del>-                echo '&lt;/div&gt;';
</del><ins>+                
+                return apply_filters( 'bp_get_add_friend_button', $button );
</ins><span class="cx">         }
</span><del>-}
</del><span class="cx"> 
</span><span class="cx"> function bp_friends_header_tabs() {
</span><span class="cx">         global $bp, $create_group_step, $completed_to_step;
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-templatetags.php (1843 => 1844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-templatetags.php        2009-09-10 17:21:07 UTC (rev 1843)
+++ trunk/bp-groups/bp-groups-templatetags.php        2009-09-10 18:34:52 UTC (rev 1844)
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx">                 $filter = $_REQUEST['group-filter-box'];
</span><span class="cx">         
</span><span class="cx">         $groups_template = new BP_Groups_User_Groups_Template( $user_id, $type, $per_page, $max, $slug, $filter );
</span><del>-        return $groups_template-&gt;has_groups();
</del><ins>+        return apply_filters( 'bp_has_groups', $groups_template-&gt;has_groups(), &amp;$groups_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_groups() {
</span><span class="lines">@@ -1359,8 +1359,7 @@
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx"> 
</span><span class="cx">         $members_template = new BP_Groups_Group_Members_Template( $group_id, $per_page, $max, (int)$exclude_admins_mods, (int)$exclude_banned );
</span><del>-        
-        return $members_template-&gt;has_members();
</del><ins>+        return apply_filters( 'bp_group_has_members', $members_template-&gt;has_members(), &amp;$members_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_group_members() {
</span><span class="lines">@@ -1927,8 +1926,7 @@
</span><span class="cx">         }
</span><span class="cx">                 
</span><span class="cx">         $site_groups_template = new BP_Groups_Site_Groups_Template( $type, $per_page, $max );
</span><del>-
-        return $site_groups_template-&gt;has_groups();
</del><ins>+        return apply_filters( 'bp_has_site_groups', $site_groups_template-&gt;has_groups(), &amp;$site_groups_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_site_groups() {
</span><span class="lines">@@ -2212,7 +2210,7 @@
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx"> 
</span><span class="cx">         $requests_template = new BP_Groups_Membership_Requests_Template( $group_id, $per_page, $max );
</span><del>-        return $requests_template-&gt;has_requests();
</del><ins>+        return apply_filters( 'bp_group_has_membership_requests', $requests_template-&gt;has_requests(), &amp;$requests_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_group_membership_requests() {
</span><span class="lines">@@ -2358,7 +2356,7 @@
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         $invites_template = new BP_Groups_Invite_Template( $user_id, $group_id );
</span><del>-        return $invites_template-&gt;has_invites();
</del><ins>+        return apply_filters( 'bp_group_has_invites', $invites_template-&gt;has_invites(), &amp;$invites_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_group_invites() {
</span></span></pre></div>
<a id="trunkbpmessagesbpmessagestemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages/bp-messages-templatetags.php (1843 => 1844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages/bp-messages-templatetags.php        2009-09-10 17:21:07 UTC (rev 1843)
+++ trunk/bp-messages/bp-messages-templatetags.php        2009-09-10 18:34:52 UTC (rev 1844)
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">                 $messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type );
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        return $messages_template-&gt;has_threads();
</del><ins>+        return apply_filters( 'bp_has_message_threads', $messages_template-&gt;has_threads(), &amp;$messages_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_message_threads() { 
</span><span class="lines">@@ -433,20 +433,20 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_send_message_button() {
</span><del>-        global $bp;
</del><ins>+        echo bp_get_send_message_button();
+}
+        function bp_get_send_message_button() {
+                global $bp;
</ins><span class="cx">         
</span><del>-        if ( bp_is_home() || !is_user_logged_in() )
-                return false;
</del><ins>+                if ( bp_is_home() || !is_user_logged_in() )
+                        return false;
</ins><span class="cx">         
</span><del>-        $ud = get_userdata( $bp-&gt;displayed_user-&gt;id ); 
-        ?&gt;
-        &lt;div class=&quot;generic-button&quot;&gt;
-                &lt;a class=&quot;send-message&quot; title=&quot;&lt;?php _e( 'Send Message', 'buddypress' ) ?&gt;&quot; href=&quot;&lt;?php echo $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;messages-&gt;slug ?&gt;/compose/?r=&lt;?php echo $ud-&gt;user_login ?&gt;&quot;&gt;&lt;?php _e( 'Send Message', 'buddypress' ) ?&gt;&lt;/a&gt;
-        &lt;/div&gt;
-        &lt;?php
-}
</del><ins>+                $ud = get_userdata( $bp-&gt;displayed_user-&gt;id ); 
+                
+                return apply_filters( 'bp_get_send_message_button', '&lt;div class=&quot;generic-button&quot;&gt;&lt;a class=&quot;send-message&quot; title=&quot;' . __( 'Send Message', 'buddypress' ) . '&quot; href=&quot;' . $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;messages-&gt;slug . '/compose/?r=' . $ud-&gt;user_login . '&quot;&gt;' . __( 'Send Message', 'buddypress' ) . '&lt;/a&gt;&lt;/div&gt;' );
+        }
</ins><span class="cx"> 
</span><del>-function bp_message_loading_image_src() {
</del><ins>+function bp_message_loading_imAage_src() {
</ins><span class="cx">         echo bp_get_message_loading_image_src();
</span><span class="cx"> }
</span><span class="cx">         function bp_get_message_loading_image_src() {
</span></span></pre></div>
<a id="trunkbpwirebpwiretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-wire/bp-wire-templatetags.php (1843 => 1844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-wire/bp-wire-templatetags.php        2009-09-10 17:21:07 UTC (rev 1843)
+++ trunk/bp-wire/bp-wire-templatetags.php        2009-09-10 18:34:52 UTC (rev 1844)
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx">                 return false;
</span><span class="cx">                 
</span><span class="cx">         $wire_posts_template = new BP_Wire_Posts_Template( $item_id, $component_slug, $can_post, $per_page, $max );                
</span><del>-        return $wire_posts_template-&gt;has_wire_posts();
</del><ins>+        return apply_filters( 'bp_has_wire_posts', $wire_posts_template-&gt;has_wire_posts(), &amp;$wire_posts_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_wire_posts() {
</span></span></pre></div>
<a id="trunkbpxprofilebpxprofiletemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile/bp-xprofile-templatetags.php (1843 => 1844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile/bp-xprofile-templatetags.php        2009-09-10 17:21:07 UTC (rev 1843)
+++ trunk/bp-xprofile/bp-xprofile-templatetags.php        2009-09-10 18:34:52 UTC (rev 1844)
</span><span class="lines">@@ -50,10 +50,9 @@
</span><span class="cx">                 $this-&gt;current_group++;
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;group = $this-&gt;groups[$this-&gt;current_group];
</span><del>-                $this-&gt;field_count = count($this-&gt;group-&gt;fields);
</del><span class="cx">                 
</span><span class="cx">                 if ( !$fields = wp_cache_get( 'xprofile_fields_' . $this-&gt;group-&gt;id . '_' . $this-&gt;user_id, 'bp' ) ) {
</span><del>-                        for ( $i = 0; $i &lt; $this-&gt;field_count; $i++ ) {
</del><ins>+                        for ( $i = 0; $i &lt; count($this-&gt;group-&gt;fields); $i++ ) {
</ins><span class="cx">                                 $field = new BP_XProfile_Field( $this-&gt;group-&gt;fields[$i]-&gt;id, $this-&gt;user_id );
</span><span class="cx">                                 $fields[$i] = $field;
</span><span class="cx">                         }
</span><span class="lines">@@ -61,7 +60,8 @@
</span><span class="cx">                         wp_cache_set( 'xprofile_fields_' . $this-&gt;group-&gt;id . '_' . $this-&gt;user_id, $fields, 'bp' );
</span><span class="cx">                 }
</span><span class="cx">                 
</span><del>-                $this-&gt;group-&gt;fields = $fields;
</del><ins>+                $this-&gt;group-&gt;fields = apply_filters( 'xprofile_group_fields', $fields, $this-&gt;group-&gt;id );
+                $this-&gt;field_count = count( $this-&gt;group-&gt;fields );
</ins><span class="cx">                 
</span><span class="cx">                 return $this-&gt;group;
</span><span class="cx">         }
</span><span class="lines">@@ -177,8 +177,7 @@
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx">         
</span><span class="cx">         $profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id );
</span><del>-        
-        return $profile_template-&gt;has_groups();
</del><ins>+        return apply_filters( 'bp_has_profile', $profile_template-&gt;has_groups(), $profile_template );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_profile_groups() { 
</span></span></pre>
</div>
</div>

</body>
</html>