This topic has 10 replies, 4 voices, and was last updated 11 years by airsidworld.

  • Author
  • #8029
     Marcyboy
    Participant

    I’d like to hide members real names and only show members nicknames. I found this piece of code I placed in functions.php but it doesn’t work.

    /* Display Username in Directory */
    function kleo_member_username() {
    global $members_template;

    return $members_template->member->user_login;
    }
    add_filter(‘bp_member_name’,’kleo_member_username’);

    Could you tell me how to correct this please.

    #8033
     adam
    Participant
    #8052
     Marcyboy
    Participant

    This plugin works for the members directory but not the members profile page.

    #8105
     Abe
    Keymaster

    Hi, You can edit members/single/member-header.php and change bp_displayed_user_fullname with bp_displayed_user_username

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #8167
     Marcyboy
    Participant

    Hi Thanks for the reply. I have edited members/single/member-header.php and changed bp_displayed_user_fullname with bp_displayed_user_username which works OK for the members name above profile picture.

    But the members name is still displayed in the About Me section to the right of the profile picture.

    #8240
     Abe
    Keymaster

    Here is a topic that shows how to hide the name in the profile page: https://archived.seventhqueen.com/forums/topic/hide-fields-in-profile-accordion

    For the Tab next to the profile image you need to apply the same conditionals as above in this file: wp-content/themes/sweetdate/custom_buddypress/class-bp-tabs.php where you find bp_get_the_profile_field_name()

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #8459
     airsidworld
    Participant
    This reply has been set as private.
    #8532
     Abe
    Keymaster

    You can place the file in your child theme.
    The same condition to check for the name.You require basic php knowledge

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #8564
     airsidworld
    Participant
    This reply has been set as private.
    #8625
     Abe
    Keymaster

    Hi,
    I hope you understand that you need to hire a developer for customization purposes since this is not the scope of this forum to do customization for each user 🙂
    You need basic PHP knowledge if you want to change code.

    Anyway, for this one replace:

    COPY CODE
    
                                    $this->tabs_instance->fields_data[$name] .= '<dt>'. bp_get_the_profile_field_name().'</dt>';
                                    $this->tabs_instance->fields_data[$name] .= '<dd>'. bp_get_the_profile_field_value().'</dd>';
    

    with

    COPY CODE
    
     if (bp_get_the_profile_field_name() != "Name") {
                                    $this->tabs_instance->fields_data[$name] .= '<dt>'. bp_get_the_profile_field_name().'</dt>';
                                    $this->tabs_instance->fields_data[$name] .= '<dd>'. bp_get_the_profile_field_value().'</dd>';
    }
    

    and

    COPY CODE
    
                                    $this->tabs_instance->fields_data[$name] .= '<div class="callout"><div class="bp-profile-details">';
                                    $this->tabs_instance->fields_data[$name] .= bp_get_the_profile_field_name();
                                    $this->tabs_instance->fields_data[$name] .= '</div><div class="cite">'. bp_get_the_profile_field_value() .'</div></div>';
    

    with

    COPY CODE
    
     if (bp_get_the_profile_field_name() != "Name") {
                                    $this->tabs_instance->fields_data[$name] .= '<div class="callout"><div class="bp-profile-details">';
                                    $this->tabs_instance->fields_data[$name] .= bp_get_the_profile_field_name();
                                    $this->tabs_instance->fields_data[$name] .= '</div><div class="cite">'. bp_get_the_profile_field_value() .'</div></div>';
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #8639
     airsidworld
    Participant

    Ok thanks a lot for the code, i’ll try it ;).
    I understand for the customization, I just thought that hidding Full Name of users for privacy purpose would interest a lot of people, as it is usally done on dating website.

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?