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.
-
-
function restrict_feeds(){
-
if (!is_user_logged_in()) {
-
remove_action( ‘wp’, ‘bp_activity_action_sitewide_feed’, 3 );
-
remove_action( ‘wp’, ‘bp_activity_action_personal_feed’, 3 );
-
remove_action( ‘wp’, ‘bp_activity_action_friends_feed’, 3 );
-
}
-
}
-
-
add_action( ‘plugins_loaded’, ‘restrict_feeds’);
-
It works by removing the action that normally triggers a function that includes bp-activity-site-wide-feed.php.
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.