Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding another Sublink Under Members/Groups?

  • @andrewteg

    Participant

    I have a need to add a page with something like Recommended groups based on a person’s location (which I have) and would like to add it as:

    buddypress/members/username/groups/join/

    so it would sit on the list with Memberships (buddypress/members/username/groups/) and Invitations (buddypress/members/username/groups/invites/) as a 3rd option for the logged in user like Invitations.

    I can’t find the right place to start to just add a skeleton to get into this part. Is this a Group Extension or a Member extension or where can I go to add something to that set?

    Thanks for any tips where to go,
    Andrew

Viewing 2 replies - 1 through 2 (of 2 total)
  • @r-a-y

    Keymaster

    Group Extension API only works for groups. Andrew is asking about member navigation.

    There is currently no member extension API.

    Check out the bp_core_new_nav_item() and bp_core_new_subnav_item() functions in bp-core/bp-core-buddybar.php:
    https://buddypress.trac.wordpress.org/browser/tags/2.6.0-rc1/src/bp-core/bp-core-buddybar.php?marks=15-38,369-399#L15

    You’d want to register your navs on the 'bp_setup_nav' hook.

    eg.

    function my_custom_bp_nav() {
    	// Fill this in from the documentation.
    	$nav_args = array();
    
    	// Add nav.
    	bp_core_new_nav_item( $nav_args );
    
    	// If you need to add another nav, copy and paste the block above and paste here.
    }
    add_action( 'bp_setup_nav', 'my_custom_bp_nav' );

    Check out this older example on the codex as well:
    https://codex.buddypress.org/developer/function-examples/core/bp_core_new_nav_item/

    Depending on your requirements, you could also use the BP Skeleton Component:
    https://github.com/boonebgorges/buddypress-skeleton-component

    However, that might be too much for what you need.

    @andrewteg

    Participant

    Thanks! This works great to create just what I needed. I’ll post some sample code for anyone interested when I have it cleaned up a bit more.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding another Sublink Under Members/Groups?’ is closed to new replies.
Skip to toolbar