This will make it so that if some one does not have a logged in cookie, they cannot view the content of any activity feed.

  1.  
  2. function restrict_feeds(){
  3.         if (!is_user_logged_in()) {
  4.                 remove_action( ‘wp’, ‘bp_activity_action_sitewide_feed’, 3 );
  5.                 remove_action( ‘wp’, ‘bp_activity_action_personal_feed’, 3 );
  6.                 remove_action( ‘wp’, ‘bp_activity_action_friends_feed’, 3 );
  7.         }
  8. }
  9.  
  10. add_action( ‘plugins_loaded’, ‘restrict_feeds’);
  11.  

It works by removing the action that normally triggers a function that includes bp-activity-site-wide-feed.php.

2 Comments

    hi

    been looking for a solution to this issue, quick question, hope you have time to answer?

    Is the above code ok to use with latest WP and BP ?

    Where does the code go? in the fuctions or activity loop?

    all help and advice appreciated

    Mark

  • Not sure if this code still works … I’ve been out of the loop for WP for a while now, having been doing Drupal dev almost exclusively for 2+ years. The code goes inside a plugin, or somewhere else where wordpress will interpret the add_action directive.

    Even if the action names have changed in more recent versions, the general procedure should still be the same: add an action that removes the actions responsible for publishing the RSS feeds.

Leave a Reply