WordPress and buddypress programming

hide blog posts from buddypress activity stream

Tagged: 

Viewing 0 reply threads
  • Author
    Posts
    • #731
      Michael Mc
      Keymaster
      @mkmcst
      //Block certain activity types from being added
      function bp_activity_dont_save( $activity_object ) {
          $exclude = array(
              'new_blog_comment',
              'new_blog_post'
          );
      
          // 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_activity_dont_save', 10, 1 );
Viewing 0 reply threads
  • You must be logged in to reply to this topic.