Changeset 7207 for trunk/bp-groups/bp-groups-actions.php
- Timestamp:
- 06/12/2013 10:08:10 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-actions.php
r7172 r7207 305 305 add_action( 'bp_actions', 'groups_action_redirect_to_random_group' ); 306 306 307 /** 308 * Load the activity feed for the specific group. 309 * 310 * @since BuddyPress (v1.2) 311 */ 307 312 function groups_action_group_feed() { 308 global $bp, $wp_query; 309 310 if ( !bp_is_active( 'activity' ) || !bp_is_groups_component() || !isset( $bp->groups->current_group ) || !bp_is_current_action( 'feed' ) ) 311 return false; 312 313 $wp_query->is_404 = false; 314 status_header( 200 ); 315 316 if ( 'public' != $bp->groups->current_group->status ) { 317 if ( !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) 318 return false; 319 } 320 321 include_once( BP_PLUGIN_DIR . '/bp-activity/feeds/bp-activity-group-feed.php' ); 322 die; 313 314 // get current group 315 $group = groups_get_current_group(); 316 317 if ( ! bp_is_active( 'activity' ) || ! bp_is_groups_component() || ! $group || ! bp_is_current_action( 'feed' ) ) 318 return false; 319 320 // if group isn't public or if logged-in user is not a member of the group, do 321 // not output the group activity feed 322 if ( ! bp_group_is_visible( $group ) ) { 323 return false; 324 } 325 326 // setup the feed 327 buddypress()->activity->feed = new BP_Activity_Feed( array( 328 'id' => 'group', 329 330 /* translators: Group activity RSS title - "[Site Name] | [Group Name] | Activity" */ 331 'title' => sprintf( __( '%1$s | %2$s | Activity', 'buddypress' ), bp_get_site_name(), bp_get_current_group_name() ), 332 333 'link' => bp_get_group_permalink( $group ), 334 'description' => sprintf( __( "Activity feed for the group, %s.", 'buddypress' ), bp_get_current_group_name() ), 335 'activity_args' => array( 336 'object' => buddypress()->groups->id, 337 'primary_id' => bp_get_current_group_id(), 338 'display_comments' => 'threaded' 339 ) 340 ) ); 323 341 } 324 342 add_action( 'bp_actions', 'groups_action_group_feed' );
Note: See TracChangeset
for help on using the changeset viewer.