BuddyBoss Home – Web Support Forums Themes Boss. theme Global activity filter not working in single page

Viewing 7 posts - 1 through 7 (of 7 total)
  • Question

    #44703
    @surfbuddy

    The global activity filter to display updates only is working fine in the sitewide activity stream but not single page, specifically the members profile wall. I added this code in the child theme’s functions.php:

    //set activity default filter
    function bpfr_filtering_activity( $retval ) {
    global $bp;

    // activities to filter on, comma separated
    $retval[‘action’] = ‘activity_update’;

    return $retval;
    }
    add_filter( ‘bp_after_has_activities_parse_args’, ‘bpfr_filtering_activity’ );

    How do I filter the members profile wall to show updates only?

    Answers

    #44721
    @surfbuddy

    I’ve taken out global and it’s still not filtering updates only for member profile wall. Is there something overriding the personal activity loop?

    #44747

    Anonymous
    @

    Hi @surfied, Wall and Newsfeed are generated by BuddyBoss Wall plugin , they need plugin specific filter. I have created it, test them once and let me know if it works perfect

    
    function filter_wall_where(){
     global $bp;
     $user_id = $bp->displayed_user->id;
     $table = bp_core_get_table_prefix() . 'bp_activity';
     $where = "WHERE ( $table.user_id = $user_id AND $table.type = 'activity_update' )";
     return $where;
    }
    
    function filter_wall_mentions(){
     global $bp;
     $user_id = $bp->displayed_user->id;
     $user_filter = $bp->displayed_user->domain;
     $table = bp_core_get_table_prefix() . 'bp_activity';
     $mentions_modifier = "OR ( $table.content LIKE '%$user_filter%' AND $table.type = 'activity_update' ) ";
     return $mentions_modifier;
    }
    
    add_filter('buddyboss_wall_query_wall_activity_ids_where', 'filter_wall_where');
    add_filter('buddyboss_wall_query_wall_activity_ids_mentions', 'filter_wall_mentions');
    
    function filter_wall_feed_where(){
     global $bp;
     $user_id = $bp->displayed_user->id;
     if ( function_exists( 'friends_get_friend_user_ids' ) )
      {
       $user_ids = friends_get_friend_user_ids( $user_id, false, false );
      }
      else {
       $user_ids = array();
      }
     $user_list  = implode( ',', $user_ids );
     if ( empty( $user_list ) )
      {
       $user_list = 0;
      }
     $table = bp_core_get_table_prefix() . 'bp_activity';
     $where = "WHERE ( $table.user_id IN ($user_list) AND $table.type = 'activity_update' )";
     return $where;
    }
    
    add_filter('buddyboss_wall_query_feed_activity_ids_where', 'filter_wall_feed_where');
    

    Regards
    Varun Dubey

    #44783
    @surfbuddy

    Worked perfectly! Thank you @vapvarun!

    #44784

    Anonymous
    @

    🙂 glad to help, i will close this topic.

    Regards
    Varun Dubey

    #45726
    @surfbuddy

    Hi @vapvarun, sorry I know you were closing this, but I have a quick question. The code you provided above is displaying tagged updates (@mentions) posted by another member to the tagged member’s wall. How do I keep the wall to only display updates posted by that wall’s member?

    #45740

    Anonymous
    @

    Hi @surfied mentions can be part of post updates
    You can comment
    //add_filter(‘buddyboss_wall_query_wall_activity_ids_mentions’, ‘filter_wall_mentions’);

    That will work, and it will remove all mentions.
    Regards

Viewing 7 posts - 1 through 7 (of 7 total)
  • The question ‘Global activity filter not working in single page’ is closed to new replies.