Skip to:
Content
Pages
Categories
Search
Top
Bottom

$bp->members->nav is empty


  • kevinbrands
    Participant

    @kevinbrands

    Hello,

    I was using $bp->members->nav to retrieve menu items for a logged in user. But somehow this now returns an empty object.

    Has something changed that I did not notice? Or could something else be wrong?

    Hope to hear from you!
    -Kevin

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

  • kevinbrands
    Participant

    @kevinbrands

    Maybe I should elaborate some more on the issue:

    It is happening on a multisite environment

    The ‘username’ part is missing from the URL’s that should point to a specific page in the users profile. Therefore dynamic links are not working for us.

    For example:
    The link should be: https://website.com/members/%5Busername%5D/profile
    But instead we get: https://website.com/members/profile


    shanebp
    Moderator

    @shanebp

    If you only need a dynamic link for the current user, then use ‘me’.
    For example: http://yoursite.com/members/me/
    Example url to profile edit: http://yoursite.com/members/me/profile/edit/group/1/


    kevinbrands
    Participant

    @kevinbrands

    I’m using a lot of the links that are stored in the nav component. The user was in those links automatically. And that was the username.

    I wasn’t aware that it would also work with the ‘me’ part in it instead of the username.

    I want to make this as automatically as possible. Is there a way to retrieve the links from the nav component automatically with ‘me’ in it? Or is there a way to make it that way?


    shanebp
    Moderator

    @shanebp

    This will show the profile nav menus for the current user:

    function check_nav_menus() {
    	$bp    = buddypress();
    	$menus = $bp->members->nav->get_item_nav();
    	var_dump($menus);
    }
    add_action( 'bp_ready', 'check_nav_menus' );

    rodgerhs
    Participant

    @rodgerhs

    I am trying to set a menu item for Group Edit Details.

    But it has to be Dynamic of course.

    How I do this??

    https://holosports.pro/groups/ ????? /admin/edit-details/

    Like the ME but for groups?
    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar