Skip to:
Content
Pages
Categories
Search
Top
Bottom

hiding menu tabs in bp-custom file not working for loggedin user nav menu


  • jemmatates
    Participant

    @jemmatates

    In the bp-custom.php file I am using this code to hide selected user nav tabs:

    /* hide submenu tabs */
    function bp_remove_nav_tabs() {
    global $bp;
    $bp->bp_nav[‘activity’] = false;
    $bp->bp_nav[‘logout’] = false;
    $bp->bp_nav[‘orders’] = false;
    $bp->bp_nav[‘mediapress’] = false;
    $bp->bp_nav[‘settings’] = false;
    $bp->bp_nav[‘notifications’] = false;
    $bp->bp_nav[‘forums’] = false;

    }
    add_action( ‘bp_init’, ‘bp_remove_nav_tabs’, 999 );

    It is working for all the tabs except :

    logout and the first blank link

    The menu I am using is:

    <?php bp_get_loggedin_user_nav(); ?>

    I know how to get it working editing the :

    buddypress/bp-members/bp-members-template.php

    file in Buddypress but I would rather not edit core files.

    I am not a php coder just a front end css web designer, can anyone help me in fairly easy to understand / non php coder terms a way to fix this without editing the core file?

    Thanks!

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

  • Henry Wright
    Moderator

    @henrywright

    To make sure that last logout link is removed you should be able to do this:

    function jemmatates_logout_nav_link( $logout_link ) {
        $logout_link = '';
        return $logout_link;
    }
    add_filter( 'bp_logout_nav_link', 'jemmatates_logout_nav_link' );

    jemmatates
    Participant

    @jemmatates

    You’re an angel! Thank you this worked perfectly!

    Have you any idea how to do the same for this random first link that appears when using the :
    <?php bp_get_loggedin_user_nav(); ?>

    The code for the weird ‘blank’ link is this:

    <li id=”li-nav-“>

    I have tried hiding it myself using the code you posted tweaking it slightly to fit with the blank link but it didn’t work, probably cause I’m php stupid..

    Any help greatly appreciated!

    Thanks

    Jem


    jemmatates
    Participant

    @jemmatates

    It truncated the code I tried to show you, hopefully this will work:

    <li id="li-nav-">
    <a id="my-" href=""></a>
    </li>

    Henry Wright
    Moderator

    @henrywright

    You could hide that with CSS?

    #li-nav- {
        display: none;
    }

    jemmatates
    Participant

    @jemmatates

    Thank you this worked 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘hiding menu tabs in bp-custom file not working for loggedin user nav menu’ is closed to new replies.
Skip to toolbar