Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Hide Specific Group Posts From Activity Stream
- **/
- add_filter( 'bp_activity_get_where_conditions', 'yzc_hide_specific_group_posts_from_activity_stream' );
- function yzc_hide_specific_group_posts_from_activity_stream( $where ) {
- // if is an admin show all activities.
- if ( is_super_admin( bp_loggedin_user_id() && bp_is_group() && bp_is_my_profile() ) ) {
- return $where;
- }
- // List Of Forbidden Groups ID's
- $forbidden_groups = array( 1 );
- // Add Where Statment.
- $where['hide_specific_groups'] = 'a.component = "groups" AND a.item_id NOT IN(' . implode( ',', $forbidden_groups ) . ')';
- return $where;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement