<!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][7193] trunk: Introduces bp_activity_do_mentions(), a toggle for the activity mentions feature</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/7193">7193</a></dd>
<dt>Author</dt> <dd>boonebgorges</dd>
<dt>Date</dt> <dd>2013-06-09 14:04:36 +0000 (Sun, 09 Jun 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Introduces bp_activity_do_mentions(), a toggle for the activity mentions feature
Fixes <a href="http://buddypress.trac.wordpress.org/ticket/3388">#3388</a>
Props thebrandonallen</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivityactionsphp">trunk/bp-activity/bp-activity-actions.php</a></li>
<li><a href="#trunkbpactivitybpactivityfiltersphp">trunk/bp-activity/bp-activity-filters.php</a></li>
<li><a href="#trunkbpactivitybpactivityfunctionsphp">trunk/bp-activity/bp-activity-functions.php</a></li>
<li><a href="#trunkbpactivitybpactivityloaderphp">trunk/bp-activity/bp-activity-loader.php</a></li>
<li><a href="#trunkbpactivitybpactivityscreensphp">trunk/bp-activity/bp-activity-screens.php</a></li>
<li><a href="#trunkbpactivitybpactivitytemplatephp">trunk/bp-activity/bp-activity-template.php</a></li>
<li><a href="#trunkbptemplatesbplegacybuddypressactivityindexphp">trunk/bp-templates/bp-legacy/buddypress/activity/index.php</a></li>
<li><a href="#trunkbptemplatesbplegacybuddypressfunctionsphp">trunk/bp-templates/bp-legacy/buddypress-functions.php</a></li>
<li><a href="#trunkbpthemesbpdefaultactivityindexphp">trunk/bp-themes/bp-default/activity/index.php</a></li>
<li><a href="#trunkbpthemesbpdefaultfunctionsphp">trunk/bp-themes/bp-default/functions.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivityactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-actions.php (7192 => 7193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-actions.php 2013-06-09 13:39:07 UTC (rev 7192)
+++ trunk/bp-activity/bp-activity-actions.php 2013-06-09 14:04:36 UTC (rev 7193)
</span><span class="lines">@@ -534,6 +534,10 @@
</span><span class="cx"> function bp_activity_action_mentions_feed() {
</span><span class="cx"> global $wp_query;
</span><span class="cx">
</span><ins>+ if ( ! bp_activity_do_mentions() ) {
+ return false;
+ }
+
</ins><span class="cx"> if ( !bp_is_user_activity() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) )
</span><span class="cx"> return false;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpactivitybpactivityfiltersphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-filters.php (7192 => 7193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-filters.php 2013-06-09 13:39:07 UTC (rev 7192)
+++ trunk/bp-activity/bp-activity-filters.php 2013-06-09 14:04:36 UTC (rev 7193)
</span><span class="lines">@@ -208,6 +208,11 @@
</span><span class="cx"> */
</span><span class="cx"> function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
</span><span class="cx">
</span><ins>+ // Are mentions disabled?
+ if ( ! bp_activity_do_mentions() ) {
+ return $content;
+ }
+
</ins><span class="cx"> // Try to find mentions
</span><span class="cx"> $usernames = bp_activity_find_mentions( $content );
</span><span class="cx">
</span><span class="lines">@@ -237,6 +242,11 @@
</span><span class="cx"> * @uses bp_activity_find_mentions()
</span><span class="cx"> */
</span><span class="cx"> function bp_activity_at_name_filter_updates( $activity ) {
</span><ins>+ // Are mentions disabled?
+ if ( ! bp_activity_do_mentions() ) {
+ return;
+ }
+
</ins><span class="cx"> // If activity was marked as spam, stop the rest of this function.
</span><span class="cx"> if ( ! empty( $activity->is_spam ) )
</span><span class="cx"> return;
</span><span class="lines">@@ -271,6 +281,11 @@
</span><span class="cx"> * @uses bp_activity_update_mention_count_for_user()
</span><span class="cx"> */
</span><span class="cx"> function bp_activity_at_name_send_emails( $activity ) {
</span><ins>+ // Are mentions disabled?
+ if ( ! bp_activity_do_mentions() ) {
+ return;
+ }
+
</ins><span class="cx"> // If our temporary variable doesn't exist, stop now.
</span><span class="cx"> if ( empty( buddypress()->activity->mentioned_users ) )
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkbpactivitybpactivityfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-functions.php (7192 => 7193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-functions.php 2013-06-09 13:39:07 UTC (rev 7192)
+++ trunk/bp-activity/bp-activity-functions.php 2013-06-09 14:04:36 UTC (rev 7193)
</span><span class="lines">@@ -28,6 +28,30 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Are mentions enabled or disabled?
+ *
+ * The Mentions feature does a number of things, all of which will be turned
+ * off if you disable mentions:
+ * - Detecting and auto-linking @username in all BP/WP content
+ * - Sending BP notifications and emails to users when they are mentioned
+ * using the @username syntax
+ * - The Public Message button on user profiles
+ *
+ * Mentions are enabled by default. To disable, put the following line in
+ * bp-custom.php or your theme's functions.php file:
+ *
+ * add_filter( 'bp_activity_do_mentions', '__return_false' );
+ *
+ * @since BuddyPress (1.8)
+ *
+ * @uses apply_filters() To call 'bp_activity_do_mentions' hook.
+ * @return bool $retval True to enable mentions, false to disable.
+ */
+function bp_activity_do_mentions() {
+ return (bool) apply_filters( 'bp_activity_do_mentions', true );
+}
+
+/**
</ins><span class="cx"> * Searches through the content of an activity item to locate usernames,
</span><span class="cx"> * designated by an @ sign.
</span><span class="cx"> *
</span></span></pre></div>
<a id="trunkbpactivitybpactivityloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-loader.php (7192 => 7193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-loader.php 2013-06-09 13:39:07 UTC (rev 7192)
+++ trunk/bp-activity/bp-activity-loader.php 2013-06-09 14:04:36 UTC (rev 7193)
</span><span class="lines">@@ -150,15 +150,17 @@
</span><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> // @ mentions
</span><del>- $sub_nav[] = array(
- 'name' => __( 'Mentions', 'buddypress' ),
- 'slug' => 'mentions',
- 'parent_url' => $activity_link,
- 'parent_slug' => $this->slug,
- 'screen_function' => 'bp_activity_screen_mentions',
- 'position' => 20,
- 'item_css_id' => 'activity-mentions'
- );
</del><ins>+ if ( bp_activity_do_mentions() ) {
+ $sub_nav[] = array(
+ 'name' => __( 'Mentions', 'buddypress' ),
+ 'slug' => 'mentions',
+ 'parent_url' => $activity_link,
+ 'parent_slug' => $this->slug,
+ 'screen_function' => 'bp_activity_screen_mentions',
+ 'position' => 20,
+ 'item_css_id' => 'activity-mentions'
+ );
+ }
</ins><span class="cx">
</span><span class="cx"> // Favorite activity items
</span><span class="cx"> $sub_nav[] = array(
</span><span class="lines">@@ -228,11 +230,13 @@
</span><span class="cx"> $activity_link = trailingslashit( $user_domain . $this->slug );
</span><span class="cx">
</span><span class="cx"> // Unread message count
</span><del>- $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
- if ( !empty( $count ) ) {
- $title = sprintf( __( 'Mentions <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
- } else {
- $title = __( 'Mentions', 'buddypress' );
</del><ins>+ if ( bp_activity_do_mentions() ) {
+ $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
+ if ( !empty( $count ) ) {
+ $title = sprintf( __( 'Mentions <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
+ } else {
+ $title = __( 'Mentions', 'buddypress' );
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Add the "Activity" sub menu
</span><span class="lines">@@ -244,12 +248,14 @@
</span><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> // Mentions
</span><del>- $wp_admin_nav[] = array(
- 'parent' => 'my-account-' . $this->id,
- 'id' => 'my-account-' . $this->id . '-mentions',
- 'title' => $title,
- 'href' => trailingslashit( $activity_link . 'mentions' )
- );
</del><ins>+ if ( bp_activity_do_mentions() ) {
+ $wp_admin_nav[] = array(
+ 'parent' => 'my-account-' . $this->id,
+ 'id' => 'my-account-' . $this->id . '-mentions',
+ 'title' => $title,
+ 'href' => trailingslashit( $activity_link . 'mentions' )
+ );
+ }
</ins><span class="cx">
</span><span class="cx"> // Personal
</span><span class="cx"> $wp_admin_nav[] = array(
</span></span></pre></div>
<a id="trunkbpactivitybpactivityscreensphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-screens.php (7192 => 7193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-screens.php 2013-06-09 13:39:07 UTC (rev 7192)
+++ trunk/bp-activity/bp-activity-screens.php 2013-06-09 14:04:36 UTC (rev 7193)
</span><span class="lines">@@ -265,12 +265,18 @@
</span><span class="cx"> */
</span><span class="cx"> function bp_activity_screen_notification_settings() {
</span><span class="cx">
</span><del>- if ( !$mention = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_mention', true ) )
- $mention = 'yes';
</del><ins>+ if ( bp_activity_do_mentions() ) {
+ if ( ! $mention = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_mention', true ) ) {
+ $mention = 'yes';
+ }
+ }
</ins><span class="cx">
</span><del>- if ( !$reply = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_reply', true ) )
- $reply = 'yes'; ?>
</del><ins>+ if ( ! $reply = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_reply', true ) ) {
+ $reply = 'yes';
+ }
</ins><span class="cx">
</span><ins>+ ?>
+
</ins><span class="cx"> <table class="notification-settings" id="activity-notification-settings">
</span><span class="cx"> <thead>
</span><span class="cx"> <tr>
</span><span class="lines">@@ -282,12 +288,15 @@
</span><span class="cx"> </thead>
</span><span class="cx">
</span><span class="cx"> <tbody>
</span><del>- <tr id="activity-notification-settings-mentions">
- <td> </td>
- <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( bp_displayed_user_id() ) ) ?></td>
- <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php checked( $mention, 'yes', true ) ?>/></td>
- <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php checked( $mention, 'no', true ) ?>/></td>
- </tr>
</del><ins>+ <?php if ( bp_activity_do_mentions() ) : ?>
+ <tr id="activity-notification-settings-mentions">
+ <td> </td>
+ <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( bp_displayed_user_id() ) ) ?></td>
+ <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php checked( $mention, 'yes', true ) ?>/></td>
+ <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php checked( $mention, 'no', true ) ?>/></td>
+ </tr>
+ <?php endif; ?>
+
</ins><span class="cx"> <tr id="activity-notification-settings-replies">
</span><span class="cx"> <td> </td>
</span><span class="cx"> <td><?php _e( "A member replies to an update or comment you've posted", 'buddypress' ) ?></td>
</span></span></pre></div>
<a id="trunkbpactivitybpactivitytemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-template.php (7192 => 7193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-template.php 2013-06-09 13:39:07 UTC (rev 7192)
+++ trunk/bp-activity/bp-activity-template.php 2013-06-09 14:04:36 UTC (rev 7193)
</span><span class="lines">@@ -419,6 +419,11 @@
</span><span class="cx"> break;
</span><span class="cx"> case 'mentions':
</span><span class="cx">
</span><ins>+ // Are mentions disabled?
+ if ( ! bp_activity_do_mentions() ) {
+ return false;
+ }
+
</ins><span class="cx"> // Start search at @ symbol and stop search at closing tag delimiter.
</span><span class="cx"> $search_terms = '@' . bp_core_get_username( $user_id ) . '<';
</span><span class="cx"> $display_comments = 'stream';
</span><span class="lines">@@ -2798,7 +2803,7 @@
</span><span class="cx"> $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/feed/';
</span><span class="cx"> elseif ( 'favorites' == bp_current_action() )
</span><span class="cx"> $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
</span><del>- elseif ( 'mentions' == bp_current_action() )
</del><ins>+ elseif ( 'mentions' == bp_current_action() && bp_activity_do_mentions() )
</ins><span class="cx"> $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
</span><span class="cx"> else
</span><span class="cx"> $link = '';
</span></span></pre></div>
<a id="trunkbptemplatesbplegacybuddypressactivityindexphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-templates/bp-legacy/buddypress/activity/index.php (7192 => 7193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-templates/bp-legacy/buddypress/activity/index.php 2013-06-09 13:39:07 UTC (rev 7192)
+++ trunk/bp-templates/bp-legacy/buddypress/activity/index.php 2013-06-09 14:04:36 UTC (rev 7193)
</span><span class="lines">@@ -52,10 +52,14 @@
</span><span class="cx">
</span><span class="cx"> <?php endif; ?>
</span><span class="cx">
</span><del>- <?php do_action( 'bp_before_activity_type_tab_mentions' ); ?>
</del><ins>+ <?php if ( bp_activity_do_mentions() ) : ?>
</ins><span class="cx">
</span><del>- <li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/'; ?>" title="<?php _e( 'Activity that I have been mentioned in.', 'buddypress' ); ?>"><?php _e( 'Mentions', 'buddypress' ); ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><span><?php printf( _nx( '%s new', '%s new', bp_get_total_mention_count_for_user( bp_loggedin_user_id() ), 'Number of new activity mentions', 'buddypress' ), number_format_i18n( bp_get_total_mention_count_for_user( bp_loggedin_user_id() )) ); ?></span></strong><?php endif; ?></a></li>
</del><ins>+ <?php do_action( 'bp_before_activity_type_tab_mentions' ); ?>
</ins><span class="cx">
</span><ins>+ <li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/'; ?>" title="<?php _e( 'Activity that I have been mentioned in.', 'buddypress' ); ?>"><?php _e( 'Mentions', 'buddypress' ); ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><span><?php printf( _nx( '%s new', '%s new', bp_get_total_mention_count_for_user( bp_loggedin_user_id() ), 'Number of new activity mentions', 'buddypress' ), number_format_i18n( bp_get_total_mention_count_for_user( bp_loggedin_user_id() )) ); ?></span></strong><?php endif; ?></a></li>
+
+ <?php endif; ?>
+
</ins><span class="cx"> <?php endif; ?>
</span><span class="cx">
</span><span class="cx"> <?php do_action( 'bp_activity_type_tabs' ); ?>
</span></span></pre></div>
<a id="trunkbptemplatesbplegacybuddypressfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-templates/bp-legacy/buddypress-functions.php (7192 => 7193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-templates/bp-legacy/buddypress-functions.php 2013-06-09 13:39:07 UTC (rev 7192)
+++ trunk/bp-templates/bp-legacy/buddypress-functions.php 2013-06-09 14:04:36 UTC (rev 7193)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx"> add_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 );
</span><span class="cx">
</span><span class="cx"> // Activity button
</span><del>- if ( bp_is_active( 'activity' ) )
</del><ins>+ if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() )
</ins><span class="cx"> add_action( 'bp_member_header_actions', 'bp_send_public_message_button', 20 );
</span><span class="cx">
</span><span class="cx"> // Messages button
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultactivityindexphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/activity/index.php (7192 => 7193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/activity/index.php 2013-06-09 13:39:07 UTC (rev 7192)
+++ trunk/bp-themes/bp-default/activity/index.php 2013-06-09 14:04:36 UTC (rev 7193)
</span><span class="lines">@@ -72,10 +72,14 @@
</span><span class="cx">
</span><span class="cx"> <?php endif; ?>
</span><span class="cx">
</span><del>- <?php do_action( 'bp_before_activity_type_tab_mentions' ); ?>
</del><ins>+ <?php if ( bp_activity_do_mentions() ) : ?>
</ins><span class="cx">
</span><del>- <li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/'; ?>" title="<?php _e( 'Activity that I have been mentioned in.', 'buddypress' ); ?>"><?php _e( 'Mentions', 'buddypress' ); ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><span><?php printf( _nx( '%s new', '%s new', bp_get_total_mention_count_for_user( bp_loggedin_user_id() ), 'Number of new activity mentions', 'buddypress' ), bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ); ?></span></strong><?php endif; ?></a></li>
</del><ins>+ <?php do_action( 'bp_before_activity_type_tab_mentions' ); ?>
</ins><span class="cx">
</span><ins>+ <li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/'; ?>" title="<?php _e( 'Activity that I have been mentioned in.', 'buddypress' ); ?>"><?php _e( 'Mentions', 'buddypress' ); ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><span><?php printf( _nx( '%s new', '%s new', bp_get_total_mention_count_for_user( bp_loggedin_user_id() ), 'Number of new activity mentions', 'buddypress' ), bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ); ?></span></strong><?php endif; ?></a></li>
+
+ <?php endif; ?>
+
</ins><span class="cx"> <?php endif; ?>
</span><span class="cx">
</span><span class="cx"> <?php do_action( 'bp_activity_type_tabs' ); ?>
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/functions.php (7192 => 7193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/functions.php 2013-06-09 13:39:07 UTC (rev 7192)
+++ trunk/bp-themes/bp-default/functions.php 2013-06-09 14:04:36 UTC (rev 7193)
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx"> add_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 );
</span><span class="cx">
</span><span class="cx"> // Activity button
</span><del>- if ( bp_is_active( 'activity' ) )
</del><ins>+ if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() )
</ins><span class="cx"> add_action( 'bp_member_header_actions', 'bp_send_public_message_button', 20 );
</span><span class="cx">
</span><span class="cx"> // Messages button
</span></span></pre>
</div>
</div>
</body>
</html>