Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_nav item values


  • erikshosting
    Member

    @erikshosting

    Hi,
    So, i’ve got my bp_nav customized in the order I want, only thing is there is one tab that i cant control. the ‘posts’ tab. I geuss its name value isnt ‘posts’ because attempting to rename it has no effect..
    I have this code working and can rename any of the other tabs.. but just not posts.. What is its value? Im totally stumped. The codex doesnt list its values..
    I want to do this:
    $bp->bp_nav = __( ‘new-name’, ‘buddypress’ );
    but i dont know what the properly value is! its not ‘posts’! Any ideas?

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

  • Boone Gorges
    Keymaster

    @boonebgorges

    How are you reordering bp_nav items to begin with? You might try putting the following code right after you call the global $bp:

    echo '

    ';
    print_r($bp->bp_nav);
    echo '

    ';

    That’ll show you all the items in bp_nav.


    erikshosting
    Member

    @erikshosting

    epic. I’m reordering the nav like so:

    function erocks_change_bp_tag_position()
    {
    global $bp;

    $bp->bp_nav = 10;
    $bp->bp_nav = 20;
    $bp->bp_nav = 30;
    $bp->bp_nav = 40;
    $bp->bp_nav = 50;
    $bp->bp_nav = 60;
    $bp->bp_nav = 70;
    $bp->bp_nav = 80;
    $bp->bp_nav = __( ‘My Profile’, ‘buddypress’ );
    $bp->bp_nav = __( ‘Gigs & Posts’, ‘buddypress’ );

    }
    add_action( ‘bp_init’, ‘erocks_change_bp_tag_position’ );

    inside my bp_custom admin bar plugin php file
    but the second one doesnt respond..


    erikshosting
    Member

    @erikshosting

    Thanks for your suggestions. I checked it out, and I have the name right. It looks like I am calling the posts tab correctly, but it is getting overridden somewhere else… lame


    Boone Gorges
    Keymaster

    @boonebgorges

    One thing you might try is making sure that your modifications get applied later in the process. Change your add_action line to

    add_action( ‘bp_init’, ‘erocks_change_bp_tag_position’, 999 );

    It’s a long shot, but it might work.


    erikshosting
    Member

    @erikshosting

    Yah, the 999 is good to remember, but it isnt helping here..

    so basically I figure that is getting written over. because when i change the name to anything else, it displays, but if i call it posts, it does nothing which makes me think its working properly, just getting overwritten down the way..

    So, basically I figure i’ll just do this:

    function erocks_change_bp_tag_position()
    {
    global $bp;

    $bp->bp_nav = 20;
    $bp->bp_nav = $current_user->user_login . ‘/posts’;
    $bp->bp_nav = __( ‘Gigs’, ‘buddypress’ );

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

    Basically this method works. but it doesnt register the slug… If I could get that sorted, I’d be set. any assistance would be appreciated


    erikshosting
    Member

    @erikshosting

    so $bp->bp_nav = (‘../posts’); changes the slug.. that takes care of that.
    only problem is. I need the menu to show up for logged out users as well.
    would this be wp_users_nav? if so i can’t seem to get the syntax of that down..


    erikshosting
    Member

    @erikshosting

    Anyway. Now that its all said and done. I’m still upset I cant affect the ‘posts’ bp_nav tab. I’ve got it down, I change the of any other tab and it works. just not the ‘posts’ tab.

    I have tried this in a /plugins/ file, a /mu-plugins/ file and the child theme functions… no luck.

    function erocks_change_bp_tag_position()
    {
    global $bp;

    $bp->bp_nav = 10;
    $bp->bp__nav = 20;
    $bp->bp_nav = 35;
    $bp->bp_nav = 40;
    $bp->bp_nav = 50;
    $bp->bp_nav = 60;
    $bp->bp_nav = 70;
    $bp->bp_nav = 80;
    }
    add_action( ‘bp_init’, ‘erocks_change_bp_tag_position’, 999 );

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘bp_nav item values’ is closed to new replies.
Skip to toolbar