Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove all Profile / Member Links


  • OurWebMedia
    Participant

    @ourwebmedia

    Hello,

    I’d like to one of two ideas:

    1. Remove all links from usernames in Forums/Groups so they’re no longer linked to their accounts.

    2. Conditionally make usernames in Forums/Groups clickable only to a certain role (ie., Admin).

    Any insight on how to achieve this?

Viewing 1 replies (of 1 total)

  • shanebp
    Moderator

    @shanebp

    Find the template for each situation and follow the code.

    For example, for groups, create an overload of
    buddypress\bp-templates\bp-legacy\buddypress\groups\single\members.php

    In that file, remove the href on the avatar.
    Replace bp_group_member_link() with a call to a custom function that you write in bp-custom.php.
    In that function, add a check for the user’s role.

    Example, untested, return link only if member is an admin

    function ourweb_bp_group_member_link() {
       echo ourweb_bp_get_group_member_link();
    }
       function ourweb_bp_get_group_member_link() {
         global $members_template;
    
         if( is_super_admin( $members_template->member->user_id ) )
    	   return apply_filters( 'bp_get_group_member_link', '<a href="' . bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) . '">' . $members_template->member->display_name . '</a>' );
        else
    	   return $members_template->member->display_name;  
    	}
    
Viewing 1 replies (of 1 total)
  • The topic ‘Remove all Profile / Member Links’ is closed to new replies.
Skip to toolbar