Skip to:
Content
Pages
Categories
Search
Top
Bottom

Menu Position not effecting bp_nav and bp_options_nav


  • Marcella
    Participant

    @marcella1981

    I was trying to change the position of items in bp_options_nav by doing something like..

    function px_bp_profile_nav() {
          global $bp; 
          // Change the order of menu items
          $bp->bp_nav['profile']['position'] = 0;
          $bp->bp_nav['activity']['position'] = 10;
          $bp->bp_nav['groups']['position'] = 20;
          $bp->bp_nav['blogs']['position'] = 30;
          $bp->bp_nav['messages']['position'] = 40;
          $bp->bp_nav['settings']['position'] = 50;
    }
     
    add_action('bp_setup_nav', 'px_bp_profile_nav', 1000);

    However I noticed the only item being affected was ‘profile’.

    I then did a bp_bump and the output is below.

    bp_nav: 
    ;Array
    (
        [activity] => Array
            (
                [name] => Activity
                [slug] => activity
                [link] => http://neoworx.wp/members/alistair/activity/
                [css_id] => activity
                [show_for_displayed_user] => 1
                [position] => 10
                [screen_function] => bp_activity_screen_my_activity
                [default_subnav_slug] => just-me
            )
        [collections] => Array
            (
                [name] => Collections 2
                [slug] => collections
                [link] => http://neoworx.wp/members/alistair/collections/
                [css_id] => groups
                [show_for_displayed_user] => 1
                [position] => 70
                [screen_function] => groups_screen_my_groups
                [default_subnav_slug] => my-groups
            )
        [profile] => Array
            (
                [name] => Profile
                [slug] => profile
                [link] => http://neoworx.wp/members/alistair/profile/
                [css_id] => xprofile
                [show_for_displayed_user] => 1
                [position] => 0
                [screen_function] => xprofile_screen_display_profile
                [default_subnav_slug] => public
            )
    )
    bp_options_nav: 
    ;Array
    (
        [activity] => Array
            (
                [just-me] => Array
                    (
                        [name] => Personal
                        [link] => http://neoworx.wp/members/alistair/activity/
                        [slug] => just-me
                        [css_id] => just-me
                        [position] => 10
                        [user_has_access] => 1
                        [screen_function] => bp_activity_screen_my_activity
                    )
                [mentions] => Array
                    (
                        [name] => Mentions
                        [link] => http://neoworx.wp/members/alistair/activity/mentions/
                        [slug] => mentions
                        [css_id] => activity-mentions
                        [position] => 20
                        [user_has_access] => 1
                        [screen_function] => bp_activity_screen_mentions
                    )
                [favorites] => Array
                    (
                        [name] => Favorites
                        [link] => http://neoworx.wp/members/alistair/activity/favorites/
                        [slug] => favorites
                        [css_id] => activity-favs
                        [position] => 30
                        [user_has_access] => 1
                        [screen_function] => bp_activity_screen_favorites
                    )
    
                [collections] => Array
                    (
                        [name] => Collections
                        [link] => http://neoworx.wp/members/alistair/activity/collections/
                        [slug] => collections
                        [css_id] => activity-groups
                        [position] => 50
                        [user_has_access] => 1
                        [screen_function] => bp_activity_screen_groups
                    )
            )
        [collections] => Array
            (
                [my-groups] => Array
                    (
                        [name] => Memberships
                        [link] => http://neoworx.wp/members/alistair/collections/
                        [slug] => my-groups
                        [css_id] => groups-my-groups
                        [position] => 10
                        [user_has_access] => 1
                        [screen_function] => groups_screen_my_groups
                    )
                [invites] => Array
                    (
                        [name] => Invitations
                        [link] => http://neoworx.wp/members/alistair/collections/invites/
                        [slug] => invites
                        [css_id] => invites
                        [position] => 30
                        [user_has_access] => 1
                        [screen_function] => groups_screen_group_invites
                    )
            )
        [profile] => Array
            (
                [public] => Array
                    (
                        [name] => View
                        [link] => http://neoworx.wp/members/alistair/profile/
                        [slug] => public
                        [css_id] => public
                        [position] => 10
                        [user_has_access] => 1
                        [screen_function] => xprofile_screen_display_profile
                    )
                [edit] => Array
                    (
                        [name] => Edit
                        [link] => http://neoworx.wp/members/alistair/profile/edit/
                        [slug] => edit
                        [css_id] => edit
                        [position] => 20
                        [user_has_access] => 1
                        [screen_function] => xprofile_screen_edit_profile
                    )
    
                [change-avatar] => Array
                    (
                        [name] => Change Avatar
                        [link] => http://neoworx.wp/members/alistair/profile/change-avatar/
                        [slug] => change-avatar
                        [css_id] => change-avatar
                        [position] => 30
                        [user_has_access] => 1
                        [screen_function] => xprofile_screen_change_avatar
                    )
            )
    )

    I notice 2 things here, 1 that residual data exists (I no longer call “Groups”, “Collections”) and it looks like this is still present.

    Also, there are only 3 items in bp_options_nav array. “activity”, “collections” and “profile”.

    I wonder if this is why the positions wont change with the initial efforts.

    Would anyone here know how to remedy this problem? It’s pretty frustrating.

Viewing 1 replies (of 1 total)

  • Marcella
    Participant

    @marcella1981

    *ignore*

    I redefined the slugs via

    define('BP_ACTIVITY_SLUG', 'activity' );

    My bad

Viewing 1 replies (of 1 total)
  • The topic ‘Menu Position not effecting bp_nav and bp_options_nav’ is closed to new replies.
Skip to toolbar