Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide some activity from activity page


  • heikesworld
    Participant

    @heikesworld

    Hello,

    I know this has been asked before and I followed the suggestion from this thread:
    https://buddypress.org/support/topic/block-activity-stream-types/

    and tried adding this code to my the child theme functions.php and to bp-custom.php:

    // Filter bbPress from updating activity stream
    function imath_activity_dont_save( $activity_object ) {
    $exclude = array( 'bbp_topic_create', 'bbp_reply_create',‘friendship_created’, ‘joined_group’, ‘updated_profile’, ‘updated_profile_photo’);
    
    // if the activity type is empty, it stops BuddyPress BP_Activity_Activity::save() function
    if( in_array( $activity_object->type, $exclude ) )
    $activity_object->type = false;
    
    }
    
    add_action(‘bp_activity_before_save’, ‘imath_activivity_dont_save’, 10, 1 );

    but it didn’t work, profile updates, profile photo updates, new friendships, forum topics and forum replies are still showing on the activity page 🙁
    What am I doing wrong?
    Thank you for your help.

Viewing 1 replies (of 1 total)

  • shanebp
    Moderator

    @shanebp

    That code should prevent new items from being saved.
    Try creating a new item in one of those categories and see if it is saved as an activity item.

    btw- in that code, all single quotes should be like this '
    Not like this or this

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar