Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Add a new Tab

@r-a-y

Keymaster

“YOUR LINK” is the link you want to set. This is only useful if you want to link to a new page (like your new forum loop) and you don’t want to use AJAX.

However, it seems like you want to use AJAX, so you’ll have to manipulate the AJAX querystring so BuddyPress knows how to load your new custom forum loop. If you go this route, remember to remove the “no-ajax” CSS class from your tab.

The way you name your tab class is important.

In the example above, “forums-newtab”, BP’s AJAX will see “newtab” as the forum’s scope. You’ll then need to manipulate the AJAX querystring to add your forum IDs only when the forum scope is set to “newtab”.

Check out the bp_dtheme_ajax_querystring() in /bp-default/_inc/ajax.php and try to analyze lines 43-50. See how when the scope is set to “personal” that BP changes the `user_id`. You’ll need to do something similar with the `forum_id` parameter when the `scope` is set to “newtab” and when the `object` is set to “forums”.

Once you get a grasp of this, then you can write your filter to do your manipulation.

Skip to toolbar