<!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][8428] trunk/src: Introduce bp_activity_show_filters(), and use it for generating dynamic activity filter dropdowns</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">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/8428">8428</a></dd>
<dt>Author</dt> <dd>boonebgorges</dd>
<dt>Date</dt> <dd>2014-05-16 13:05:35 +0000 (Fri, 16 May 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Introduce bp_activity_show_filters(), and use it for generating dynamic activity filter dropdowns
Activity filter dropdowns were previously hardcoded into templates, with
template-specific hooks for plugins to add their own filter values. This
resulted in an inconsistent and awkward process of maintaining filter lists
between components. The new method introduces new parameters to bp_activity_set_action():
$context (an array of the contexts in which the filter should appear) and
$label (the text that should be used when generating the <option> markup). The
new function bp_activity_show_filter() is then used in the templates to
generate a dynamic list of <option> markup, based on the values registered by
the activity types.
Fixes <a href="http://buddypress.trac.wordpress.org/ticket/5637">#5637</a>
Props imath</pre>
<h3>Modified Paths</h3>
<ul>
<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>
<li><a href="#trunksrcbpblogsbpblogsactivityphp">trunk/src/bp-blogs/bp-blogs-activity.php</a></li>
<li><a href="#trunksrcbpfriendsbpfriendsactivityphp">trunk/src/bp-friends/bp-friends-activity.php</a></li>
<li><a href="#trunksrcbpgroupsbpgroupsactivityphp">trunk/src/bp-groups/bp-groups-activity.php</a></li>
<li><a href="#trunksrcbptemplatesbplegacybuddypressactivityindexphp">trunk/src/bp-templates/bp-legacy/buddypress/activity/index.php</a></li>
<li><a href="#trunksrcbptemplatesbplegacybuddypressgroupssingleactivityphp">trunk/src/bp-templates/bp-legacy/buddypress/groups/single/activity.php</a></li>
<li><a href="#trunksrcbptemplatesbplegacybuddypressmemberssingleactivityphp">trunk/src/bp-templates/bp-legacy/buddypress/members/single/activity.php</a></li>
<li><a href="#trunksrcbpxprofilebpxprofileactivityphp">trunk/src/bp-xprofile/bp-xprofile-activity.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpactivitybpactivityfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/bp-activity/bp-activity-functions.php (8427 => 8428)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/bp-activity/bp-activity-functions.php 2014-05-16 10:42:09 UTC (rev 8427)
+++ trunk/src/bp-activity/bp-activity-functions.php 2014-05-16 13:05:35 UTC (rev 8428)
</span><span class="lines">@@ -275,9 +275,13 @@
</span><span class="cx"> * @param string $type The action type.
</span><span class="cx"> * @param string $description The action description.
</span><span class="cx"> * @param callable $format_callback Callback for formatting the action string.
</span><ins>+ * @param string $label String to describe this action in the activity stream
+ * filter dropdown.
+ * @param array $context Activity stream contexts where the filter should appear.
+ * 'activity', 'member', 'member_groups', 'group'
</ins><span class="cx"> * @return bool False if any param is empty, otherwise true.
</span><span class="cx"> */
</span><del>-function bp_activity_set_action( $component_id, $type, $description, $format_callback = false ) {
</del><ins>+function bp_activity_set_action( $component_id, $type, $description, $format_callback = false, $label = false, $context = array() ) {
</ins><span class="cx"> $bp = buddypress();
</span><span class="cx">
</span><span class="cx"> // Return false if any of the above values are not set
</span><span class="lines">@@ -303,7 +307,9 @@
</span><span class="cx"> 'key' => $type,
</span><span class="cx"> 'value' => $description,
</span><span class="cx"> 'format_callback' => $format_callback,
</span><del>- ), $component_id, $type, $description, $format_callback );
</del><ins>+ 'label' => $label,
+ 'context' => $context,
+ ), $component_id, $type, $description, $format_callback, $label, $context );
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -835,14 +841,17 @@
</span><span class="cx"> $bp->activity->id,
</span><span class="cx"> 'activity_update',
</span><span class="cx"> __( 'Posted a status update', 'buddypress' ),
</span><del>- 'bp_activity_format_activity_action_activity_update'
</del><ins>+ 'bp_activity_format_activity_action_activity_update',
+ __( 'Updates', 'buddypress' ),
+ array( 'activity', 'group', 'member', 'member_groups' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> bp_activity_set_action(
</span><span class="cx"> $bp->activity->id,
</span><span class="cx"> 'activity_comment',
</span><span class="cx"> __( 'Replied to a status update', 'buddypress' ),
</span><del>- 'bp_activity_format_activity_action_activity_comment'
</del><ins>+ 'bp_activity_format_activity_action_activity_comment',
+ __( 'Activity Comments', 'buddypress' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> do_action( 'bp_activity_register_activity_actions' );
</span></span></pre></div>
<a id="trunksrcbpactivitybpactivitytemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/bp-activity/bp-activity-template.php (8427 => 8428)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/bp-activity/bp-activity-template.php 2014-05-16 10:42:09 UTC (rev 8427)
+++ trunk/src/bp-activity/bp-activity-template.php 2014-05-16 13:05:35 UTC (rev 8428)
</span><span class="lines">@@ -3371,3 +3371,88 @@
</span><span class="cx"> <?php
</span><span class="cx"> }
</span><span class="cx"> add_action( 'bp_head', 'bp_activity_sitewide_feed' );
</span><ins>+
+/**
+ * Display available filters depending on the scope.
+ *
+ * @since BuddyPress (2.1.0)
+ *
+ * @param string $context The current context. 'activity', 'member',
+ * 'member_groups', 'group'.
+ * @uses bp_get_activity_show_filters()
+ */
+function bp_activity_show_filters( $context = '' ) {
+ echo bp_get_activity_show_filters( $context );
+}
+ /**
+ * Get available filters depending on the scope.
+ *
+ * @since BuddyPress (2.1.0)
+ *
+ * @param string $context The current context. 'activity', 'member',
+ * 'member_groups', 'group'
+ * @return string HTML for <option> values.
+ */
+ function bp_get_activity_show_filters( $context = '' ) {
+ // Set default context based on current page
+ if ( empty( $context ) ) {
+ if ( bp_is_user() ) {
+ switch ( bp_current_action() ) {
+ case bp_get_groups_slug() :
+ $context = 'member_groups';
+ break;
+
+ default :
+ $context = 'member';
+ break;
+ }
+ } else if ( bp_is_active( 'groups' ) && bp_is_group() ) {
+ $context = 'group';
+ } else {
+ $context = 'activity';
+ }
+ }
+
+ $filters = array();
+
+ // Walk through the registered actions, and prepare an the
+ // select box options.
+ foreach ( buddypress()->activity->actions as $actions ) {
+ foreach ( $actions as $action ) {
+ if ( ! in_array( $context, (array) $action['context'] ) ) {
+ continue;
+ }
+
+ // Friends activity collapses two filters into one
+ if ( in_array( $action['key'], array( 'friendship_accepted', 'friendship_created' ) ) ) {
+ $action['key'] = 'friendship_accepted,friendship_created';
+ }
+
+ $filters[ $action['key'] ] = $action['label'];
+ }
+ }
+
+ /**
+ * Modify the filter options available in the activity filter dropdown.
+ *
+ * @since BuddyPress (2.1.0)
+ *
+ * @param array $filters Array of filter options for the given
+ * context, in the following format:
+ * $option_value => $option_name
+ * @param string $context Context for the filter. 'activity'
+ * 'member', 'member_groups', 'group'.
+ */
+ $filters = apply_filters( 'bp_get_activity_show_filters', $filters, $context );
+
+ // Build the options output
+ $output = '';
+
+ if ( ! empty( $filters ) ) {
+ foreach ( $filters as $value => $filter ) {
+ $output .= '<option value="' . esc_attr( $value ) . '">' . esc_html( $filter ) . '</option>' . "\n";
+ }
+ }
+
+ return apply_filters( 'bp_get_activity_show_filters', $output, $filters, $context );
+ }
</ins></span></pre></div>
<a id="trunksrcbpblogsbpblogsactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/src/bp-blogs/bp-blogs-activity.php (8427 => 8428)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/bp-blogs/bp-blogs-activity.php 2014-05-16 10:42:09 UTC (rev 8427)
+++ trunk/src/bp-blogs/bp-blogs-activity.php 2014-05-16 13:05:35 UTC (rev 8428)
</span><span class="lines">@@ -32,7 +32,8 @@
</span><span class="cx"> $bp->blogs->id,
</span><span class="cx"> 'new_blog',
</span><span class="cx"> __( 'New site created', 'buddypress' ),
</span><del>- 'bp_blogs_format_activity_action_new_blog'
</del><ins>+ 'bp_blogs_format_activity_action_new_blog',
+ __( 'New Sites', 'buddypress' )
</ins><span class="cx"> );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -40,14 +41,18 @@
</span><span class="cx"> $bp->blogs->id,
</span><span class="cx"> 'new_blog_post',
</span><span class="cx"> __( 'New post published', 'buddypress' ),
</span><del>- 'bp_blogs_format_activity_action_new_blog_post'
</del><ins>+ 'bp_blogs_format_activity_action_new_blog_post',
+ __( 'Posts', 'buddypress' ),
+ array( 'activity', 'member' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> bp_activity_set_action(
</span><span class="cx"> $bp->blogs->id,
</span><span class="cx"> 'new_blog_comment',
</span><span class="cx"> __( 'New post comment posted', 'buddypress' ),
</span><del>- 'bp_blogs_format_activity_action_new_blog_comment'
</del><ins>+ 'bp_blogs_format_activity_action_new_blog_comment',
+ __( 'Comments', 'buddypress' ),
+ array( 'activity', 'member' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> do_action( 'bp_blogs_register_activity_actions' );
</span></span></pre></div>
<a id="trunksrcbpfriendsbpfriendsactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/src/bp-friends/bp-friends-activity.php (8427 => 8428)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/bp-friends/bp-friends-activity.php 2014-05-16 10:42:09 UTC (rev 8427)
+++ trunk/src/bp-friends/bp-friends-activity.php 2014-05-16 13:05:35 UTC (rev 8428)
</span><span class="lines">@@ -96,14 +96,18 @@
</span><span class="cx"> $bp->friends->id,
</span><span class="cx"> 'friendship_accepted',
</span><span class="cx"> __( 'Friendships accepted', 'buddypress' ),
</span><del>- 'bp_friends_format_activity_action_friendship_accepted'
</del><ins>+ 'bp_friends_format_activity_action_friendship_accepted',
+ __( 'Friendships', 'buddypress' ),
+ array( 'activity', 'member' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> bp_activity_set_action(
</span><span class="cx"> $bp->friends->id,
</span><span class="cx"> 'friendship_created',
</span><span class="cx"> __( 'New friendships', 'buddypress' ),
</span><del>- 'bp_friends_format_activity_action_friendship_created'
</del><ins>+ 'bp_friends_format_activity_action_friendship_created',
+ __( 'Friendships', 'buddypress' ),
+ array( 'activity', 'member' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> // < BP 1.6 backpat
</span></span></pre></div>
<a id="trunksrcbpgroupsbpgroupsactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/src/bp-groups/bp-groups-activity.php (8427 => 8428)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/bp-groups/bp-groups-activity.php 2014-05-16 10:42:09 UTC (rev 8427)
+++ trunk/src/bp-groups/bp-groups-activity.php 2014-05-16 13:05:35 UTC (rev 8428)
</span><span class="lines">@@ -27,22 +27,41 @@
</span><span class="cx"> $bp->groups->id,
</span><span class="cx"> 'created_group',
</span><span class="cx"> __( 'Created a group', 'buddypress' ),
</span><del>- 'bp_groups_format_activity_action_created_group'
</del><ins>+ 'bp_groups_format_activity_action_created_group',
+ __( 'New Groups', 'buddypress' ),
+ array( 'activity', 'member', 'member_groups' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> bp_activity_set_action(
</span><span class="cx"> $bp->groups->id,
</span><span class="cx"> 'joined_group',
</span><span class="cx"> __( 'Joined a group', 'buddypress' ),
</span><del>- 'bp_groups_format_activity_action_joined_group'
</del><ins>+ 'bp_groups_format_activity_action_joined_group',
+ __( 'Group Memberships', 'buddypress' ),
+ array( 'activity', 'group', 'member', 'member_groups' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> // These actions are for the legacy forums
</span><span class="cx"> // Since the bbPress plugin also shares the same 'forums' identifier, we also
</span><span class="cx"> // check for the legacy forums loader class to be extra cautious
</span><span class="cx"> if ( bp_is_active( 'forums' ) && class_exists( 'BP_Forums_Component' ) ) {
</span><del>- bp_activity_set_action( $bp->groups->id, 'new_forum_topic', __( 'New group forum topic', 'buddypress' ) );
- bp_activity_set_action( $bp->groups->id, 'new_forum_post', __( 'New group forum post', 'buddypress' ) );
</del><ins>+ bp_activity_set_action(
+ $bp->groups->id,
+ 'new_forum_topic',
+ __( 'New group forum topic', 'buddypress' ),
+ false,
+ __( 'Forum Topics', 'buddypress' ),
+ array( 'activity', 'group', 'member', 'member_groups' )
+ );
+
+ bp_activity_set_action(
+ $bp->groups->id,
+ 'new_forum_post',
+ __( 'New group forum post', 'buddypress' ),
+ false,
+ __( 'Forum Replies', 'buddypress' ),
+ array( 'activity', 'group', 'member', 'member_groups' )
+ );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> do_action( 'groups_register_activity_actions' );
</span></span></pre></div>
<a id="trunksrcbptemplatesbplegacybuddypressactivityindexphp"></a>
<div class="modfile"><h4>Modified: trunk/src/bp-templates/bp-legacy/buddypress/activity/index.php (8427 => 8428)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/bp-templates/bp-legacy/buddypress/activity/index.php 2014-05-16 10:42:09 UTC (rev 8427)
+++ trunk/src/bp-templates/bp-legacy/buddypress/activity/index.php 2014-05-16 13:05:35 UTC (rev 8428)
</span><span class="lines">@@ -76,37 +76,9 @@
</span><span class="cx"> <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
</span><span class="cx"> <select id="activity-filter-by">
</span><span class="cx"> <option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option>
</span><del>- <option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option>
</del><span class="cx">
</span><del>- <?php if ( bp_is_active( 'blogs' ) ) : ?>
</del><ins>+ <?php bp_activity_show_filters(); ?>
</ins><span class="cx">
</span><del>- <option value="new_blog_post"><?php _e( 'Posts', 'buddypress' ); ?></option>
- <option value="new_blog_comment"><?php _e( 'Comments', 'buddypress' ); ?></option>
-
- <?php endif; ?>
-
- <?php if ( bp_is_active( 'forums' ) ) : ?>
-
- <option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option>
- <option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option>
-
- <?php endif; ?>
-
- <?php if ( bp_is_active( 'groups' ) ) : ?>
-
- <option value="created_group"><?php _e( 'New Groups', 'buddypress' ); ?></option>
- <option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option>
-
- <?php endif; ?>
-
- <?php if ( bp_is_active( 'friends' ) ) : ?>
-
- <option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ); ?></option>
-
- <?php endif; ?>
-
- <option value="new_member"><?php _e( 'New Members', 'buddypress' ); ?></option>
-
</del><span class="cx"> <?php do_action( 'bp_activity_filter_options' ); ?>
</span><span class="cx">
</span><span class="cx"> </select>
</span></span></pre></div>
<a id="trunksrcbptemplatesbplegacybuddypressgroupssingleactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/src/bp-templates/bp-legacy/buddypress/groups/single/activity.php (8427 => 8428)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/bp-templates/bp-legacy/buddypress/groups/single/activity.php 2014-05-16 10:42:09 UTC (rev 8427)
+++ trunk/src/bp-templates/bp-legacy/buddypress/groups/single/activity.php 2014-05-16 13:05:35 UTC (rev 8428)
</span><span class="lines">@@ -5,18 +5,12 @@
</span><span class="cx"> <?php do_action( 'bp_group_activity_syndication_options' ); ?>
</span><span class="cx">
</span><span class="cx"> <li id="activity-filter-select" class="last">
</span><del>- <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
</del><ins>+ <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
</ins><span class="cx"> <select id="activity-filter-by">
</span><span class="cx"> <option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option>
</span><del>- <option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option>
</del><span class="cx">
</span><del>- <?php if ( bp_is_active( 'forums' ) ) : ?>
- <option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option>
- <option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option>
- <?php endif; ?>
</del><ins>+ <?php bp_activity_show_filters( 'group' ); ?>
</ins><span class="cx">
</span><del>- <option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option>
-
</del><span class="cx"> <?php do_action( 'bp_group_activity_filter_options' ); ?>
</span><span class="cx"> </select>
</span><span class="cx"> </li>
</span></span></pre></div>
<a id="trunksrcbptemplatesbplegacybuddypressmemberssingleactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/src/bp-templates/bp-legacy/buddypress/members/single/activity.php (8427 => 8428)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/bp-templates/bp-legacy/buddypress/members/single/activity.php 2014-05-16 10:42:09 UTC (rev 8427)
+++ trunk/src/bp-templates/bp-legacy/buddypress/members/single/activity.php 2014-05-16 13:05:35 UTC (rev 8428)
</span><span class="lines">@@ -18,42 +18,11 @@
</span><span class="cx"> <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
</span><span class="cx"> <select id="activity-filter-by">
</span><span class="cx"> <option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option>
</span><del>- <option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option>
</del><span class="cx">
</span><del>- <?php
- if ( !bp_is_current_action( 'groups' ) ) :
- if ( bp_is_active( 'blogs' ) ) : ?>
</del><ins>+ <?php bp_activity_show_filters(); ?>
</ins><span class="cx">
</span><del>- <option value="new_blog_post"><?php _e( 'Posts', 'buddypress' ); ?></option>
- <option value="new_blog_comment"><?php _e( 'Comments', 'buddypress' ); ?></option>
</del><ins>+ <?php do_action( 'bp_member_activity_filter_options' ); ?>
</ins><span class="cx">
</span><del>- <?php
- endif;
-
- if ( bp_is_active( 'friends' ) ) : ?>
-
- <option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ); ?></option>
-
- <?php endif;
-
- endif;
-
- if ( bp_is_active( 'forums' ) ) : ?>
-
- <option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option>
- <option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option>
-
- <?php endif;
-
- if ( bp_is_active( 'groups' ) ) : ?>
-
- <option value="created_group"><?php _e( 'New Groups', 'buddypress' ); ?></option>
- <option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option>
-
- <?php endif;
-
- do_action( 'bp_member_activity_filter_options' ); ?>
-
</del><span class="cx"> </select>
</span><span class="cx"> </li>
</span><span class="cx"> </ul>
</span></span></pre></div>
<a id="trunksrcbpxprofilebpxprofileactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/src/bp-xprofile/bp-xprofile-activity.php (8427 => 8428)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/bp-xprofile/bp-xprofile-activity.php 2014-05-16 10:42:09 UTC (rev 8427)
+++ trunk/src/bp-xprofile/bp-xprofile-activity.php 2014-05-16 13:05:35 UTC (rev 8428)
</span><span class="lines">@@ -21,24 +21,28 @@
</span><span class="cx"> // older avatar activity items use 'profile' for component
</span><span class="cx"> // see r4273
</span><span class="cx"> 'profile',
</span><del>-
</del><span class="cx"> 'new_avatar',
</span><span class="cx"> __( 'Member changed profile picture', 'buddypress' ),
</span><del>- 'bp_xprofile_format_activity_action_new_avatar'
</del><ins>+ 'bp_xprofile_format_activity_action_new_avatar',
+ __( 'Updated Avatars', 'buddypress' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> bp_activity_set_action(
</span><span class="cx"> $bp->profile->id,
</span><span class="cx"> 'new_member',
</span><span class="cx"> __( 'New member registered', 'buddypress' ),
</span><del>- 'bp_xprofile_format_activity_action_new_member'
</del><ins>+ 'bp_xprofile_format_activity_action_new_member',
+ __( 'New Members', 'buddypress' ),
+ array( 'activity' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> bp_activity_set_action(
</span><span class="cx"> $bp->profile->id,
</span><span class="cx"> 'updated_profile',
</span><span class="cx"> __( 'Updated Profile', 'buddypress' ),
</span><del>- 'bp_xprofile_format_activity_action_updated_profile'
</del><ins>+ 'bp_xprofile_format_activity_action_updated_profile',
+ __( 'Profile Updates', 'buddypress' ),
+ array( 'activity' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> do_action( 'xprofile_register_activity_actions' );
</span><span class="lines">@@ -309,6 +313,7 @@
</span><span class="cx"> * Add filters for xprofile activity types to Show dropdowns.
</span><span class="cx"> *
</span><span class="cx"> * @since BuddyPress (2.0.0)
</span><ins>+ * @todo Mark as deprecated
</ins><span class="cx"> */
</span><span class="cx"> function xprofile_activity_filter_options() {
</span><span class="cx"> ?>
</span><span class="lines">@@ -317,4 +322,3 @@
</span><span class="cx">
</span><span class="cx"> <?php
</span><span class="cx"> }
</span><del>-add_action( 'bp_activity_filter_options', 'xprofile_activity_filter_options' );
</del></span></pre>
</div>
</div>
</body>
</html>