Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide Activity tab in Profile / Disable @mentions


  • iburnthings
    Participant

    @iburnthings

    WP 4.0
    BP 2.1.1
    Xprofiles 2.0.2

    I need BP Activities module to be turned on for my rating plugin to work but I do not want the user profile to have the name displayed as @user

    I also want to disable the activity tab and make ‘profile’ or ‘reviews’ my default tab that displays on
    /members/user/

    I’ve found a few code solutions online and attempted to implement them but they were from older versions and didn’t work. (2010 was the post date on each see below)

    I’m getting more familiar with reviewing code and removing snippets, finding CSS, classes, functions etc but I’m still a novice.

    I tried this:
    http://premium.wpmudev.org/forums/topic/buddypress-social-remove-activity
    And

    How to Remove @mentions from BuddyPress

Viewing 1 replies (of 1 total)

  • danbp
    Participant

    @danbp

    Hi @iburnthings,

    Try this. Add the snippet to your child-theme functions.php or to bp-custom.php

    /* Remove @mention from profile header */
    function bpfr_remove_mention_from_profile() {	
    	
    	echo '<style> h2.user-nicename { display:none; } </style>';
    	
    	if( bp_is_user() && ! bp_get_member_user_id() ) {
            $user_id = 'displayed: '. bp_displayed_user_id();
        } else {
            $user_id = 'get_member_user: '. bp_get_member_user_id();
        }
    	
    	remove_filter( 'bp_get_displayed_user_mentionname', bp_activity_get_user_mentionname( bp_displayed_user_id() ) );
    	
    }
    add_filter( 'bp_get_displayed_user_mentionname', 'bpfr_remove_mention_from_profile' ); 

    To change the default landing tab, from (activity) to (profile), use this:

    /* Change BuddyPress default Members landing tab. */ 
    define('BP_DEFAULT_COMPONENT', 'profile' );
Viewing 1 replies (of 1 total)
  • The topic ‘Hide Activity tab in Profile / Disable @mentions’ is closed to new replies.
Skip to toolbar