Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/09/2013 02:04:36 PM (12 years ago)
Author:
boonebgorges
Message:

Introduces bp_activity_do_mentions(), a toggle for the activity mentions feature

Fixes #3388

Props thebrandonallen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-loader.php

    r6734 r7193  
    151151
    152152        // @ mentions
    153         $sub_nav[] = array(
    154             'name'            => __( 'Mentions', 'buddypress' ),
    155             'slug'            => 'mentions',
    156             'parent_url'      => $activity_link,
    157             'parent_slug'     => $this->slug,
    158             'screen_function' => 'bp_activity_screen_mentions',
    159             'position'        => 20,
    160             'item_css_id'     => 'activity-mentions'
    161         );
     153        if ( bp_activity_do_mentions() ) {
     154            $sub_nav[] = array(
     155                'name'            => __( 'Mentions', 'buddypress' ),
     156                'slug'            => 'mentions',
     157                'parent_url'      => $activity_link,
     158                'parent_slug'     => $this->slug,
     159                'screen_function' => 'bp_activity_screen_mentions',
     160                'position'        => 20,
     161                'item_css_id'     => 'activity-mentions'
     162            );
     163        }
    162164
    163165        // Favorite activity items
     
    229231
    230232            // Unread message count
    231             $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
    232             if ( !empty( $count ) ) {
    233                 $title = sprintf( __( 'Mentions <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
    234             } else {
    235                 $title = __( 'Mentions', 'buddypress' );
     233            if ( bp_activity_do_mentions() ) {
     234                $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
     235                if ( !empty( $count ) ) {
     236                    $title = sprintf( __( 'Mentions <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
     237                } else {
     238                    $title = __( 'Mentions', 'buddypress' );
     239                }
    236240            }
    237241
     
    245249
    246250            // Mentions
    247             $wp_admin_nav[] = array(
    248                 'parent' => 'my-account-' . $this->id,
    249                 'id'     => 'my-account-' . $this->id . '-mentions',
    250                 'title'  => $title,
    251                 'href'   => trailingslashit( $activity_link . 'mentions' )
    252             );
     251            if ( bp_activity_do_mentions() ) {
     252                $wp_admin_nav[] = array(
     253                    'parent' => 'my-account-' . $this->id,
     254                    'id'     => 'my-account-' . $this->id . '-mentions',
     255                    'title'  => $title,
     256                    'href'   => trailingslashit( $activity_link . 'mentions' )
     257                );
     258            }
    253259
    254260            // Personal
Note: See TracChangeset for help on using the changeset viewer.