Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: BP 1.2: How to add a custom tab on the Home activity section


MrMaz
Participant

@mrmaz

UPDATE:

The filtering has been consolidated and drastically improved as of revision 2580. Here is an updated example:

function my_activity_filter( $query_string, $object, $filter, $scope, $page, $search_terms, $extras ) {
global $bp;

if ( $object != 'activity' || $scope != 'myclass' || !is_user_logged_in() )
return $query_string;

$args = array();
parse_str( $query_string, $args );
$args['object'] = $bp->groups->id;
$args['primary_id'] = function_to_get_group_id_for_logged_in_user();

return http_build_query( $args );
}
add_filter( 'bp_dtheme_ajax_querystring', 'my_activity_filter', 1, 7 );

As you can see a TON more information about the request is being passed to the filtering, so you can more easily determine what you need to do to handle it properly.

Skip to toolbar