bp_activity_action_my_groups_feed

Load the activity feed for a user's groups.

Description

bp_activity_action_my_groups_feed(); 

Usage

  1. if ( !function_exists( 'bp_activity_action_my_groups_feed' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-actions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_activity_action_my_groups_feed(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-activity/bp-activity-actions.php  
  1. function bp_activity_action_my_groups_feed() { 
  2. if ( ! bp_is_active( 'groups' ) || ! bp_is_user_activity() || ! bp_is_current_action( bp_get_groups_slug() ) || ! bp_is_action_variable( 'feed', 0 ) ) { 
  3. return false; 
  4.  
  5. // Get displayed user's group IDs. 
  6. $groups = groups_get_user_groups(); 
  7. $group_ids = implode( ', ', $groups['groups'] ); 
  8.  
  9. // Setup the feed. 
  10. buddypress)->activity->feed = new BP_Activity_Feed( array( 
  11. 'id' => 'mygroups',  
  12.  
  13. /** translators: Member groups activity RSS title - "[Site Name] | [User Display Name] | Groups Activity" */ 
  14. 'title' => sprintf( __( '%1$s | %2$s | Group Activity', buddypress ), bp_get_site_name(), bp_get_displayed_user_fullname() ),  
  15.  
  16. 'description' => sprintf( __( "Public group activity feed of which %s is a member.", buddypress ), bp_get_displayed_user_fullname() ),  
  17. 'activity_args' => array( 
  18. 'object' =>buddypress)->groups->id,  
  19. 'primary_id' => $group_ids,  
  20. 'display_comments' => 'threaded' 
  21. ) );