bp_groups_get_activity_where_conditions( $where_conditions )

Filters the where condition to add private groups posts into user’s feed This filter supports bp_groups_filter_activity_scope function because we truncated the scope queries

Description

Parameters

$where_conditions

(Required)

Return

(mixed)

Source

File: bp-groups/bp-groups-activity.php

613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
function bp_groups_get_activity_where_conditions( $where_conditions ) {
 
    $by_pass_action = array( 'media_get_activity' );
 
    // Only for activity directory
    if (
        is_user_logged_in()
        && bp_is_activity_directory()
        && (
            empty( $_REQUEST['action'] )
            || ( ! in_array( $_REQUEST['action'], $by_pass_action )
            )
        )
    ) {
 
        // Determine groups of user.
        $groups = groups_get_user_groups( bp_loggedin_user_id() );
        if ( ! empty( $groups['groups'] ) ) {
            $groups                           = implode( ',', $groups['groups'] );
            $where_conditions['groups_scope'] = "a.component <> 'groups' OR ( a.component = 'groups' AND a.item_id IN ({$groups}) )";
        }
    }
 
    return $where_conditions;
}

Changelog

Changelog
Version Description
BuddyBoss 1.1.1 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.