Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • balton129
    Participant

    @balton129

    Hi Bradley,

    To display group-specific posts on the dashboard while maintaining privacy, you can use a custom query to fetch activity from only the groups a user belongs to. Add the following to your theme’s functions.php:

    `php
    function bp_custom_dashboard_activity( $args ) {
    if ( is_user_logged_in() ) {
    $user_id = get_current_user_id();
    $group_ids = bp_get_user_groups( $user_id );
    if ( ! empty( $group_ids ) ) {
    $args[‘filter’][‘object’] = ‘groups’;
    $args[‘filter’][‘primary_id’] = $group_ids;
    }
    }
    return $args;
    }
    add_filter( ‘bp_after_has_activities_parse_args’, ‘bp_custom_dashboard_activity’ );
    `

    This ensures only posts from the user’s private or hidden groups show on their dashboard. For wiki articles, use group IDs as metadata to filter visibility. Test thoroughly to maintain privacy.

    Let me know if you need help refining this further!

Viewing 1 replies (of 1 total)
Skip to toolbar