Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide own profile


  • veshop
    Participant

    @veshop

    WordPress version 5.7.2
    BuddyPress version 8.0.0 (Legacy)

    My website is still not public, that’s why I don’t send a link, but you can view a sceenshot regarding the issue: https://gofile.io/d/bBBHNU

    When a user makes a member search, the first search result he gets is always his own profile. I might be weird, but when I want to search for OTHER members, I am not particularly keen on finding my own profile as a search result, since I already know me 😀 Anyway: How can I stop this nonsense? Is there a code snippet which I can use to ‘hide own profile’ or something?

Viewing 7 replies - 1 through 7 (of 7 total)

  • Nifty
    Participant

    @niftythree

    Hi @veshop,

    Which theme are you using?


    veshop
    Participant

    @veshop

    Hi @niftythree,

    using Gwangi, support is not always the most helpful though and as I might get help somewhere else faster, I am searching.


    Nifty
    Participant

    @niftythree

    Hi @veshop,

    You’re in luck. The Gwangi theme actually has the option to do exactly this in their latest version, so this should be a simple fix for you. Go to Appearance > Customise > BuddyPress > Members Directory > check the “Hide myself” box and Publish the change and you should be all done!

    Best of luck.


    veshop
    Participant

    @veshop

    Hello @niftythree,

    you made my day! 🙂 Never in a million years would I have found this by myself 😀 Thanks so much!

    Have a nice day!


    roman1wp
    Participant

    @roman1wp

    Support team, same question, theme Buddy X, ok I agree to see my profile in search, but in the settings of WordPress I indicated a nickname, but when viewing my profile, I see Login instead, there is one more question, now we will create a new topic …


    stephunique
    Participant

    @stephunique

    How can we hide ourselves in the BuddyX theme (the suggested answer is for Gwangi theme).


    Abhishek Saini
    Participant

    @abhishek6394

    If you want to hide currunt loggedin user from member directory you can easily use this code snippet.
    `function buddyx_exclude_users( $args ) {
    if ( is_admin() && ! defined( ‘DOING_AJAX’ ) ) {
    return $args;
    }

    $excluded = isset( $args[‘exclude’] ) ? $args[‘exclude’] : array();

    if ( ! is_array( $excluded ) ) {
    $excluded = explode( ‘,’, $excluded );
    }
    $user_id = bp_loggedin_user_id();

    $user_ids = array(‘user_id’ => $user_id); // user ids to exclude.

    $excluded = array_merge( $excluded, $user_ids );

    $args[‘exclude’] = $excluded;

    return $args;
    }

    add_filter( ‘bp_after_has_members_parse_args’, ‘buddyx_exclude_users’ );

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar