Skip to:
Content
Pages
Categories
Search
Top
Bottom

All members tab / count

  • @johnhutchy2014

    Participant

    Hi all,

    Wordpress 4.0, BP 2.1.1

    I would like to hide / remove the all members tab and or its count on the members page, I found some code which I have pasted below, this works but also causes problems with my search form for searching for profiles within the directory! is there a way around this? thanks

    function bp_remove_allmembers_tab_js_script(){ ?>
    <script type=”text/javascript”>
    var jq = jQuery;

    jQuery(document).ready(function (jQuery) {
    jq(‘#members-all’).removeClass(‘selected’).hide();
    jq(‘#members-personal’).find(‘a’).trigger(‘click’);
    });
    </script>
    <?php }
    add_action(‘wp_footer’, ‘bp_remove_allmembers_tab_js_script’);

Viewing 2 replies - 1 through 2 (of 2 total)
  • @johnhutchy2014

    Participant

    Hi all,

    I have tried the following in BP core / template.php

    add_filter( ‘bp_get_total_member_count’, ‘bp_core_number_format’ );

    This simply provides a minus 1 figure rather than the true count, so not really what i’m looking for, I assume the minus 1 being returned is for the admin.

    Anyone had chance too look at this yet?

    Ta

    @shanebp

    Moderator

    Please use the code button to format code you paste into this forum.

    To remove the count…
    Assuming you aren’t using a language translation file, try this in your bp-custom.php file.

    function john_gettext( $translated, $original_text, $domain ) {
    
        if ( 'buddypress' !== $domain )  
               return $translated;
    
        switch ( $original_text ) {
            case 'All Members <span>%s</span>':
                return 'All Members';
    
            default:
                return $translated;
        }
    }
    add_filter( 'gettext', 'john_gettext', 20, 3 );
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘All members tab / count’ is closed to new replies.
Skip to toolbar