• Resolved Tuomas Karhunen

    (@tuomas-karhunen)


    Hello,

    I’d simply like to disable the sender’s “has sent a compliment…” activity from being posted to the stream, while keeping the recipient’s “has received a compliment…” in the stream.

    Is there an easy way to do this? Tried to modify the ‘bp-compliments-activity.php’ file, but I’d need specific instructions…

    Love this plugin, btw!

    -Tuomas

    https://www.ads-software.com/plugins/buddypress-compliments/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there, Just add this code in your child theme functions.php file.

    Please note this code only work for new activity.

    function bp_comp_exclude_sent_activity( $activity_object ) {
        $exclude = array( 'compliment_sent');
    
    // 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', 'bp_comp_exclude_sent_activity', 10, 1 );

    Thread Starter Tuomas Karhunen

    (@tuomas-karhunen)

    Worked like a charm, thanks!

    Thanks also for a superb plugin, keep up the great work! ??

    T.

    Thanks Tuomas. It would be awesome if you write a review about our plugin here

    https://www.ads-software.com/support/view/plugin-reviews/buddypress-compliments

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Activity stream "sent / received" entries’ is closed to new replies.