Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hiding a member

  • Avatar of Chad Holden
    Chad Holden
    Participant

    @holdench

    I want to hide a specific member from everyone. It’s the member I used to create the admin for the forums. Name is forumadmin, so that doesn’t make much sense on a listing of hotels.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Interesting question. I have not heard of an way to do this, but it should be possible with some behind the scenes coding.

    Have you checked the WPMU or bbPress plugin repositories to see if such a plugin exists?

    Avatar of invertedsphere
    invertedsphere
    Participant

    @invertedsphere

    I have a solution:

    You need to edit the buddypress members loop file located probably at /wp-content/themes/bp-themes/bp-sn-parent/directories/members/members-loop.php

    Find the members loop and make it look something like this:

    <?php while ( bp_site_members() ) : bp_the_site_member(); ?>

    <?php // put member name into variable

    ob_start();

    bp_the_site_member_name();

    $excluded_user = ob_get_contents();

    ob_end_clean();

    ?>

    <?php if($excluded_user != ‘name of user goes here’) { ?>

    // ORIGINAL CONTENTS OF LOOP GO HERE

    <?php } // end if $excluded_user !=… ?>

    <?php endwhile; ?>

    Note that this will compare the name that the user entered in their profile, not to be confused with the login name. It would probably be best to give the user a complex name that nobody else would likely use so that you don’t accidentally hide unsuspecting users. Maybe you can figure out how to get the actual login name though.

    Good luck to all

    Avatar of trivikrama
    Trivikrama
    Member

    @trivikrama

    When I copied the code above it displayed an error like undefined function bp_site_members();

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

You must be logged in to reply to this topic.