Index: /trunk/src/bp-groups/bp-groups-actions.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-actions.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-actions.php	(revision 10373)
@@ -29,9 +29,9 @@
 
 	if ( ! $user_has_access && 'hidden' !== $current_group->status ) {
-		// Always allow access to home and request-membership
+		// Always allow access to home and request-membership.
 		if ( bp_is_current_action( 'home' ) || bp_is_current_action( 'request-membership' ) ) {
 			$user_has_access = true;
 
-		// User doesn't have access, so set up redirect args
+		// User doesn't have access, so set up redirect args.
 		} elseif ( is_user_logged_in() ) {
 			$no_access_args = array(
@@ -43,5 +43,5 @@
 	}
 
-	// Protect the admin tab from non-admins
+	// Protect the admin tab from non-admins.
 	if ( bp_is_current_action( 'admin' ) && ! bp_is_item_admin() ) {
 		$user_has_access = false;
@@ -95,5 +95,5 @@
 function groups_action_create_group() {
 
-	// If we're not at domain.org/groups/create/ then return false
+	// If we're not at domain.org/groups/create/ then return false.
 	if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) )
 		return false;
@@ -109,8 +109,8 @@
 	$bp = buddypress();
 
-	// Make sure creation steps are in the right order
+	// Make sure creation steps are in the right order.
 	groups_action_sort_creation_steps();
 
-	// If no current step is set, reset everything so we can start a fresh group creation
+	// If no current step is set, reset everything so we can start a fresh group creation.
 	$bp->groups->current_create_step = bp_action_variable( 1 );
 	if ( !bp_get_groups_current_create_step() ) {
@@ -126,5 +126,5 @@
 	}
 
-	// If this is a creation step that is not recognized, just redirect them back to the first screen
+	// If this is a creation step that is not recognized, just redirect them back to the first screen.
 	if ( bp_get_groups_current_create_step() && empty( $bp->groups->group_creation_steps[bp_get_groups_current_create_step()] ) ) {
 		bp_core_add_message( __('There was an error saving group details. Please try again.', 'buddypress'), 'error' );
@@ -132,14 +132,14 @@
 	}
 
-	// Fetch the currently completed steps variable
+	// Fetch the currently completed steps variable.
 	if ( isset( $_COOKIE['bp_completed_create_steps'] ) && !isset( $reset_steps ) )
 		$bp->groups->completed_create_steps = json_decode( base64_decode( stripslashes( $_COOKIE['bp_completed_create_steps'] ) ) );
 
-	// Set the ID of the new group, if it has already been created in a previous step
+	// Set the ID of the new group, if it has already been created in a previous step.
 	if ( isset( $_COOKIE['bp_new_group_id'] ) ) {
 		$bp->groups->new_group_id = (int) $_COOKIE['bp_new_group_id'];
 		$bp->groups->current_group = groups_get_group( array( 'group_id' => $bp->groups->new_group_id ) );
 
-		// Only allow the group creator to continue to edit the new group
+		// Only allow the group creator to continue to edit the new group.
 		if ( ! bp_is_group_creator( $bp->groups->current_group, bp_loggedin_user_id() ) ) {
 			bp_core_add_message( __( 'Only the group creator may continue editing this group.', 'buddypress' ), 'error' );
@@ -148,8 +148,8 @@
 	}
 
-	// If the save, upload or skip button is hit, lets calculate what we need to save
+	// If the save, upload or skip button is hit, lets calculate what we need to save.
 	if ( isset( $_POST['save'] ) ) {
 
-		// Check the nonce
+		// Check the nonce.
 		check_admin_referer( 'groups_create_save_' . bp_get_groups_current_create_step() );
 
@@ -175,5 +175,5 @@
 				$group_enable_forum = 0;
 			} else {
-				// Create the forum if enable_forum = 1
+				// Create the forum if enable_forum = 1.
 				if ( bp_is_active( 'forums' ) && !groups_get_groupmeta( $bp->groups->new_group_id, 'forum_id' ) ) {
 					groups_new_group_forum();
@@ -247,10 +247,10 @@
 			$bp->groups->completed_create_steps[] = bp_get_groups_current_create_step();
 
-		// Reset cookie info
+		// Reset cookie info.
 		setcookie( 'bp_new_group_id', $bp->groups->new_group_id, time()+60*60*24, COOKIEPATH );
 		setcookie( 'bp_completed_create_steps', base64_encode( json_encode( $bp->groups->completed_create_steps ) ), time()+60*60*24, COOKIEPATH );
 
 		// If we have completed all steps and hit done on the final step we
-		// can redirect to the completed group
+		// can redirect to the completed group.
 		$keys = array_keys( $bp->groups->group_creation_steps );
 		if ( count( $bp->groups->completed_create_steps ) == count( $keys ) && bp_get_groups_current_create_step() == array_pop( $keys ) ) {
@@ -298,5 +298,5 @@
 	}
 
-	// Remove invitations
+	// Remove invitations.
 	if ( 'group-invites' === bp_get_groups_current_create_step() && ! empty( $_REQUEST['user_id'] ) && is_numeric( $_REQUEST['user_id'] ) ) {
 		if ( ! check_admin_referer( 'groups_invite_uninvite_user' ) ) {
@@ -316,5 +316,5 @@
 	}
 
-	// Group avatar is handled separately
+	// Group avatar is handled separately.
 	if ( 'group-avatar' == bp_get_groups_current_create_step() && isset( $_POST['upload'] ) ) {
 		if ( ! isset( $bp->avatar_admin ) ) {
@@ -323,19 +323,17 @@
 
 		if ( !empty( $_FILES ) && isset( $_POST['upload'] ) ) {
-			// Normally we would check a nonce here, but the group save nonce is used instead
-
-			// Pass the file to the avatar upload handler
+			// Normally we would check a nonce here, but the group save nonce is used instead.
+			// Pass the file to the avatar upload handler.
 			if ( bp_core_avatar_handle_upload( $_FILES, 'groups_avatar_upload_dir' ) ) {
 				$bp->avatar_admin->step = 'crop-image';
 
-				// Make sure we include the jQuery jCrop file for image cropping
+				// Make sure we include the jQuery jCrop file for image cropping.
 				add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' );
 			}
 		}
 
-		// If the image cropping is done, crop the image and save a full/thumb version
+		// If the image cropping is done, crop the image and save a full/thumb version.
 		if ( isset( $_POST['avatar-crop-submit'] ) && isset( $_POST['upload'] ) ) {
-			// Normally we would check a nonce here, but the group save nonce is used instead
-
+			// Normally we would check a nonce here, but the group save nonce is used instead.
 			if ( !bp_core_avatar_handle_crop( array( 'object' => 'group', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->id, 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) )
 				bp_core_add_message( __( 'There was an error saving the group profile photo, please try uploading again.', 'buddypress' ), 'error' );
@@ -364,5 +362,5 @@
 		return false;
 
-	// Nonce check
+	// Nonce check.
 	if ( !check_admin_referer( 'groups_join_group' ) )
 		return false;
@@ -370,8 +368,8 @@
 	$bp = buddypress();
 
-	// Skip if banned or already a member
+	// Skip if banned or already a member.
 	if ( !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) && !groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
 
-		// User wants to join a group that is not public
+		// User wants to join a group that is not public.
 		if ( $bp->groups->current_group->status != 'public' ) {
 			if ( !groups_check_user_has_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
@@ -381,5 +379,5 @@
 		}
 
-		// User wants to join any group
+		// User wants to join any group.
 		if ( !groups_join_group( $bp->groups->current_group->id ) )
 			bp_core_add_message( __( 'There was an error joining the group.', 'buddypress' ), 'error' );
@@ -417,14 +415,14 @@
 	}
 
-	// Nonce check
+	// Nonce check.
 	if ( ! check_admin_referer( 'groups_leave_group' ) ) {
 		return false;
 	}
 
-	// User wants to leave any group
+	// User wants to leave any group.
 	if ( groups_is_user_member( bp_loggedin_user_id(), bp_get_current_group_id() ) ) {
 		$bp = buddypress();
 
-		// Stop sole admins from abandoning their group
+		// Stop sole admins from abandoning their group.
 		$group_admins = groups_get_group_admins( bp_get_current_group_id() );
 
@@ -473,5 +471,5 @@
 	}
 
-	// Sort the steps by their position key
+	// Sort the steps by their position key.
 	ksort($temp);
 	unset($bp->groups->group_creation_steps);
@@ -510,5 +508,5 @@
 function groups_action_group_feed() {
 
-	// get current group
+	// Get current group.
 	$group = groups_get_current_group();
 
@@ -516,11 +514,11 @@
 		return false;
 
-	// if group isn't public or if logged-in user is not a member of the group, do
-	// not output the group activity feed
+	// If group isn't public or if logged-in user is not a member of the group, do
+	// not output the group activity feed.
 	if ( ! bp_group_is_visible( $group ) ) {
 		return false;
 	}
 
-	// setup the feed
+	// Set up the feed.
 	buddypress()->activity->feed = new BP_Activity_Feed( array(
 		'id'            => 'group',
Index: /trunk/src/bp-groups/bp-groups-activity.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-activity.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-activity.php	(revision 10373)
@@ -54,5 +54,5 @@
 	// These actions are for the legacy forums
 	// Since the bbPress plugin also shares the same 'forums' identifier, we also
-	// check for the legacy forums loader class to be extra cautious
+	// check for the legacy forums loader class to be extra cautious.
 	if ( bp_is_active( 'forums' ) && class_exists( 'BP_Forums_Component' ) ) {
 		bp_activity_set_action(
@@ -91,5 +91,4 @@
  * @param string $action   Static activity action.
  * @param object $activity Activity data object.
- *
  * @return string
  */
@@ -123,5 +122,4 @@
  * @param string $action   Static activity action.
  * @param object $activity Activity data object.
- *
  * @return string
  */
@@ -138,10 +136,10 @@
 
 	// Legacy filters (do not follow parameter patterns of other activity
-	// action filters, and requires apply_filters_ref_array())
+	// action filters, and requires apply_filters_ref_array()).
 	if ( has_filter( 'groups_activity_membership_accepted_action' ) ) {
 		$action = apply_filters_ref_array( 'groups_activity_membership_accepted_action', array( $action, $user_link, &$group ) );
 	}
 
-	// Another legacy filter
+	// Another legacy filter.
 	if ( has_filter( 'groups_activity_accepted_invite_action' ) ) {
 		$action = apply_filters_ref_array( 'groups_activity_accepted_invite_action', array( $action, $activity->user_id, &$group ) );
@@ -166,5 +164,4 @@
  * @param  string $action   Static activity action.
  * @param  object $activity Activity data object.
- *
  * @return string
  */
@@ -221,5 +218,4 @@
  *
  * @param array $activities Array of activity items.
- *
  * @return array
  */
@@ -243,5 +239,5 @@
 		// TEMPORARY - Once the 'populate_extras' issue is solved
 		// in the groups component, we can do this with groups_get_groups()
-		// rather than manually
+		// rather than manually.
 		$uncached_ids = array();
 		foreach ( $group_ids as $group_id ) {
@@ -271,6 +267,6 @@
  * @since 2.2.0
  *
- * @param array $retval Empty array by default
- * @param array $filter Current activity arguments
+ * @param array $retval Empty array by default.
+ * @param array $filter Current activity arguments.
  *
  * @return array
@@ -278,5 +274,5 @@
 function bp_groups_filter_activity_scope( $retval = array(), $filter = array() ) {
 
-	// Determine the user_id
+	// Determine the user_id.
 	if ( ! empty( $filter['user_id'] ) ) {
 		$user_id = $filter['user_id'];
@@ -287,5 +283,5 @@
 	}
 
-	// Determine groups of user
+	// Determine groups of user.
 	$groups = groups_get_user_groups( $user_id );
 	if ( empty( $groups['groups'] ) ) {
@@ -318,5 +314,5 @@
 		$show_hidden,
 
-		// overrides
+		// Overrides.
 		'override' => array(
 			'filter'      => array( 'user_id' => 0 ),
@@ -355,5 +351,5 @@
 	}
 
-	// Set the default for hide_sitewide by checking the status of the group
+	// Set the default for hide_sitewide by checking the status of the group.
 	$hide_sitewide = false;
 	if ( !empty( $args['item_id'] ) ) {
@@ -391,5 +387,4 @@
  * @param int $group_id Optional. The ID of the group whose last_activity is
  *                      being updated. Default: the current group's ID.
- *
  * @return bool|null False on failure.
  */
@@ -419,15 +414,14 @@
  * @param int $user_id  ID of the user joining the group.
  * @param int $group_id ID of the group.
- *
  * @return bool|null False on failure.
  */
 function bp_groups_membership_accepted_add_activity( $user_id, $group_id ) {
 
-	// Bail if Activity is not active
+	// Bail if Activity is not active.
 	if ( ! bp_is_active( 'activity' ) ) {
 		return false;
 	}
 
-	// Get the group so we can get it's name
+	// Get the group so we can get it's name.
 	$group = groups_get_group( array( 'group_id' => $group_id ) );
 
@@ -443,5 +437,5 @@
 	$action = apply_filters_ref_array( 'groups_activity_membership_accepted_action', array( sprintf( __( '%1$s joined the group %2$s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( $group->name ) . '</a>' ), $user_id, &$group ) );
 
-	// Record in activity streams
+	// Record in activity streams.
 	groups_record_activity( array(
 		'action'  => $action,
@@ -461,5 +455,4 @@
  * @param  BP_Groups_Group $old_group      Group object before the details had been changed.
  * @param  bool            $notify_members True if the admin has opted to notify group members, otherwise false.
- *
  * @return int|bool The ID of the activity on success. False on error.
  */
@@ -475,5 +468,5 @@
 	}
 
-	// If the admin has opted not to notify members, don't post an activity item either
+	// If the admin has opted not to notify members, don't post an activity item either.
 	if ( empty( $notify_members ) ) {
 		return;
@@ -557,13 +550,13 @@
 function bp_groups_leave_group_delete_recent_activity( $group_id, $user_id ) {
 
-	// Bail if Activity component is not active
+	// Bail if Activity component is not active.
 	if ( ! bp_is_active( 'activity' ) ) {
 		return;
 	}
 
-	// Get the member's group membership information
+	// Get the member's group membership information.
 	$membership = new BP_Groups_Member( $user_id, $group_id );
 
-	// Check the time period, and maybe delete their recent group activity
+	// Check the time period, and maybe delete their recent group activity.
 	if ( time() <= strtotime( '+5 minutes', (int) strtotime( $membership->date_modified ) ) ) {
 		bp_activity_delete( array(
Index: /trunk/src/bp-groups/bp-groups-admin.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-admin.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-admin.php	(revision 10373)
@@ -18,5 +18,5 @@
 if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
 
-// per_page screen option. Has to be hooked in extremely early.
+// The per_page screen option. Has to be hooked in extremely early.
 if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-groups' == $_REQUEST['page'] )
 	add_filter( 'set-screen-option', 'bp_groups_admin_screen_options', 10, 3 );
@@ -29,5 +29,5 @@
 function bp_groups_add_admin_menu() {
 
-	// Add our screen
+	// Add our screen.
 	$hook = add_menu_page(
 		_x( 'Groups', 'Admin Groups page title', 'buddypress' ),
@@ -53,5 +53,4 @@
  *
  * @param array $custom_menus Array of BP top-level menu items.
- *
  * @return array Menu item array, with Groups added.
  */
@@ -76,8 +75,8 @@
 	global $bp_groups_list_table;
 
-	// Build redirection URL
+	// Build redirection URL.
 	$redirect_to = remove_query_arg( array( 'action', 'action2', 'gid', 'deleted', 'error', 'updated', 'success_new', 'error_new', 'success_modified', 'error_modified' ), $_SERVER['REQUEST_URI'] );
 
-	// Decide whether to load the dev version of the CSS and JavaScript
+	// Decide whether to load the dev version of the CSS and JavaScript.
 	$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : 'min.';
 
@@ -93,5 +92,5 @@
 	do_action( 'bp_groups_admin_load', $doaction );
 
-	// Edit screen
+	// Edit screen.
 	if ( 'do_delete' == $doaction && ! empty( $_GET['gid'] ) ) {
 
@@ -112,5 +111,5 @@
 
 	} elseif ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) {
-		// columns screen option
+		// Columns screen option.
 		add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) );
 
@@ -123,5 +122,5 @@
 		) );
 
-		// Help panel - sidebar links
+		// Help panel - sidebar links.
 		get_current_screen()->set_help_sidebar(
 			'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
@@ -142,17 +141,17 @@
 		do_action( 'bp_groups_admin_meta_boxes' );
 
-		// Enqueue JavaScript files
+		// Enqueue JavaScript files.
 		wp_enqueue_script( 'postbox' );
 		wp_enqueue_script( 'dashboard' );
 
-	// Index screen
+	// Index screen.
 	} else {
-		// Create the Groups screen list table
+		// Create the Groups screen list table.
 		$bp_groups_list_table = new BP_Groups_List_Table();
 
-		// per_page screen option
+		// The per_page screen option.
 		add_screen_option( 'per_page', array( 'label' => _x( 'Groups', 'Groups per page (screen options)', 'buddypress' )) );
 
-		// Help panel - overview text
+		// Help panel - overview text.
 		get_current_screen()->add_help_tab( array(
 			'id'      => 'bp-groups-overview',
@@ -171,5 +170,5 @@
 		) );
 
-		// Help panel - sidebar links
+		// Help panel - sidebar links.
 		get_current_screen()->set_help_sidebar(
 			'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
@@ -180,5 +179,5 @@
 	$bp = buddypress();
 
-	// Enqueue CSS and JavaScript
+	// Enqueue CSS and JavaScript.
 	wp_enqueue_script( 'bp_groups_admin_js', $bp->plugin_url . "bp-groups/admin/js/admin.{$min}js", array( 'jquery', 'wp-ajax-response', 'jquery-ui-autocomplete' ), bp_get_version(), true );
 	wp_localize_script( 'bp_groups_admin_js', 'BP_Group_Admin', array(
@@ -195,5 +194,5 @@
 
 	if ( $doaction && 'save' == $doaction ) {
-		// Get group ID
+		// Get group ID.
 		$group_id = isset( $_REQUEST['gid'] ) ? (int) $_REQUEST['gid'] : '';
 
@@ -203,11 +202,11 @@
 		), $redirect_to );
 
-		// Check this is a valid form submission
+		// Check this is a valid form submission.
 		check_admin_referer( 'edit-group_' . $group_id );
 
-		// Get the group from the database
+		// Get the group from the database.
 		$group = groups_get_group( 'group_id=' . $group_id );
 
-		// If the group doesn't exist, just redirect back to the index
+		// If the group doesn't exist, just redirect back to the index.
 		if ( empty( $group->slug ) ) {
 			wp_redirect( $redirect_to );
@@ -215,16 +214,15 @@
 		}
 
-		// Check the form for the updated properties
-
-		// Store errors
+		// Check the form for the updated properties.
+		// Store errors.
 		$error = 0;
 		$success_new = $error_new = $success_modified = $error_modified = array();
 
 		// Group name and description are handled with
-		// groups_edit_base_group_details()
+		// groups_edit_base_group_details().
 		if ( !groups_edit_base_group_details( $group_id, $_POST['bp-groups-name'], $_POST['bp-groups-description'], 0 ) ) {
 			$error = $group_id;
 
-			// using negative integers for different error messages... eek!
+			// Using negative integers for different error messages... eek!
 			if ( empty( $_POST['bp-groups-name'] ) && empty( $_POST['bp-groups-description'] ) ) {
 				$error = -3;
@@ -236,5 +234,5 @@
 		}
 
-		// Enable discussion forum
+		// Enable discussion forum.
 		$enable_forum   = ( isset( $_POST['group-show-forum'] ) ) ? 1 : 0;
 
@@ -263,5 +261,5 @@
 		}
 
-		// Process new members
+		// Process new members.
 		$user_names = array();
 
@@ -276,5 +274,5 @@
 
 				// Make sure the user exists before attempting
-				// to add to the group
+				// to add to the group.
 				$user = get_user_by( 'slug', $un );
 
@@ -291,9 +289,9 @@
 		}
 
-		// Process member role changes
+		// Process member role changes.
 		if ( ! empty( $_POST['bp-groups-role'] ) && ! empty( $_POST['bp-groups-existing-role'] ) ) {
 
 			// Before processing anything, make sure you're not
-			// attempting to remove the all user admins
+			// attempting to remove the all user admins.
 			$admin_count = 0;
 			foreach ( (array) $_POST['bp-groups-role'] as $new_role ) {
@@ -311,5 +309,5 @@
 			} else {
 
-				// Process only those users who have had their roles changed
+				// Process only those users who have had their roles changed.
 				foreach ( (array) $_POST['bp-groups-role'] as $user_id => $new_role ) {
 
@@ -321,5 +319,5 @@
 							case 'mod' :
 								// Admin to mod is a demotion. Demote to
-								// member, then fall through
+								// member, then fall through.
 								if ( 'admin' == $existing_role ) {
 									groups_demote_member( $user_id, $group_id );
@@ -328,5 +326,5 @@
 							case 'admin' :
 								// If the user was banned, we must
-								// unban first
+								// unban first.
 								if ( 'banned' == $existing_role ) {
 									groups_unban_member( $user_id, $group_id );
@@ -334,5 +332,5 @@
 
 								// At this point, each existing_role
-								// is a member, so promote
+								// is a member, so promote.
 								$result = groups_promote_member( $user_id, $group_id, $new_role );
 
@@ -362,5 +360,5 @@
 						}
 
-						// Store the success or failure
+						// Store the success or failure.
 						if ( $result ) {
 							$success_modified[] = $user_id;
@@ -382,11 +380,10 @@
 		do_action( 'bp_group_admin_edit_after', $group_id );
 
-		// Create the redirect URL
-
+		// Create the redirect URL.
 		if ( $error ) {
-			// This means there was an error updating group details
+			// This means there was an error updating group details.
 			$redirect_to = add_query_arg( 'error', (int) $error, $redirect_to );
 		} else {
-			// Group details were update successfully
+			// Group details were update successfully.
 			$redirect_to = add_query_arg( 'updated', 1, $redirect_to );
 		}
@@ -438,5 +435,4 @@
  * @param string $option    Screen option name.
  * @param string $new_value Screen option form value.
- *
  * @return string Option value. False to abandon update.
  */
@@ -445,5 +441,5 @@
 		return $value;
 
-	// Per page
+	// Per page.
 	$new_value = (int) $new_value;
 	if ( $new_value < 1 || $new_value > 999 )
@@ -459,16 +455,16 @@
  */
 function bp_groups_admin() {
-	// Decide whether to load the index or edit screen
+	// Decide whether to load the index or edit screen.
 	$doaction = bp_admin_list_table_current_bulk_action();
 
-	// Display the single group edit screen
+	// Display the single group edit screen.
 	if ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) {
 		bp_groups_admin_edit();
 
-	// Display the group deletion confirmation screen
+	// Display the group deletion confirmation screen.
 	} elseif ( 'delete' == $doaction && ! empty( $_GET['gid'] ) ) {
 		bp_groups_admin_delete();
 
-	// Otherwise, display the groups index screen
+	// Otherwise, display the groups index screen.
 	} else {
 		bp_groups_admin_index();
@@ -488,5 +484,5 @@
 	$messages = array();
 
-	// If the user has just made a change to a group, build status messages
+	// If the user has just made a change to a group, build status messages.
 	if ( !empty( $_REQUEST['no_admins'] ) || ! empty( $_REQUEST['error'] ) || ! empty( $_REQUEST['updated'] ) || ! empty( $_REQUEST['error_new'] ) || ! empty( $_REQUEST['success_new'] ) || ! empty( $_REQUEST['error_modified'] ) || ! empty( $_REQUEST['success_modified'] ) ) {
 		$no_admins        = ! empty( $_REQUEST['no_admins']        ) ? 1                                             : 0;
@@ -546,5 +542,5 @@
 	$is_error = ! empty( $no_admins ) || ! empty( $errors ) || ! empty( $error_new ) || ! empty( $error_modified );
 
-	// Get the group from the database
+	// Get the group from the database.
 	$group      = groups_get_group( 'group_id=' . $_GET['gid'] );
 
@@ -552,5 +548,5 @@
 	$group_name = isset( $group->name ) ? apply_filters( 'bp_get_group_name', $group->name ) : '';
 
-	// Construct URL for form
+	// Construct URL for form.
 	$form_url = remove_query_arg( array( 'action', 'deleted', 'no_admins', 'error', 'error_new', 'success_new', 'error_modified', 'success_modified' ), $_SERVER['REQUEST_URI'] );
 	$form_url = add_query_arg( 'action', 'save', $form_url );
@@ -576,5 +572,5 @@
 		</h1>
 
-		<?php // If the user has just made a change to an group, display the status messages ?>
+		<?php // If the user has just made a change to an group, display the status messages. ?>
 		<?php if ( !empty( $messages ) ) : ?>
 			<div id="moderated" class="<?php echo ( $is_error ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "</p><p>", $messages ); ?></p></div>
@@ -652,8 +648,8 @@
 		'include'     => $group_ids,
 		'show_hidden' => true,
-		'per_page'    => null, // Return all results
+		'per_page'    => null, // Return all results.
 	) );
 
-	// Create a new list of group ids, based on those that actually exist
+	// Create a new list of group ids, based on those that actually exist.
 	$gids = array();
 	foreach ( $groups['groups'] as $group ) {
@@ -697,5 +693,5 @@
 	$messages = array();
 
-	// If the user has just made a change to a group, build status messages
+	// If the user has just made a change to a group, build status messages.
 	if ( ! empty( $_REQUEST['deleted'] ) ) {
 		$deleted  = ! empty( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0;
@@ -706,5 +702,5 @@
 	}
 
-	// Prepare the group items for display
+	// Prepare the group items for display.
 	$bp_groups_list_table->prepare_items();
 
@@ -733,10 +729,10 @@
 		</h1>
 
-		<?php // If the user has just made a change to an group, display the status messages ?>
+		<?php // If the user has just made a change to an group, display the status messages. ?>
 		<?php if ( !empty( $messages ) ) : ?>
 			<div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div>
 		<?php endif; ?>
 
-		<?php // Display each group on its own row ?>
+		<?php // Display each group on its own row. ?>
 		<?php $bp_groups_list_table->views(); ?>
 
@@ -800,4 +796,6 @@
  *
  * @since 1.7.0
+ *
+ * @param BP_Groups_Group $item The BP_Groups_Group object for the current group.
  */
 function bp_groups_admin_edit_metabox_add_new_members( $item ) {
@@ -821,5 +819,5 @@
 	// Pull up a list of group members, so we can separate out the types
 	// We'll also keep track of group members here to place them into a
-	// JavaScript variable, which will help with group member autocomplete
+	// JavaScript variable, which will help with group member autocomplete.
 	$members = array(
 		'admin'  => array(),
@@ -851,8 +849,8 @@
 	}
 
-	// Echo out the JavaScript variable
+	// Echo out the JavaScript variable.
 	echo '<script type="text/javascript">var group_id = "' . esc_js( $item->id ) . '";</script>';
 
-	// Loop through each member type
+	// Loop through each member type.
 	foreach ( $members as $member_type => $type_users ) : ?>
 
@@ -1008,5 +1006,4 @@
  * @param BP_Group_Member_Query $query       A BP_Group_Member_Query object.
  * @param string                $member_type member|mod|admin|banned.
- *
  * @return string Pagination links HTML.
  */
@@ -1018,5 +1015,5 @@
 	}
 
-	// The key used to paginate this member type in the $_GET global
+	// The key used to paginate this member type in the $_GET global.
 	$qs_key = $member_type . '_page';
 	$url_base = remove_query_arg( array( $qs_key, 'updated', 'success_modified' ), $_SERVER['REQUEST_URI'] );
@@ -1025,5 +1022,5 @@
 	$per_page = 10; // @todo Make this customizable?
 
-	// Don't show anything if there's no pagination
+	// Don't show anything if there's no pagination.
 	if ( 1 === $page && $query->total_users <= $per_page ) {
 		return $pagination;
@@ -1065,5 +1062,4 @@
  *
  * @param array $user_ids Array of user IDs.
- *
  * @return array Array of user_logins corresponding to $user_ids.
  */
@@ -1087,5 +1083,5 @@
 function bp_groups_admin_autocomplete_handler() {
 
-	// Bail if user user shouldn't be here, or is a large network
+	// Bail if user user shouldn't be here, or is a large network.
 	if ( ! current_user_can( 'bp_moderate' ) || ( is_multisite() && wp_is_large_network( 'users' ) ) ) {
 		wp_die( -1 );
@@ -1112,5 +1108,5 @@
 
 			$matches[] = array(
-				// translators: 1: user_login, 2: user_email
+				// Translators: 1: user_login, 2: user_email.
 				'label' => sprintf( __( '%1$s (%2$s)', 'buddypress' ), $user->name, $user->ID ),
 				'value' => $user->ID,
@@ -1133,5 +1129,5 @@
 	 * The type of view currently being displayed.
 	 *
-	 * e.g. "All", "Pending", "Approved", "Spam"...
+	 * E.g. "All", "Pending", "Approved", "Spam"...
 	 *
 	 * @since 1.7.0
@@ -1186,12 +1182,12 @@
 		$screen = get_current_screen();
 
-		// Option defaults
+		// Option defaults.
 		$include_id   = false;
 		$search_terms = false;
 
-		// Set current page
+		// Set current page.
 		$page = $this->get_pagenum();
 
-		// Set per page from the screen options
+		// Set per page from the screen options.
 		$per_page = $this->get_items_per_page( str_replace( '-', '_', "{$screen->id}_per_page" ) );
 
@@ -1202,5 +1198,5 @@
 		}
 
-		// Order by - default to newest
+		// Order by - default to newest.
 		$orderby = 'last_activity';
 		if ( ! empty( $_REQUEST['orderby'] ) ) {
@@ -1229,13 +1225,13 @@
 			$include_id = (int) $_REQUEST['gid'];
 
-		// Set the current view
+		// Set the current view.
 		if ( isset( $_GET['group_status'] ) && in_array( $_GET['group_status'], array( 'public', 'private', 'hidden' ) ) ) {
 			$this->view = $_GET['group_status'];
 		}
 
-		// We'll use the ids of group types for the 'include' param
+		// We'll use the ids of group types for the 'include' param.
 		$this->group_type_ids = BP_Groups_Group::get_group_type_ids();
 
-		// Pass a dummy array if there are no groups of this type
+		// Pass a dummy array if there are no groups of this type.
 		$include = false;
 		if ( 'all' != $this->view && isset( $this->group_type_ids[ $this->view ] ) ) {
@@ -1243,5 +1239,5 @@
 		}
 
-		// Get group type counts for display in the filter tabs
+		// Get group type counts for display in the filter tabs.
 		$this->group_counts = array();
 		foreach ( $this->group_type_ids as $group_type => $group_ids ) {
@@ -1270,8 +1266,8 @@
 		}
 
-		// Set raw data to display
+		// Set raw data to display.
 		$this->items = $groups;
 
-		// Store information needed for handling table pagination
+		// Store information needed for handling table pagination.
 		$this->set_pagination_args( array(
 			'per_page'    => $per_page,
@@ -1307,5 +1303,5 @@
 	 */
 	protected function get_default_primary_column_name() {
-		// comment column is mapped to Group's name
+		// Comment column is mapped to Group's name.
 		return 'comment';
 	}
@@ -1324,5 +1320,5 @@
 	 *
 	 * @since 1.7.0
-	*/
+	 */
 	public function display() {
 		$this->display_tablenav( 'top' ); ?>
@@ -1498,6 +1494,6 @@
 	 * @since 2.3.4 Visibility set to public for compatibility with WP < 4.0.0.
 	 *
-	 * @param array $actions The list of actions
-	 * @param bool $always_visible Whether the actions should be always visible
+	 * @param array $actions        The list of actions.
+	 * @param bool  $always_visible Whether the actions should be always visible.
 	 * @return string
 	 */
@@ -1559,5 +1555,5 @@
 	public function column_comment( $item = array() ) {
 
-		// Preorder items: Edit | Delete | View
+		// Preorder items: Edit | Delete | View.
 		$actions = array(
 			'edit'   => '',
@@ -1566,8 +1562,8 @@
 		);
 
-		// We need the group object for some BP functions
+		// We need the group object for some BP functions.
 		$item_obj = (object) $item;
 
-		// Build actions URLs
+		// Build actions URLs.
 		$base_url   = bp_get_admin_url( 'admin.php?page=bp-groups&amp;gid=' . $item['id'] );
 		$delete_url = wp_nonce_url( $base_url . "&amp;action=delete", 'bp-groups-delete' );
@@ -1585,13 +1581,12 @@
 		$group_name = apply_filters_ref_array( 'bp_get_group_name', array( $item['name'] ), $item );
 
-		// Rollover actions
-
-		// Edit
+		// Rollover actions.
+		// Edit.
 		$actions['edit']   = sprintf( '<a href="%s">%s</a>', esc_url( $edit_url   ), __( 'Edit',   'buddypress' ) );
 
-		// Delete
+		// Delete.
 		$actions['delete'] = sprintf( '<a href="%s">%s</a>', esc_url( $delete_url ), __( 'Delete', 'buddypress' ) );
 
-		// Visit
+		// Visit.
 		$actions['view']   = sprintf( '<a href="%s">%s</a>', esc_url( $view_url   ), __( 'View',   'buddypress' ) );
 
@@ -1606,5 +1601,5 @@
 		$actions = apply_filters( 'bp_groups_admin_comment_row_actions', array_filter( $actions ), $item );
 
-		// Get group name and avatar
+		// Get group name and avatar.
 		$avatar = '';
 
@@ -1659,5 +1654,5 @@
 
 		// @todo This should be abstracted out somewhere for the whole
-		// Groups component
+		// Groups component.
 		switch ( $status ) {
 			case 'public' :
@@ -1732,5 +1727,4 @@
 	 * @param array  $item        Information about the current row.
 	 * @param string $column_name The column name.
-	 *
 	 * @return string
 	 */
Index: /trunk/src/bp-groups/bp-groups-adminbar.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-adminbar.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-adminbar.php	(revision 10373)
@@ -26,18 +26,18 @@
 	$bp = buddypress();
 
-	// Only show if viewing a group
+	// Only show if viewing a group.
 	if ( ! bp_is_group() || bp_is_group_create() ) {
 		return false;
 	}
 
-	// Only show this menu to group admins and super admins
+	// Only show this menu to group admins and super admins.
 	if ( ! bp_current_user_can( 'bp_moderate' ) && ! bp_group_is_admin() ) {
 		return false;
 	}
 
-	// Unique ID for the 'Edit Group' menu
+	// Unique ID for the 'Edit Group' menu.
 	$bp->group_admin_menu_id = 'group-admin';
 
-	// Add the top-level Group Admin button
+	// Add the top-level Group Admin button.
 	$wp_admin_bar->add_menu( array(
 		'id'    => $bp->group_admin_menu_id,
@@ -46,13 +46,13 @@
 	) );
 
-	// Index of the Manage tabs parent slug
+	// Index of the Manage tabs parent slug.
 	$nav_index = $bp->groups->current_group->slug . '_manage';
 
-	// Check if current group has Manage tabs
+	// Check if current group has Manage tabs.
 	if ( empty( $bp->bp_options_nav[ $nav_index ] ) ) {
 		return;
 	}
 
-	// Build the Group Admin menus
+	// Build the Group Admin menus.
 	foreach ( $bp->bp_options_nav[ $nav_index ] as $menu ) {
 		/**
@@ -66,5 +66,5 @@
 			$title = sprintf( _x( 'Edit Group %s', 'Group WP Admin Bar manage links', 'buddypress' ), $menu['name'] );
 
-			// Title is specific for delete
+			// Title is specific for delete.
 			if ( 'delete-group' == $menu['slug'] ) {
 				$title = sprintf( _x( '%s Group', 'Group WP Admin Bar delete link', 'buddypress' ), $menu['name'] );
Index: /trunk/src/bp-groups/bp-groups-cache.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-cache.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-cache.php	(revision 10373)
@@ -23,5 +23,4 @@
  * $group_ids and adds it to WP cache. This improves efficiency when using
  * groupmeta within a loop context.
- *
  *
  * @param int|string|array|bool $group_ids Accepts a single group_id, or a
@@ -78,6 +77,6 @@
  * @since 2.0.0
  *
- * @param int $meta_id
- * @param int $group_id
+ * @param int $meta_id Meta ID.
+ * @param int $group_id Group ID.
  */
 function bp_groups_delete_group_cache_on_metadata_change( $meta_id, $group_id ) {
@@ -96,5 +95,5 @@
  */
 function bp_groups_clear_group_creator_cache( $group_id, $group_obj ) {
-	// Clears the 'total groups' for this user
+	// Clears the 'total groups' for this user.
 	groups_clear_group_user_object_cache( $group_obj->id, $group_obj->creator_id );
 }
@@ -110,5 +109,5 @@
  */
 function bp_groups_clear_group_members_caches( $group_obj, $user_ids ) {
-	// Clears the 'total groups' cache for each member in a group
+	// Clears the 'total groups' cache for each member in a group.
 	foreach ( (array) $user_ids as $user_id )
 		groups_clear_group_user_object_cache( $group_obj->id, $user_id );
@@ -200,5 +199,5 @@
  * @since 2.1.0
  *
- * @param BP_Groups_Member $member
+ * @param BP_Groups_Member $member Member object.
  */
 function groups_clear_group_administrator_cache_on_member_save( BP_Groups_Member $member ) {
Index: /trunk/src/bp-groups/bp-groups-filters.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-filters.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-filters.php	(revision 10373)
@@ -10,6 +10,5 @@
 defined( 'ABSPATH' ) || exit;
 
-// Filter bbPress template locations
-
+// Filter bbPress template locations.
 add_filter( 'bp_groups_get_directory_template', 'bp_add_template_locations' );
 add_filter( 'bp_get_single_group_template',    'bp_add_template_locations' );
@@ -51,14 +50,14 @@
 add_filter( 'groups_group_description_before_save', 'force_balance_tags' );
 
-// Trim trailing spaces from name and description when saving
+// Trim trailing spaces from name and description when saving.
 add_filter( 'groups_group_name_before_save',        'trim' );
 add_filter( 'groups_group_description_before_save', 'trim' );
 
-// Escape output of new group creation details
+// Escape output of new group creation details.
 add_filter( 'bp_get_new_group_id',          'esc_attr'     );
 add_filter( 'bp_get_new_group_name',        'esc_attr'     );
 add_filter( 'bp_get_new_group_description', 'esc_textarea' );
 
-// Format numberical output
+// Format numberical output.
 add_filter( 'bp_get_total_group_count',          'bp_core_number_format' );
 add_filter( 'bp_get_group_total_for_member',     'bp_core_number_format' );
@@ -71,6 +70,5 @@
  * @since 1.1.0
  *
- * @param string $content
- *
+ * @param string $content Content to filter.
  * @return string
  */
@@ -87,5 +85,5 @@
 	$allowed_tags = wp_kses_allowed_html( 'buddypress-groups' );
 
-	// Add our own tags allowed in group descriptions
+	// Add our own tags allowed in group descriptions.
 	$allowed_tags['a']['class']    = array();
 	$allowed_tags['img']           = array();
@@ -107,5 +105,5 @@
 	$tags = apply_filters( 'bp_groups_filter_kses', $allowed_tags );
 
-	// Return KSES'ed content, allowing the above tags
+	// Return KSES'ed content, allowing the above tags.
 	return wp_kses( $content, $tags );
 }
@@ -126,6 +124,5 @@
  * Add fields to bbPress query for group-specific data.
  *
- * @param string $sql
- *
+ * @param string $sql SQL statement to amend.
  * @return string
  */
@@ -138,6 +135,5 @@
  * Add JOINed tables to bbPress query for group-specific data.
  *
- * @param string $sql
- *
+ * @param string $sql SQL statement to amend.
  * @return string
  */
@@ -153,5 +149,5 @@
  * Add WHERE clauses to bbPress query for group-specific data and access protection.
  *
- * @param string $sql
+ * @param string $sql SQL Statement to amend.
  *
  * @return string
@@ -159,8 +155,8 @@
 function groups_add_forum_where_sql( $sql = '' ) {
 
-	// Define locale variable
+	// Define locale variable.
 	$parts = array();
 
-	// Set this for groups
+	// Set this for groups.
 	$parts['groups'] = "(gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id)";
 
@@ -173,4 +169,5 @@
 	 * Decide if private are visible
 	 */
+
 	// Are we in our own profile?
 	if ( bp_is_my_profile() )
@@ -181,21 +178,21 @@
 		unset( $parts['private'] );
 
-	// No need to filter on a single item
+	// No need to filter on a single item.
 	elseif ( bp_is_single_item() )
 		unset( $parts['private'] );
 
-	// Check the SQL filter that was passed
+	// Check the SQL filter that was passed.
 	if ( !empty( $sql ) )
 		$parts['passed'] = $sql;
 
-	// Assemble Voltron
+	// Assemble Voltron.
 	$parts_string = implode( ' AND ', $parts );
 
 	$bp = buddypress();
 
-	// Set it to the global filter
+	// Set it to the global filter.
 	$bp->groups->filter_sql = $parts_string;
 
-	// Return the global filter
+	// Return the global filter.
 	return $bp->groups->filter_sql;
 }
@@ -204,7 +201,7 @@
  * Modify bbPress caps for bp-forums.
  *
- * @param bool $value
- * @param string $cap
- * @param array $args
+ * @param bool   $value Original value for current_user_can check.
+ * @param string $cap   Capability checked.
+ * @param array  $args  Arguments for the caps.
  *
  * @return bool
@@ -238,4 +235,7 @@
  *
  * @see BB_Query::_filter_sql()
+ *
+ * @param string $sql SQL statement.
+ * @return string
  */
 function groups_filter_forums_root_page_sql( $sql ) {
@@ -262,5 +262,4 @@
  * @param bool $load_mentions    True to load mentions assets, false otherwise.
  * @param bool $mentions_enabled True if mentions are enabled.
- *
  * @return bool True if mentions scripts should be loaded.
  */
Index: /trunk/src/bp-groups/bp-groups-forums.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-forums.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-forums.php	(revision 10373)
@@ -66,5 +66,4 @@
  *
  * @param int $group_id Group id, passed from groups_details_updated.
- *
  * @return mixed
  */
@@ -112,5 +111,4 @@
  * @param mixed  $page      The page number where the new forum post should reside.
  *                          Default: false.
- *
  * @return mixed The new forum post ID on success. Boolean false on failure.
  */
@@ -221,5 +219,4 @@
  * @param string $topic_tags  A comma-delimited string of topic tags.
  * @param int    $forum_id    The forum ID this forum topic resides in.
- *
  * @return mixed The new topic object on success. Boolean false on failure.
  */
@@ -342,5 +339,4 @@
  * @param string $topic_text  The text for the forum topic.
  * @param mixed  $topic_tags  A comma-delimited string of topic tags. Optional.
- *
  * @return mixed The topic object on success. Boolean false on failure.
  */
@@ -364,5 +360,5 @@
 	}
 
-	// Get the corresponding activity item
+	// Get the corresponding activity item.
 	if ( bp_is_active( 'activity' ) ) {
 		$id = bp_activity_get_activity_id( array(
@@ -421,5 +417,4 @@
  * @param int    $topic_id  The topic ID of the existing forum topic.
  * @param mixed  $page      The page number where the new forum post should reside. Optional.
- *
  * @return mixed The forum post ID on success. Boolean false on failure.
  */
@@ -454,5 +449,5 @@
 	}
 
-	// Get the corresponding activity item
+	// Get the corresponding activity item.
 	if ( bp_is_active( 'activity' ) ) {
 		$id = bp_activity_get_activity_id( array(
@@ -507,5 +502,4 @@
  *
  * @param int $topic_id The ID of the topic to be deleted.
- *
  * @return bool True if the delete routine went through properly.
  */
@@ -513,5 +507,5 @@
 	$bp = buddypress();
 
-	// Before deleting the thread, get the post ids so that their activity items can be deleted
+	// Before deleting the thread, get the post ids so that their activity items can be deleted.
 	$posts  = bp_forums_get_topic_posts( array( 'topic_id' => $topic_id, 'per_page' => -1 ) );
 	$action = bp_forums_delete_topic( array( 'topic_id' => $topic_id ) );
@@ -528,8 +522,8 @@
 		do_action( 'groups_before_delete_group_forum_topic', $topic_id );
 
-		// Delete the corresponding activity stream items
+		// Delete the corresponding activity stream items.
 		if ( bp_is_active( 'activity' ) ) {
 
-			// The activity item for the initial topic
+			// The activity item for the initial topic.
 			bp_activity_delete( array(
 				'item_id'           => bp_get_current_group_id(),
@@ -539,5 +533,5 @@
 			) );
 
-			// The activity item for each post
+			// The activity item for each post.
 			foreach ( (array) $posts as $post ) {
 				bp_activity_delete( array(
@@ -574,5 +568,4 @@
  *                           value isn't used in the function but is passed along
  *                           to do_action() hooks.
- *
  * @return bool True on success.
  */
@@ -593,5 +586,5 @@
 		do_action( 'groups_before_delete_group_forum_post', $post_id, $topic_id );
 
-		// Delete the corresponding activity stream item
+		// Delete the corresponding activity stream item.
 		if ( bp_is_active( 'activity' ) ) {
 			bp_activity_delete( array(
@@ -624,5 +617,4 @@
  * @param string $type Either 'newest', 'popular', 'unreplied', 'tags'.
  *                     Default: 'newest'.
- *
  * @return int The topic count.
  */
@@ -647,5 +639,4 @@
  *                                  'all'. Default: 'public'.
  * @param string|bool $search_terms Optional. Limit by a search term.
- *
  * @return int The topic count.
  */
Index: /trunk/src/bp-groups/bp-groups-functions.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-functions.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-functions.php	(revision 10373)
@@ -36,10 +36,10 @@
  *
  * @param array|string $args {
- *	Array of al arguments.
- *	@type int  $group_id        ID of the group.
- *	@type bool $load_users      No longer used.
- *	@type bool $populate_extras Whether to fetch membership data and other
- *	                            extra information about the group.
- *                              Default: false.
+ *     Array of al arguments.
+ *     @type int  $group_id        ID of the group.
+ *     @type bool $load_users      No longer used.
+ *     @type bool $populate_extras Whether to fetch membership data and other
+ *                                 extra information about the group.
+ *                                 Default: false.
  * }
  * @return BP_Groups_Group $group The group object.
@@ -84,5 +84,5 @@
  *     @type string   $slug         The group slug.
  *     @type string   $status       The group's status. Accepts 'public', 'private' or
-                                    'hidden'. Defaults to 'public'.
+ *                                  'hidden'. Defaults to 'public'.
  *     @type int      $enable_forum Optional. Whether the group has a forum enabled.
  *                                  If the legacy forums are enabled for this group
@@ -110,5 +110,5 @@
 	extract( $args, EXTR_SKIP );
 
-	// Pass an existing group ID
+	// Pass an existing group ID.
 	if ( ! empty( $group_id ) ) {
 		$group = groups_get_group( array( 'group_id' => (int) $group_id ) );
@@ -117,16 +117,16 @@
 		$description = ! empty( $description ) ? $description : $group->description;
 
-		// Groups need at least a name
+		// Groups need at least a name.
 		if ( empty( $name ) ) {
 			return false;
 		}
 
-	// Create a new group
+	// Create a new group.
 	} else {
-		// Instantiate new group object
+		// Instantiate new group object.
 		$group = new BP_Groups_Group;
 	}
 
-	// Set creator ID
+	// Set creator ID.
 	if ( $creator_id ) {
 		$group->creator_id = (int) $creator_id;
@@ -139,10 +139,10 @@
 	}
 
-	// Validate status
+	// Validate status.
 	if ( ! groups_is_valid_status( $status ) ) {
 		return false;
 	}
 
-	// Set group name
+	// Set group name.
 	$group->name         = $name;
 	$group->description  = $description;
@@ -152,10 +152,10 @@
 	$group->date_created = $date_created;
 
-	// Save group
+	// Save group.
 	if ( ! $group->save() ) {
 		return false;
 	}
 
-	// If this is a new group, set up the creator as the first member and admin
+	// If this is a new group, set up the creator as the first member and admin.
 	if ( empty( $group_id ) ) {
 		$member                = new BP_Groups_Member;
@@ -217,5 +217,4 @@
  * @param bool   $notify_members Whether to send an email notification to group
  *                               members about changes in these details.
- *
  * @return bool True on success, false on failure.
  */
@@ -263,5 +262,4 @@
  * @param string|bool $invite_status Optional. Who is allowed to send invitations
  *                                   to the group. 'members', 'mods', or 'admins'.
- *
  * @return bool True on success, false on failure.
  */
@@ -271,5 +269,5 @@
 	$group->enable_forum = $enable_forum;
 
-	/***
+	/**
 	 * Before we potentially switch the group status, if it has been changed to public
 	 * from private and there are outstanding membership requests, auto-accept those requests.
@@ -278,5 +276,5 @@
 		groups_accept_all_pending_membership_requests( $group->id );
 
-	// Now update the status
+	// Now update the status.
 	$group->status = $status;
 
@@ -291,5 +289,5 @@
 	}
 
-	// Set the invite status
+	// Set the invite status.
 	if ( $invite_status )
 		groups_update_groupmeta( $group->id, 'invite_status', $invite_status );
@@ -315,5 +313,4 @@
  *
  * @param int $group_id ID of the group to delete.
- *
  * @return bool True on success, false on failure.
  */
@@ -329,13 +326,13 @@
 	do_action( 'groups_before_delete_group', $group_id );
 
-	// Get the group object
+	// Get the group object.
 	$group = groups_get_group( array( 'group_id' => $group_id ) );
 
-	// Bail if group cannot be deleted
+	// Bail if group cannot be deleted.
 	if ( ! $group->delete() ) {
 		return false;
 	}
 
-	// Remove all outstanding invites for this group
+	// Remove all outstanding invites for this group.
 	groups_delete_all_group_invites( $group_id );
 
@@ -356,5 +353,4 @@
  *
  * @param string $status Status to check.
- *
  * @return bool True if status is allowed, otherwise false.
  */
@@ -369,5 +365,4 @@
  *
  * @param string $slug Group slug to check.
- *
  * @return string $slug A unique and sanitized slug.
  */
@@ -395,5 +390,4 @@
  *
  * @param int $group_id The numeric ID of the group.
- *
  * @return string The group's slug.
  */
@@ -409,5 +403,4 @@
  *
  * @param string $group_slug The group's slug.
- *
  * @return int The ID.
  */
@@ -424,5 +417,4 @@
  * @param int $user_id  Optional. ID of the user. Defaults to the currently
  *                      logged-in user.
- *
  * @return bool True on success, false on failure.
  */
@@ -465,5 +457,4 @@
  * @param int $user_id  Optional. ID of the user. Defaults to the currently
  *                      logged-in user.
- *
  * @return bool True on success, false on failure.
  */
@@ -481,5 +472,5 @@
 		groups_delete_membership_request( null, $user_id, $group_id );
 
-	// User is already a member, just return true
+	// User is already a member, just return true.
 	if ( groups_is_user_member( $user_id, $group_id ) )
 		return true;
@@ -504,5 +495,5 @@
 		$group = $bp->groups->current_group;
 
-	// Record this in activity streams
+	// Record this in activity streams.
 	groups_record_activity( array(
 		'type'    => 'joined_group',
@@ -530,5 +521,4 @@
  *
  * @param int $group_id ID of the group.
- *
  * @return array Info about group admins (user_id + date_modified).
  */
@@ -541,5 +531,4 @@
  *
  * @param int $group_id ID of the group.
- *
  * @return array Info about group admins (user_id + date_modified).
  */
@@ -580,5 +569,5 @@
 function groups_get_group_members( $args = array() ) {
 
-	// Backward compatibility with old method of passing arguments
+	// Backward compatibility with old method of passing arguments.
 	if ( ! is_array( $args ) || func_num_args() > 1 ) {
 		_deprecated_argument( __METHOD__, '2.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
@@ -612,5 +601,5 @@
 	// For legacy users. Use of BP_Groups_Member::get_all_for_group()
 	// is deprecated. func_get_args() can't be passed to a function in PHP
-	// 5.2.x, so we create a variable
+	// 5.2.x, so we create a variable.
 	$func_args = func_get_args();
 	if ( apply_filters( 'bp_use_legacy_group_member_query', false, __FUNCTION__, $func_args ) ) {
@@ -618,6 +607,6 @@
 	} else {
 
-		// exclude_admins_mods and exclude_banned are legacy arguments.
-		// Convert to group_role
+		// Both exclude_admins_mods and exclude_banned are legacy arguments.
+		// Convert to group_role.
 		if ( empty( $r['group_role'] ) ) {
 			$r['group_role'] = array( 'member' );
@@ -633,5 +622,5 @@
 		}
 
-		// Perform the group member query (extends BP_User_Query)
+		// Perform the group member query (extends BP_User_Query).
 		$members = new BP_Group_Member_Query( array(
 			'group_id'       => $r['group_id'],
@@ -644,5 +633,5 @@
 		) );
 
-		// Structure the return value as expected by the template functions
+		// Structure the return value as expected by the template functions.
 		$retval = array(
 			'members' => array_values( $members->results ),
@@ -658,5 +647,4 @@
  *
  * @param int $group_id Group ID.
- *
  * @return int Count of confirmed members for the group.
  */
@@ -682,17 +670,17 @@
 
 	$defaults = array(
-		'type'              => false,    // active, newest, alphabetical, random, popular, most-forum-topics or most-forum-posts
-		'order'             => 'DESC',   // 'ASC' or 'DESC'
-		'orderby'           => 'date_created', // date_created, last_activity, total_member_count, name, random
-		'user_id'           => false,    // Pass a user_id to limit to only groups that this user is a member of
-		'include'           => false,    // Only include these specific groups (group_ids)
-		'exclude'           => false,    // Do not include these specific groups (group_ids)
-		'search_terms'      => false,    // Limit to groups that match these search terms
-		'meta_query'        => false,    // Filter by groupmeta. See WP_Meta_Query for syntax
-		'show_hidden'       => false,    // Show hidden groups to non-admins
-		'per_page'          => 20,       // The number of results to return per page
-		'page'              => 1,        // The page to return if limiting per page
-		'populate_extras'   => true,     // Fetch meta such as is_banned and is_member
-		'update_meta_cache' => true,   // Pre-fetch groupmeta for queried groups
+		'type'              => false,          // Active, newest, alphabetical, random, popular, most-forum-topics or most-forum-posts.
+		'order'             => 'DESC',         // 'ASC' or 'DESC'
+		'orderby'           => 'date_created', // date_created, last_activity, total_member_count, name, random.
+		'user_id'           => false,          // Pass a user_id to limit to only groups that this user is a member of.
+		'include'           => false,          // Only include these specific groups (group_ids).
+		'exclude'           => false,          // Do not include these specific groups (group_ids).
+		'search_terms'      => false,          // Limit to groups that match these search terms.
+		'meta_query'        => false,          // Filter by groupmeta. See WP_Meta_Query for syntax.
+		'show_hidden'       => false,          // Show hidden groups to non-admins.
+		'per_page'          => 20,             // The number of results to return per page.
+		'page'              => 1,              // The page to return if limiting per page.
+		'populate_extras'   => true,           // Fetch meta such as is_banned and is_member.
+		'update_meta_cache' => true,           // Pre-fetch groupmeta for queried groups.
 	);
 
@@ -769,5 +757,4 @@
  *
  * @param int $user_id Optional. Default: ID of the displayed user.
- *
  * @return int Group count.
  */
@@ -816,6 +803,5 @@
  * Generate the avatar upload directory path for a given group.
  *
- * @param int $group_id Optional. ID of the group. Default: ID of the
- *                      current group.
+ * @param int $group_id Optional. ID of the group. Default: ID of the current group.
  * @return string
  */
@@ -857,5 +843,4 @@
  * @param int $user_id ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return bool
  */
@@ -869,5 +854,4 @@
  * @param int $user_id ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return bool
  */
@@ -881,5 +865,4 @@
  * @param int $user_id ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return bool
  */
@@ -899,5 +882,4 @@
  * @param int $user_id ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return bool
  */
@@ -947,5 +929,5 @@
 		return false;
 
-	// Record this in activity streams
+	// Record this in activity streams.
 	$activity_action  = sprintf( __( '%1$s posted an update in the group %2$s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' );
 	$activity_content = $content;
@@ -1000,8 +982,8 @@
  *
  * @param int               $user_id ID of the inviting user.
- * @param int|bool          $limit Limit to restrict to.
- * @param int|bool          $page
- * @param string|array|bool $exclude
- *
+ * @param int|bool          $limit   Limit to restrict to.
+ * @param int|bool          $page    Optional. Page offset of results to return.
+ * @param string|array|bool $exclude Array of comma-separated list of group IDs
+ *                                   to exclude from results.
  * @return array $value IDs of users who have been invited to the group by the
  *                      user but have not yet accepted.
@@ -1021,5 +1003,4 @@
  *
  * @param int $user_id The user ID.
- *
  * @return int
  */
@@ -1064,9 +1045,9 @@
 		return false;
 
-	// if the user has already requested membership, accept the request
+	// If the user has already requested membership, accept the request.
 	if ( $membership_id = groups_check_for_membership_request( $user_id, $group_id ) ) {
 		groups_accept_membership_request( $membership_id, $user_id, $group_id );
 
-	// Otherwise, create a new invitation
+	// Otherwise, create a new invitation.
 	} elseif ( ! groups_is_user_member( $user_id, $group_id ) && ! groups_check_user_has_invite( $user_id, $group_id, 'all' ) ) {
 		$invite                = new BP_Groups_Member;
@@ -1100,5 +1081,4 @@
  * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return bool True on success, false on failure.
  */
@@ -1128,5 +1108,4 @@
  * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return bool True when the user is a member of the group, otherwise false.
  */
@@ -1134,5 +1113,5 @@
 
 	// If the user is already a member (because BP at one point allowed two invitations to
-	// slip through), delete all existing invitations/requests and return true
+	// slip through), delete all existing invitations/requests and return true.
 	if ( groups_is_user_member( $user_id, $group_id ) ) {
 		if ( groups_check_user_has_invite( $user_id, $group_id ) ) {
@@ -1154,10 +1133,10 @@
 	}
 
-	// Remove request to join
+	// Remove request to join.
 	if ( $member->check_for_membership_request( $user_id, $group_id ) ) {
 		$member->delete_request( $user_id, $group_id );
 	}
 
-	// Modify group meta
+	// Modify group meta.
 	groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
 
@@ -1180,5 +1159,4 @@
  * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return bool True on success, false on failure.
  */
@@ -1205,5 +1183,4 @@
  * @param int $user_id  ID of the invited user.
  * @param int $group_id ID of the group.
- *
  * @return bool True on success, false on failure.
  */
@@ -1243,5 +1220,5 @@
 		$member = new BP_Groups_Member( $invited_users[$i], $group_id );
 
-		// Send the actual invite
+		// Send the actual invite.
 		groups_notification_group_invites( $group, $member, $user_id );
 
@@ -1268,5 +1245,4 @@
  * @param int $user_id  ID of the inviting user.
  * @param int $group_id ID of the group.
- *
  * @return array $value IDs of users who have been invited to the group by the
  *                      user but have not yet accepted.
@@ -1287,5 +1263,4 @@
  * @param string $type     Optional. Use 'sent' to check for sent invites,
  *                         'all' to check for all. Default: 'sent'.
- *
  * @return bool True if an invitation is found, otherwise false.
  */
@@ -1298,5 +1273,4 @@
  *
  * @param int $group_id ID of the group whose invitations are being deleted.
- *
  * @return int|null Number of rows records deleted on success, null on failure.
  */
@@ -1313,5 +1287,4 @@
  * @param int    $group_id ID of the group.
  * @param string $status   The new status. 'mod' or 'admin'.
- *
  * @return bool True on success, false on failure.
  */
@@ -1345,5 +1318,4 @@
  * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return bool True on success, false on failure.
  */
@@ -1373,5 +1345,4 @@
  * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return bool True on success, false on failure.
  */
@@ -1401,5 +1372,4 @@
  * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return bool True on success, false on failure.
  */
@@ -1431,5 +1401,4 @@
  * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return bool True on success, false on failure.
  */
@@ -1462,18 +1431,17 @@
  * @param int $requesting_user_id ID of the user requesting membership.
  * @param int $group_id           ID of the group.
- *
  * @return bool True on success, false on failure.
  */
 function groups_send_membership_request( $requesting_user_id, $group_id ) {
 
-	// Prevent duplicate requests
+	// Prevent duplicate requests.
 	if ( groups_check_for_membership_request( $requesting_user_id, $group_id ) )
 		return false;
 
-	// Check if the user is already a member or is banned
+	// Check if the user is already a member or is banned.
 	if ( groups_is_user_member( $requesting_user_id, $group_id ) || groups_is_user_banned( $requesting_user_id, $group_id ) )
 		return false;
 
-	// Check if the user is already invited - if so, simply accept invite
+	// Check if the user is already invited - if so, simply accept invite.
 	if ( groups_check_user_has_invite( $requesting_user_id, $group_id ) ) {
 		groups_accept_invite( $requesting_user_id, $group_id );
@@ -1494,5 +1462,5 @@
 		$admins = groups_get_group_admins( $group_id );
 
-		// Saved okay, now send the email notification
+		// Saved okay, now send the email notification.
 		for ( $i = 0, $count = count( $admins ); $i < $count; ++$i )
 			groups_notification_new_membership_request( $requesting_user_id, $admins[$i]->user_id, $group_id, $requesting_user->id );
@@ -1526,5 +1494,4 @@
  *                           requested. Provide this value along with $user_id to
  *                           override $membership_id.
- *
  * @return bool True on success, false on failure.
  */
@@ -1572,5 +1539,4 @@
  *                           requested. Provide this value along with $user_id to
  *                           override $membership_id.
- *
  * @return bool True on success, false on failure.
  */
@@ -1604,5 +1570,4 @@
  *                           requested. Provide this value along with $user_id to
  *                           override $membership_id.
- *
  * @return bool True on success, false on failure.
  */
@@ -1624,5 +1589,4 @@
  * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return int|null ID of the membership if found, otherwise false.
  */
@@ -1635,5 +1599,4 @@
  *
  * @param int $group_id ID of the group.
- *
  * @return bool True on success, false on failure.
  */
@@ -1672,5 +1635,4 @@
  *                                metadata entries for the specified group.
  *                                Default: false.
- *
  * @return bool True on success, false on failure.
  */
@@ -1678,9 +1640,9 @@
 	global $wpdb;
 
-	// Legacy - if no meta_key is passed, delete all for the item
+	// Legacy - if no meta_key is passed, delete all for the item.
 	if ( empty( $meta_key ) ) {
 		$keys = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM {$wpdb->groupmeta} WHERE group_id = %d", $group_id ) );
 
-		// With no meta_key, ignore $delete_all
+		// With no meta_key, ignore $delete_all.
 		$delete_all = false;
 	} else {
@@ -1708,5 +1670,4 @@
  *                         specified meta_key. This parameter has no effect if
  *                         meta_key is empty.
- *
  * @return mixed Metadata value.
  */
@@ -1728,5 +1689,4 @@
  *                           metadata entries with the specified value.
  *                           Otherwise, update all entries.
- *
  * @return bool|int $retval Returns false on failure. On successful update of existing
  *                          metadata, returns true. On successful creation of new metadata,
@@ -1753,5 +1713,4 @@
  *                           has a value for the key, no change will be made.
  *                           Default: false.
- *
  * @return int|bool The meta ID on successful update, false on failure.
  */
Index: /trunk/src/bp-groups/bp-groups-loader.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-loader.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-loader.php	(revision 10373)
@@ -14,4 +14,7 @@
 defined( 'ABSPATH' ) || exit;
 
+/**
+ * Creates our Groups component.
+ */
 class BP_Groups_Component extends BP_Component {
 
@@ -37,4 +40,5 @@
 	 * @since 1.6.0
 	 * @todo Is this used anywhere? Is this a duplicate of $default_extension?
+	 * @var string
 	 */
 	var $default_component;
@@ -136,10 +140,10 @@
 		$bp = buddypress();
 
-		// Define a slug, if necessary
+		// Define a slug, if necessary.
 		if ( ! defined( 'BP_GROUPS_SLUG' ) ) {
 			define( 'BP_GROUPS_SLUG', $this->id );
 		}
 
-		// Global tables for groups component
+		// Global tables for groups component.
 		$global_tables = array(
 			'table_name'           => $bp->table_prefix . 'bp_groups',
@@ -148,5 +152,5 @@
 		);
 
-		// Metadata tables for groups component
+		// Metadata tables for groups component.
 		$meta_tables = array(
 			'group' => $bp->table_prefix . 'bp_groups_groupmeta',
@@ -168,5 +172,5 @@
 		parent::setup_globals( $args );
 
-		/** Single Group Globals **********************************************/
+		/* Single Group Globals **********************************************/
 
 		// Are we viewing a single group?
@@ -215,5 +219,5 @@
 			}
 
-			// If the user is not an admin, check if they are a moderator
+			// If the user is not an admin, check if they are a moderator.
 			if ( ! bp_is_item_admin() ) {
 				bp_update_is_item_mod  ( groups_is_user_mod  ( bp_loggedin_user_id(), $this->current_group->id ), 'groups' );
@@ -245,8 +249,8 @@
 			}
 
-			// Check once if the current group has a custom front template
+			// Check once if the current group has a custom front template.
 			$this->current_group->front_template = bp_groups_get_front_template( $this->current_group );
 
-		// Set current_group to 0 to prevent debug errors
+		// Set current_group to 0 to prevent debug errors.
 		} else {
 			$this->current_group = 0;
@@ -277,5 +281,5 @@
 		) );
 
-		// If the user was attempting to access a group, but no group by that name was found, 404
+		// If the user was attempting to access a group, but no group by that name was found, 404.
 		if ( bp_is_groups_component() && empty( $this->current_group ) && bp_current_action() && !in_array( bp_current_action(), $this->forbidden_names ) ) {
 			bp_do_404();
@@ -301,5 +305,5 @@
 		) );
 
-		// If avatar uploads are not disabled, add avatar option
+		// If avatar uploads are not disabled, add avatar option.
 		$disabled_avatar_uploads = (int) bp_disable_group_avatar_uploads();
 		if ( ! $disabled_avatar_uploads && $bp->avatar->show_avatars ) {
@@ -317,5 +321,5 @@
 		}
 
-		// If friends component is active, add invitations
+		// If friends component is active, add invitations.
 		if ( bp_is_active( 'friends' ) ) {
 			$this->group_creation_steps['group-invites'] = array(
@@ -338,5 +342,5 @@
 		) );
 
-		// Auto join group when non group member performs group activity
+		// Auto join group when non group member performs group activity.
 		$this->auto_join = defined( 'BP_DISABLE_AUTO_GROUP_JOIN' ) && BP_DISABLE_AUTO_GROUP_JOIN ? false : true;
 	}
@@ -368,5 +372,5 @@
 		$bp = buddypress();
 
-		// If the activity component is not active and the current group has no custom front, members are displayed in the home nav
+		// If the activity component is not active and the current group has no custom front, members are displayed in the home nav.
 		if ( 'members' === $this->default_extension && ! bp_is_active( 'activity' ) && ! $this->current_group->front_template ) {
 			$this->default_extension = 'home';
@@ -377,5 +381,5 @@
 		}
 
-		// Prepare for a redirect to the canonical URL
+		// Prepare for a redirect to the canonical URL.
 		$bp->canonical_stack['base_url'] = bp_get_group_permalink( $this->current_group );
 
@@ -401,5 +405,5 @@
 		// When viewing the default extension, the canonical URL should not have
 		// that extension's slug, unless more has been tacked onto the URL via
-		// action variables
+		// action variables.
 		if ( bp_is_current_action( $this->default_extension ) && empty( $bp->action_variables ) )  {
 			unset( $bp->canonical_stack['action'] );
@@ -419,5 +423,5 @@
 	public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
 
-		// Determine user to use
+		// Determine user to use.
 		if ( bp_displayed_user_domain() ) {
 			$user_domain = bp_displayed_user_domain();
@@ -428,5 +432,5 @@
 		}
 
-		// Only grab count if we're on a user page
+		// Only grab count if we're on a user page.
 		if ( bp_is_user() ) {
 			$count    = bp_get_total_group_count_for_user();
@@ -439,5 +443,5 @@
 		$slug = bp_get_groups_slug();
 
-		// Add 'Groups' to the main navigation
+		// Add 'Groups' to the main navigation.
 		$main_nav = array(
 			'name'                => $nav_name,
@@ -453,5 +457,5 @@
 			$groups_link = trailingslashit( $user_domain . $slug );
 
-			// Add the My Groups nav item
+			// Add the My Groups nav item.
 			$sub_nav[] = array(
 				'name'            => __( 'Memberships', 'buddypress' ),
@@ -464,5 +468,5 @@
 			);
 
-			// Add the Group Invites nav item
+			// Add the Group Invites nav item.
 			$sub_nav[] = array(
 				'name'            => __( 'Invitations', 'buddypress' ),
@@ -480,12 +484,12 @@
 		if ( bp_is_groups_component() && bp_is_single_item() ) {
 
-			// Reset sub nav
+			// Reset sub nav.
 			$sub_nav = array();
 
-			// Add 'Groups' to the main navigation
+			// Add 'Groups' to the main navigation.
 			$main_nav = array(
 				'name'                => __( 'Memberships', 'buddypress' ),
 				'slug'                => $this->current_group->slug,
-				'position'            => -1, // Do not show in BuddyBar
+				'position'            => -1, // Do not show in BuddyBar.
 				'screen_function'     => 'groups_screen_group_home',
 				'default_subnav_slug' => $this->default_extension,
@@ -495,5 +499,5 @@
 			$group_link = bp_get_group_permalink( $this->current_group );
 
-			// Add the "Home" subnav item, as this will always be present
+			// Add the "Home" subnav item, as this will always be present.
 			$sub_nav[] = array(
 				'name'            =>  _x( 'Home', 'Group screen navigation title', 'buddypress' ),
@@ -526,5 +530,5 @@
 			}
 
-			// Forums are enabled and turned on
+			// Forums are enabled and turned on.
 			if ( $this->current_group->enable_forum && bp_is_active( 'forums' ) ) {
 				$sub_nav[] = array(
@@ -559,5 +563,5 @@
 
 				/**
-				 * Only add the members subnav if it's not the home's nav
+				 * Only add the members subnav if it's not the home's nav.
 				 */
 				$sub_nav[] = array(
@@ -588,5 +592,5 @@
 			}
 
-			// If the user is a group admin, then show the group admin nav item
+			// If the user is a group admin, then show the group admin nav item.
 			if ( bp_is_item_admin() ) {
 				$sub_nav[] = array(
@@ -604,5 +608,5 @@
 				$admin_link = trailingslashit( $group_link . 'admin' );
 
-				// Common params to all nav items
+				// Common params to all nav items.
 				$default_params = array(
 					'parent_url'        => $admin_link,
@@ -692,11 +696,11 @@
 	public function setup_admin_bar( $wp_admin_nav = array() ) {
 
-		// Menus for logged in user
+		// Menus for logged in user.
 		if ( is_user_logged_in() ) {
 
-			// Setup the logged in user variables
+			// Setup the logged in user variables.
 			$groups_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() );
 
-			// Pending group invites
+			// Pending group invites.
 			$count   = groups_get_invite_count_for_user();
 			$title   = _x( 'Groups', 'My Account Groups', 'buddypress' );
@@ -708,5 +712,5 @@
 			}
 
-			// Add the "My Account" sub menus
+			// Add the "My Account" sub menus.
 			$wp_admin_nav[] = array(
 				'parent' => buddypress()->my_account_menu_id,
@@ -716,5 +720,5 @@
 			);
 
-			// My Groups
+			// My Groups.
 			$wp_admin_nav[] = array(
 				'parent' => 'my-account-' . $this->id,
@@ -724,5 +728,5 @@
 			);
 
-			// Invitations
+			// Invitations.
 			$wp_admin_nav[] = array(
 				'parent' => 'my-account-' . $this->id,
@@ -732,5 +736,5 @@
 			);
 
-			// Create a Group
+			// Create a Group.
 			if ( bp_user_can_create_groups() ) {
 				$wp_admin_nav[] = array(
@@ -793,5 +797,5 @@
 	public function setup_cache_groups() {
 
-		// Global groups
+		// Global groups.
 		wp_cache_add_global_groups( array(
 			'bp_groups',
Index: /trunk/src/bp-groups/bp-groups-notifications.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-notifications.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-notifications.php	(revision 10373)
@@ -66,5 +66,5 @@
 	foreach ( (array) $user_ids as $user_id ) {
 
-		// Continue if member opted out of receiving this email
+		// Continue if member opted out of receiving this email.
 		if ( 'no' === bp_get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) {
 			continue;
@@ -73,5 +73,5 @@
 		$ud = bp_core_get_core_userdata( $user_id );
 
-		// Set up and send the message
+		// Set up and send the message.
 		$to = $ud->user_email;
 
@@ -150,10 +150,9 @@
  * @param int $group_id           ID of the group.
  * @param int $membership_id      ID of the group membership object.
- *
  * @return false|null False on failure.
  */
 function groups_notification_new_membership_request( $requesting_user_id = 0, $admin_id = 0, $group_id = 0, $membership_id = 0 ) {
 
-	// Trigger a BuddyPress Notification
+	// Trigger a BuddyPress Notification.
 	if ( bp_is_active( 'notifications' ) ) {
 		bp_notifications_add_notification( array(
@@ -166,22 +165,22 @@
 	}
 
-	// Bail if member opted out of receiving this email
+	// Bail if member opted out of receiving this email.
 	if ( 'no' === bp_get_user_meta( $admin_id, 'notification_groups_membership_request', true ) ) {
 		return false;
 	}
 
-	// Username of the user requesting a membership: %1$s in mail
+	// Username of the user requesting a membership: %1$s in mail.
 	$requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
 	$group                = groups_get_group( array( 'group_id' => $group_id ) );
 
-	// Group Administrator user's data
+	// Group Administrator user's data.
 	$ud             = bp_core_get_core_userdata( $admin_id );
 	$group_requests = bp_get_group_permalink( $group ) . 'admin/membership-requests';
 
-	// Link to the user's profile who's requesting a membership: %3$s in mail
+	// Link to the user's profile who's requesting a membership: %3$s in mail.
 	$profile_link   = bp_core_get_user_domain( $requesting_user_id );
 
 	$settings_slug  = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
-	// Link to the group administrator email settings: %s in "disable notifications" part of the email
+	// Link to the group administrator email settings: %s in "disable notifications" part of the email.
 	$settings_link  = bp_core_get_user_domain( $admin_id ) . $settings_slug . '/notifications/';
 
@@ -189,5 +188,5 @@
 	$membership = new BP_Groups_Member( false, false, $membership_id );
 
-	// Set up and send the message
+	// Set up and send the message.
 	$to       = $ud->user_email;
 	$subject  = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group: %s', 'buddypress' ), $group->name ) ) );
@@ -225,5 +224,5 @@
 	}
 
-	// Only show the disable notifications line if the settings component is enabled
+	// Only show the disable notifications line if the settings component is enabled.
 	if ( bp_is_active( 'settings' ) ) {
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
@@ -289,13 +288,12 @@
  * @param bool $accepted           Optional. Whether the membership request was accepted.
  *                                 Default: true.
- *
  * @return false|null
  */
 function groups_notification_membership_request_completed( $requesting_user_id = 0, $group_id = 0, $accepted = true ) {
 
-	// Trigger a BuddyPress Notification
+	// Trigger a BuddyPress Notification.
 	if ( bp_is_active( 'notifications' ) ) {
 
-		// What type of acknowledgement
+		// What type of acknowledgement.
 		$type = ! empty( $accepted )
 			? 'membership_request_accepted'
@@ -310,5 +308,5 @@
 	}
 
-	// Bail if member opted out of receiving this email
+	// Bail if member opted out of receiving this email.
 	if ( 'no' === bp_get_user_meta( $requesting_user_id, 'notification_membership_request_completed', true ) ) {
 		return false;
@@ -322,5 +320,5 @@
 	$to            = $ud->user_email;
 
-	// Set up and send the message
+	// Set up and send the message.
 	if ( ! empty( $accepted ) ) {
 		$subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name ) ) );
@@ -344,5 +342,5 @@
 	}
 
-	// Only show the disable notifications line if the settings component is enabled
+	// Only show the disable notifications line if the settings component is enabled.
 	if ( bp_is_active( 'settings' ) ) {
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
@@ -404,5 +402,4 @@
  * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
- *
  * @return false|null False on failure.
  */
@@ -418,5 +415,5 @@
 	}
 
-	// Trigger a BuddyPress Notification
+	// Trigger a BuddyPress Notification.
 	if ( bp_is_active( 'notifications' ) ) {
 		bp_notifications_add_notification( array(
@@ -428,5 +425,5 @@
 	}
 
-	// Bail if admin opted out of receiving this email
+	// Bail if admin opted out of receiving this email.
 	if ( 'no' === bp_get_user_meta( $user_id, 'notification_groups_admin_promotion', true ) ) {
 		return false;
@@ -439,5 +436,5 @@
 	$settings_link = bp_core_get_user_domain( $user_id ) . $settings_slug . '/notifications/';
 
-	// Set up and send the message
+	// Set up and send the message.
 	$to       = $ud->user_email;
 	$subject  = bp_get_email_subject( array( 'text' => sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name ) ) );
@@ -450,5 +447,5 @@
 ', 'buddypress' ), $promoted_to, $group->name, $group_link );
 
-	// Only show the disable notifications line if the settings component is enabled
+	// Only show the disable notifications line if the settings component is enabled.
 	if ( bp_is_active( 'settings' ) ) {
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
@@ -511,10 +508,9 @@
  * @param BP_Groups_Member $member          Member object.
  * @param int              $inviter_user_id ID of the user who sent the invite.
- *
  * @return null|false False on failure.
  */
 function groups_notification_group_invites( &$group, &$member, $inviter_user_id ) {
 
-	// Bail if member has already been invited
+	// Bail if member has already been invited.
 	if ( ! empty( $member->invite_sent ) ) {
 		return;
@@ -527,8 +523,8 @@
 	$group_link   = bp_get_group_permalink( $group );
 
-	// Setup the ID for the invited user
+	// Setup the ID for the invited user.
 	$invited_user_id = $member->user_id;
 
-	// Trigger a BuddyPress Notification
+	// Trigger a BuddyPress Notification.
 	if ( bp_is_active( 'notifications' ) ) {
 		bp_notifications_add_notification( array(
@@ -540,5 +536,5 @@
 	}
 
-	// Bail if member opted out of receiving this email
+	// Bail if member opted out of receiving this email.
 	if ( 'no' === bp_get_user_meta( $invited_user_id, 'notification_groups_invite', true ) ) {
 		return false;
@@ -551,5 +547,5 @@
 	$invites_link  = trailingslashit( $invited_link . bp_get_groups_slug() . '/invites' );
 
-	// Set up and send the message
+	// Set up and send the message.
 	$to       = $invited_ud->user_email;
 	$subject  = bp_get_email_subject( array( 'text' => sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name ) ) );
@@ -566,5 +562,5 @@
 ', 'buddypress' ), $inviter_name, $group->name, $invites_link, $group_link, $inviter_name, $inviter_link );
 
-	// Only show the disable notifications line if the settings component is enabled
+	// Only show the disable notifications line if the settings component is enabled.
 	if ( bp_is_active( 'settings' ) ) {
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
@@ -634,5 +630,4 @@
  * @param string $format            'string' for BuddyBar-compatible notifications; 'array'
  *                                  for WP Toolbar. Default: 'string'.
- *
  * @return string
  */
@@ -649,6 +644,6 @@
 
 			// Set up the string and the filter
-			// Because different values are passed to the filters, we'll return the
-			// values inline
+			// because different values are passed to the filters,
+			// we'll return values inline.
 			if ( (int) $total_items > 1 ) {
 				$text = sprintf( __( '%1$d new membership requests for the group "%2$s"', 'buddypress' ), (int) $total_items, $group->name );
@@ -1261,12 +1256,12 @@
 function bp_groups_screen_my_groups_mark_notifications() {
 
-	// Delete group request notifications for the user
+	// Delete group request notifications for the user.
 	if ( isset( $_GET['n'] ) && bp_is_active( 'notifications' ) ) {
 
-		// Get the necessary ID's
+		// Get the necessary ID's.
 		$group_id = buddypress()->groups->id;
 		$user_id  = bp_loggedin_user_id();
 
-		// Mark notifications read
+		// Mark notifications read.
 		bp_notifications_mark_notifications_by_type( $user_id, $group_id, 'membership_request_accepted' );
 		bp_notifications_mark_notifications_by_type( $user_id, $group_id, 'membership_request_rejected' );
Index: /trunk/src/bp-groups/bp-groups-screens.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-screens.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-screens.php	(revision 10373)
@@ -69,5 +69,5 @@
 
 	if ( bp_is_action_variable( 'accept' ) && is_numeric( $group_id ) ) {
-		// Check the nonce
+		// Check the nonce.
 		if ( !check_admin_referer( 'groups_accept_invite' ) )
 			return false;
@@ -78,5 +78,5 @@
 			bp_core_add_message( __('Group invite accepted', 'buddypress') );
 
-			// Record this in activity streams
+			// Record this in activity streams.
 			$group = groups_get_group( array( 'group_id' => $group_id ) );
 
@@ -96,5 +96,5 @@
 
 	} elseif ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) {
-		// Check the nonce
+		// Check the nonce.
 		if ( !check_admin_referer( 'groups_reject_invite' ) )
 			return false;
@@ -183,5 +183,5 @@
 		return false;
 
-	// Fetch the details we need
+	// Fetch the details we need.
 	$topic_slug	= (string)bp_action_variable( 1 );
 	$topic_id       = bp_forums_get_topic_id_from_slug( $topic_slug );
@@ -194,10 +194,10 @@
 	if ( !empty( $topic_slug ) && !empty( $topic_id ) ) {
 
-		// Posting a reply
+		// Posting a reply.
 		if ( !$user_is_banned && !bp_action_variable( 2 ) && isset( $_POST['submit_reply'] ) ) {
-			// Check the nonce
+			// Check the nonce.
 			check_admin_referer( 'bp_forums_new_reply' );
 
-			// Auto join this user if they are not yet a member of this group
+			// Auto join this user if they are not yet a member of this group.
 			if ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
 				groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() );
@@ -206,5 +206,5 @@
 			$topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false;
 
-			// Don't allow reply flooding
+			// Don't allow reply flooding.
 			if ( bp_forums_reply_exists( $_POST['reply_text'], $topic_id, bp_loggedin_user_id() ) ) {
 				bp_core_add_message( __( 'It looks like you\'ve already said that!', 'buddypress' ), 'error' );
@@ -228,7 +228,7 @@
 		}
 
-		// Sticky a topic
+		// Sticky a topic.
 		elseif ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
-			// Check the nonce
+			// Check the nonce.
 			check_admin_referer( 'bp_forums_stick_topic' );
 
@@ -250,7 +250,7 @@
 		}
 
-		// Un-Sticky a topic
+		// Un-Sticky a topic.
 		elseif ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
-			// Check the nonce
+			// Check the nonce.
 			check_admin_referer( 'bp_forums_unstick_topic' );
 
@@ -272,7 +272,7 @@
 		}
 
-		// Close a topic
+		// Close a topic.
 		elseif ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
-			// Check the nonce
+			// Check the nonce.
 			check_admin_referer( 'bp_forums_close_topic' );
 
@@ -294,7 +294,7 @@
 		}
 
-		// Open a topic
+		// Open a topic.
 		elseif ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
-			// Check the nonce
+			// Check the nonce.
 			check_admin_referer( 'bp_forums_open_topic' );
 
@@ -316,7 +316,7 @@
 		}
 
-		// Delete a topic
+		// Delete a topic.
 		elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) {
-			// Fetch the topic
+			// Fetch the topic.
 			$topic = bp_forums_get_topic_details( $topic_id );
 
@@ -326,5 +326,5 @@
 			}
 
-			// Check the nonce
+			// Check the nonce.
 			check_admin_referer( 'bp_forums_delete_topic' );
 
@@ -355,10 +355,10 @@
 		}
 
-		// Editing a topic
+		// Editing a topic.
 		elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) {
-			// Fetch the topic
+			// Fetch the topic.
 			$topic = bp_forums_get_topic_details( $topic_id );
 
-			// Check the logged in user can edit this topic
+			// Check the logged in user can edit this topic.
 			if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) ) {
 				bp_core_redirect( wp_get_referer() );
@@ -366,5 +366,5 @@
 
 			if ( isset( $_POST['save_changes'] ) ) {
-				// Check the nonce
+				// Check the nonce.
 				check_admin_referer( 'bp_forums_edit_topic' );
 
@@ -397,15 +397,15 @@
 			bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
 
-		// Delete a post
+		// Delete a post.
 		} elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) {
-			// Fetch the post
+			// Fetch the post.
 			$post = bp_forums_get_post( $post_id );
 
-			// Check the logged in user can edit this topic
+			// Check the logged in user can edit this topic.
 			if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) ) {
 				bp_core_redirect( wp_get_referer() );
 			}
 
-			// Check the nonce
+			// Check the nonce.
 			check_admin_referer( 'bp_forums_delete_post' );
 
@@ -435,11 +435,11 @@
 			bp_core_redirect( wp_get_referer() );
 
-		// Editing a post
+		// Editing a post.
 		} elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) {
 
-			// Fetch the post
+			// Fetch the post.
 			$post = bp_forums_get_post( $post_id );
 
-			// Check the logged in user can edit this topic
+			// Check the logged in user can edit this topic.
 			if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) ) {
 				bp_core_redirect( wp_get_referer() );
@@ -447,5 +447,5 @@
 
 			if ( isset( $_POST['save_changes'] ) ) {
-				// Check the nonce
+				// Check the nonce.
 				check_admin_referer( 'bp_forums_edit_post' );
 
@@ -476,5 +476,5 @@
 			bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
 
-		// Standard topic display
+		// Standard topic display.
 		} else {
 			if ( !empty( $user_is_banned ) ) {
@@ -492,5 +492,5 @@
 		}
 
-	// Forum topic does not exist
+	// Forum topic does not exist.
 	} elseif ( !empty( $topic_slug ) && empty( $topic_id ) ) {
 		bp_do_404();
@@ -498,8 +498,8 @@
 
 	} else {
-		// Posting a topic
+		// Posting a topic.
 		if ( isset( $_POST['submit_topic'] ) && bp_is_active( 'forums' ) ) {
 
-			// Check the nonce
+			// Check the nonce.
 			check_admin_referer( 'bp_forums_new_topic' );
 
@@ -508,5 +508,5 @@
 
 			} elseif ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
-				// Auto join this user if they are not yet a member of this group
+				// Auto join this user if they are not yet a member of this group.
 				groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() );
 			}
@@ -569,5 +569,5 @@
 	$bp = buddypress();
 
-	// Refresh the group member count meta
+	// Refresh the group member count meta.
 	groups_update_groupmeta( $bp->groups->current_group->id, 'total_member_count', groups_get_total_member_count( $bp->groups->current_group->id ) );
 
@@ -698,5 +698,5 @@
 		return false;
 
-	// If the user is already invited, accept invitation
+	// If the user is already invited, accept invitation.
 	if ( groups_check_user_has_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
 		if ( groups_accept_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) )
@@ -710,5 +710,5 @@
 	if ( isset( $_POST['group-request-send']) ) {
 
-		// Check the nonce
+		// Check the nonce.
 		if ( !check_admin_referer( 'groups_request_membership' ) )
 			return false;
@@ -809,7 +809,7 @@
 		$bp = buddypress();
 
-		// If the edit form has been submitted, save the edited details
+		// If the edit form has been submitted, save the edited details.
 		if ( isset( $_POST['save'] ) ) {
-			// Check the nonce
+			// Check the nonce.
 			if ( !check_admin_referer( 'groups_edit_group_details' ) )
 				return false;
@@ -869,19 +869,19 @@
 	$bp = buddypress();
 
-	// If the edit form has been submitted, save the edited details
+	// If the edit form has been submitted, save the edited details.
 	if ( isset( $_POST['save'] ) ) {
 		$enable_forum   = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0;
 
-		// Checked against a whitelist for security
+		// Checked against a whitelist for security.
 		/** This filter is documented in bp-groups/bp-groups-admin.php */
 		$allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
 		$status         = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public';
 
-		// Checked against a whitelist for security
+		// Checked against a whitelist for security.
 		/** This filter is documented in bp-groups/bp-groups-admin.php */
 		$allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
 		$invite_status	       = isset( $_POST['group-invite-status'] ) && in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
 
-		// Check the nonce
+		// Check the nonce.
 		if ( !check_admin_referer( 'groups_edit_group_settings' ) )
 			return false;
@@ -933,5 +933,5 @@
 		return false;
 
-	// If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
+	// If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here.
 	if ( ! bp_is_item_admin() || bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars )
 		return false;
@@ -939,8 +939,8 @@
 	$bp = buddypress();
 
-	// If the group admin has deleted the admin avatar
+	// If the group admin has deleted the admin avatar.
 	if ( bp_is_action_variable( 'delete', 1 ) ) {
 
-		// Check the nonce
+		// Check the nonce.
 		check_admin_referer( 'bp_group_avatar_delete' );
 
@@ -960,12 +960,12 @@
 	if ( !empty( $_FILES ) ) {
 
-		// Check the nonce
+		// Check the nonce.
 		check_admin_referer( 'bp_avatar_upload' );
 
-		// Pass the file to the avatar upload handler
+		// Pass the file to the avatar upload handler.
 		if ( bp_core_avatar_handle_upload( $_FILES, 'groups_avatar_upload_dir' ) ) {
 			$bp->avatar_admin->step = 'crop-image';
 
-			// Make sure we include the jQuery jCrop file for image cropping
+			// Make sure we include the jQuery jCrop file for image cropping.
 			add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' );
 		}
@@ -973,8 +973,8 @@
 	}
 
-	// If the image cropping is done, crop the image and save a full/thumb version
+	// If the image cropping is done, crop the image and save a full/thumb version.
 	if ( isset( $_POST['avatar-crop-submit'] ) ) {
 
-		// Check the nonce
+		// Check the nonce.
 		check_admin_referer( 'bp_avatar_cropstore' );
 
@@ -1027,5 +1027,5 @@
 	}
 
-	// If the logged-in user doesn't have permission or if cover image uploads are disabled, then stop here
+	// If the logged-in user doesn't have permission or if cover image uploads are disabled, then stop here.
 	if ( ! bp_is_item_admin() || ! bp_group_use_cover_image_header() ) {
 		return false;
@@ -1102,5 +1102,5 @@
 				return false;
 
-			// Stop sole admins from abandoning their group
+			// Stop sole admins from abandoning their group.
 			$group_admins = groups_get_group_admins( $bp->groups->current_group->id );
 			if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == $user_id )
@@ -1249,5 +1249,5 @@
 				return false;
 
-			// Accept the membership request
+			// Accept the membership request.
 			if ( !groups_accept_membership_request( $membership_id ) )
 				bp_core_add_message( __( 'There was an error accepting the membership request. Please try again.', 'buddypress' ), 'error' );
@@ -1260,5 +1260,5 @@
 				return false;
 
-			// Reject the membership request
+			// Reject the membership request.
 			if ( !groups_reject_membership_request( $membership_id ) )
 				bp_core_add_message( __( 'There was an error rejecting the membership request. Please try again.', 'buddypress' ), 'error' );
@@ -1467,9 +1467,9 @@
 	public function is_group() {
 
-		// Bail if not looking at a group
+		// Bail if not looking at a group.
 		if ( ! bp_is_groups_component() )
 			return;
 
-		// Group Directory
+		// Group Directory.
 		if ( ! bp_current_action() && ! bp_current_item() ) {
 			bp_update_is_directory( true, 'groups' );
@@ -1486,5 +1486,5 @@
 			add_filter( 'bp_replace_the_content',                    array( $this, 'directory_content'    ) );
 
-		// Creating a group
+		// Creating a group.
 		} elseif ( bp_is_groups_component() && bp_is_current_action( 'create' ) ) {
 			add_filter( 'bp_get_buddypress_template',                array( $this, 'create_template_hierarchy' ) );
@@ -1492,5 +1492,5 @@
 			add_filter( 'bp_replace_the_content',                    array( $this, 'create_content'    ) );
 
-		// Group page
+		// Group page.
 		} elseif ( bp_is_single_item() ) {
 			add_filter( 'bp_get_buddypress_template',                array( $this, 'single_template_hierarchy' ) );
@@ -1527,6 +1527,6 @@
 		) );
 
-		// Merge new templates with existing stack
-		// @see bp_get_theme_compat_templates()
+		// Merge new templates with existing stack.
+		// @see bp_get_theme_compat_templates().
 		$templates = array_merge( (array) $new_templates, $templates );
 
@@ -1573,5 +1573,4 @@
 	 *
 	 * @param string $templates The templates from bp_get_theme_compat_templates().
-	 *
 	 * @return array $templates Array of custom templates to look for.
 	 */
@@ -1589,6 +1588,6 @@
 		) );
 
-		// Merge new templates with existing stack
-		// @see bp_get_theme_compat_templates()
+		// Merge new templates with existing stack.
+		// @see bp_get_theme_compat_templates().
 		$templates = array_merge( $new_templates, $templates );
 
@@ -1641,5 +1640,5 @@
 	 */
 	public function single_template_hierarchy( $templates ) {
-		// Setup some variables we're going to reference in our custom templates
+		// Setup some variables we're going to reference in our custom templates.
 		$group = groups_get_current_group();
 
@@ -1659,6 +1658,6 @@
 		) );
 
-		// Merge new templates with existing stack
-		// @see bp_get_theme_compat_templates()
+		// Merge new templates with existing stack.
+		// @see bp_get_theme_compat_templates().
 		$templates = array_merge( (array) $new_templates, $templates );
 
Index: /trunk/src/bp-groups/bp-groups-template.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-template.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-template.php	(revision 10373)
@@ -197,5 +197,5 @@
 	function __construct( $args = array() ){
 
-		// Backward compatibility with old method of passing arguments
+		// Backward compatibility with old method of passing arguments.
 		if ( ! is_array( $args ) || func_num_args() > 1 ) {
 			_deprecated_argument( __METHOD__, '1.7', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
@@ -265,5 +265,5 @@
 			}
 
-			// backwards compatibility - the 'group_id' variable is not part of the
+			// Backwards compatibility - the 'group_id' variable is not part of the
 			// BP_Groups_Group object, but we add it here for devs doing checks against it
 			//
@@ -271,5 +271,5 @@
 			//
 			// this is subject to removal in a future release; devs should check against
-			// $group->id instead
+			// $group->id instead.
 			$group->group_id = $group->id;
 
@@ -326,5 +326,5 @@
 		}
 
-		// Build pagination links
+		// Build pagination links.
 		if ( (int) $this->total_group_count && (int) $this->pag_num ) {
 			$pag_args = array(
@@ -420,5 +420,5 @@
 			 */
 			do_action('group_loop_end');
-			// Do some cleaning up after the loop
+			// Do some cleaning up after the loop.
 			$this->rewind_groups();
 		}
@@ -499,5 +499,5 @@
 	global $groups_template;
 
-	/***
+	/*
 	 * Defaults based on the current page & overridden by parsed $args
 	 */
@@ -506,5 +506,5 @@
 	$search_terms = false;
 
-	// When looking your own groups, check for two action variables
+	// When looking your own groups, check for two action variables.
 	if ( bp_is_current_action( 'my-groups' ) ) {
 		if ( bp_is_action_variable( 'most-popular', 0 ) ) {
@@ -514,9 +514,9 @@
 		}
 
-	// When looking at invites, set type to invites
+	// When looking at invites, set type to invites.
 	} elseif ( bp_is_current_action( 'invites' ) ) {
 		$type = 'invites';
 
-	// When looking at a single group, set the type and slug
+	// When looking at a single group, set the type and slug.
 	} elseif ( bp_get_current_group_slug() ) {
 		$type = 'single-group';
@@ -524,5 +524,5 @@
 	}
 
-	// Default search string (too soon to escape here)
+	// Default search string (too soon to escape here).
 	$search_query_arg = bp_core_get_component_search_query_arg( 'groups' );
 	if ( ! empty( $_REQUEST[ $search_query_arg ] ) ) {
@@ -534,5 +534,5 @@
 	}
 
-	// Parse defaults and requested arguments
+	// Parse defaults and requested arguments.
 	$r = bp_parse_args( $args, array(
 		'type'              => $type,
@@ -554,5 +554,5 @@
 	), 'has_groups' );
 
-	// Setup the Groups template global
+	// Setup the Groups template global.
 	$groups_template = new BP_Groups_Template( array(
 		'type'              => $r['type'],
@@ -610,5 +610,4 @@
  *
  * @param object|bool $group Optional. Group object. Default: current group in loop.
- *
  * @return bool
  */
@@ -648,5 +647,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return int
 	 */
@@ -684,5 +682,4 @@
 	 *
 	 * @param array $classes Array of custom classes.
-	 *
 	 * @return string Row class of the group.
 	 */
@@ -690,10 +687,10 @@
 		global $groups_template;
 
-		// Add even/odd classes, but only if there's more than 1 group
+		// Add even/odd classes, but only if there's more than 1 group.
 		if ( $groups_template->group_count > 1 ) {
 			$pos_in_loop = (int) $groups_template->current_group;
 			$classes[]   = ( $pos_in_loop % 2 ) ? 'even' : 'odd';
 
-		// If we've only one group in the loop, don't bother with odd and even
+		// If we've only one group in the loop, don't bother with odd and even.
 		} else {
 			$classes[] = 'bp-single-group';
@@ -703,18 +700,18 @@
 		$classes[] = sanitize_key( $groups_template->group->status );
 
-		// User's group role
+		// User's group role.
 		if ( bp_is_user_active() ) {
 
-			// Admin
+			// Admin.
 			if ( bp_group_is_admin() ) {
 				$classes[] = 'is-admin';
 			}
 
-			// Moderator
+			// Moderator.
 			if ( bp_group_is_mod() ) {
 				$classes[] = 'is-mod';
 			}
 
-			// Member
+			// Member.
 			if ( bp_group_is_member() ) {
 				$classes[] = 'is-member';
@@ -757,5 +754,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -792,5 +788,4 @@
  * @param object|bool $group Optional. Group object.
  *                           Default: current group in loop.
- *
  * @return string
  */
@@ -835,5 +830,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -874,5 +868,5 @@
 	 * @see bp_core_fetch_avatar() For a description of arguments and return values.
 
-	 * @param array $args  {
+	 * @param array|string $args {
 	 *     Arguments are listed here with an explanation of their defaults.
 	 *     For more information about the arguments, see {@link bp_core_fetch_avatar()}.
@@ -895,5 +889,5 @@
 		}
 
-		// Parse the arguments
+		// Parse the arguments.
 		$r = bp_parse_args( $args, array(
 			'type'   => 'full',
@@ -905,5 +899,5 @@
 		) );
 
-		// Fetch the avatar from the folder
+		// Fetch the avatar from the folder.
 		$avatar = bp_core_fetch_avatar( array(
 			'item_id'    => $groups_template->group->id,
@@ -919,5 +913,5 @@
 		) );
 
-		// If No avatar found, provide some backwards compatibility
+		// If No avatar found, provide some backwards compatibility.
 		if ( empty( $avatar ) ) {
 			$avatar = '<img src="' . esc_url( $groups_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />';
@@ -953,5 +947,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -981,5 +974,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -996,5 +988,5 @@
 
 /**
- * Should we use the group's cover image header
+ * Should we use the group's cover image header.
  *
  * @since 2.4.0
@@ -1021,5 +1013,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -1066,5 +1057,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -1100,5 +1090,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -1134,5 +1123,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -1168,5 +1156,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -1206,5 +1193,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -1246,5 +1232,4 @@
 	 *                           Defaults to the group currently being
 	 *                           iterated on in the groups loop.
-	 *
 	 * @return string Excerpt.
 	 */
@@ -1285,5 +1270,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -1320,6 +1304,5 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
-	 * @return unknown
+	 * @return mixed
 	 */
 	function bp_get_group_is_public( $group = false ) {
@@ -1347,5 +1330,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -1381,5 +1363,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -1415,5 +1396,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return int
 	 */
@@ -1449,5 +1429,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -1475,5 +1454,4 @@
  *                             Default: current group in loop.
  * @param int         $user_id ID of the user.
- *
  * @return bool
  */
@@ -1589,5 +1567,5 @@
 	}
 
-	// fetch group admins if 'populate_extras' flag is false
+	// Fetch group admins if 'populate_extras' flag is false.
 	if ( empty( $group->args['populate_extras'] ) ) {
 		$query = new BP_Group_Member_Query( array(
@@ -1629,5 +1607,5 @@
 	}
 
-	// fetch group mods if 'populate_extras' flag is false
+	// Fetch group mods if 'populate_extras' flag is false.
 	if ( empty( $group->args['populate_extras'] ) ) {
 		$query = new BP_Group_Member_Query( array(
@@ -1759,5 +1737,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -1784,5 +1761,5 @@
  * No longer used in BuddyPress.
  *
- * @todo Deprecate
+ * @todo Deprecate.
  */
 function bp_group_search_form() {
@@ -1807,5 +1784,5 @@
  * No longer used in BuddyPress.
  *
- * @todo Deprecate
+ * @todo Deprecate.
  *
  * @return bool True if the displayed user has no groups, otherwise false.
@@ -1932,5 +1909,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return int
 	 */
@@ -1995,5 +1971,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in loop.
-	 *
 	 * @return string
 	 */
@@ -2201,5 +2176,5 @@
  *
  * @param string      $setting The setting you want to check against ('members',
- *	                           'mods', or 'admins').
+ *                             'mods', or 'admins').
  * @param object|bool $group   Optional. Group object. Default: current group in loop.
  */
@@ -2230,5 +2205,4 @@
  *                           check. Default: the displayed group, or the current group
  *                           in the loop.
- *
  * @return bool|string Returns false when no group can be found. Otherwise
  *                     returns the group invite status, from among 'members',
@@ -2242,8 +2216,8 @@
 
 		if ( isset( $bp->groups->current_group->id ) ) {
-			// Default to the current group first
+			// Default to the current group first.
 			$group_id = $bp->groups->current_group->id;
 		} elseif ( isset( $groups_template->group->id ) ) {
-			// Then see if we're in the loop
+			// Then see if we're in the loop.
 			$group_id = $groups_template->group->id;
 		} else {
@@ -2254,5 +2228,5 @@
 	$invite_status = groups_get_groupmeta( $group_id, 'invite_status' );
 
-	// Backward compatibility. When 'invite_status' is not set, fall back to a default value
+	// Backward compatibility. When 'invite_status' is not set, fall back to a default value.
 	if ( !$invite_status ) {
 		$invite_status = apply_filters( 'bp_group_invite_status_fallback', 'members' );
@@ -2297,5 +2271,5 @@
 
 	if ( $user_id ) {
-		// Users with the 'bp_moderate' cap can always send invitations
+		// Users with the 'bp_moderate' cap can always send invitations.
 		if ( user_can( $user_id, 'bp_moderate' ) ) {
 			$can_send_invites = true;
@@ -2497,5 +2471,4 @@
  *
  * @param object|bool $group Optional. Group object. Default: current group in loop.
- *
  * @return array Info about group admins (user_id + date_modified).
  */
@@ -2616,5 +2589,4 @@
 	 *                             member in a member loop.
 	 * @param object|bool $group   Optional. Group object. Default: current group.
-	 *
 	 * @return string
 	 */
@@ -2661,5 +2633,4 @@
 	 *                             Default: current member in a member loop.
 	 * @param object|bool $group   Optional. Group object. Default: current group.
-	 *
 	 * @return string
 	 */
@@ -2702,5 +2673,4 @@
 	 *                             Default: current member in a member loop.
 	 * @param object|bool $group   Optional. Group object. Default: current group.
-	 *
 	 * @return string
 	 */
@@ -2747,5 +2717,4 @@
 	 *                             Default: current member in a member loop.
 	 * @param object|bool $group   Optional. Group object. Default: current group.
-	 *
 	 * @return string
 	 */
@@ -2800,5 +2769,4 @@
  * @param  string $subnav_item   subnav item params.
  * @param  string $selected_item Surrent selected tab.
- *
  * @return string HTML output
  */
@@ -2862,5 +2830,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in the loop.
-	 *
 	 * @return string
 	 */
@@ -2896,5 +2863,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in the loop.
-	 *
 	 * @return string
 	 */
@@ -2925,5 +2891,4 @@
  * @param object|bool $group Optional. Group object.
  *                           Default: current group in the loop.
- *
  * @return bool
  */
@@ -2949,5 +2914,4 @@
  * @param object|bool $group Optional. Group to check is_member.
  *                           Default: current group in the loop.
- *
  * @return bool If user is member of group or not.
  */
@@ -2955,5 +2919,5 @@
 	global $groups_template;
 
-	// Site admins always have access
+	// Site admins always have access.
 	if ( bp_current_user_can( 'bp_moderate' ) ) {
 		return true;
@@ -2979,5 +2943,4 @@
  * @param object|bool $group Optional. Group data object.
  *                           Default: the current group in the groups loop.
- *
  * @return bool True if the user has an outstanding invite, otherwise false.
  */
@@ -3018,5 +2981,4 @@
  * @param BP_Groups_Group|bool $group   Group to check if user is banned.
  * @param int                  $user_id The user ID to check.
- *
  * @return bool True if user is banned.  False if user isn't banned.
  */
@@ -3024,17 +2986,17 @@
 	global $groups_template;
 
-	// Site admins always have access
+	// Site admins always have access.
 	if ( bp_current_user_can( 'bp_moderate' ) ) {
 		return false;
 	}
 
-	// check groups loop first
-	// @see BP_Groups_Group::get_group_extras()
+	// Check groups loop first
+	// @see BP_Groups_Group::get_group_extras().
 	if ( ! empty( $groups_template->in_the_loop ) && isset( $groups_template->group->is_banned ) ) {
 		$retval = $groups_template->group->is_banned;
 
-	// not in loop
+	// Not in loop.
 	} else {
-		// Default to not banned
+		// Default to not banned.
 		$retval = false;
 
@@ -3073,5 +3035,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: Current group in the loop.
-	 *
 	 * @return string
 	 */
@@ -3106,5 +3067,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: Current group in the loop.
-	 *
 	 * @return string
 	 */
@@ -3139,5 +3099,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: Current group in the loop.
-	 *
 	 * @return string
 	 */
@@ -3170,5 +3129,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: Current group in the loop.
-	 *
 	 * @return string
 	 */
@@ -3201,5 +3159,4 @@
 	 * @param object|bool $group Optional. Group object.
 	 *                           Default: current group in the loop.
-	 *
 	 * @return string
 	 */
@@ -3226,5 +3183,4 @@
  * @param object|bool $group Optional. Group object.
  *                           Default: current group in the loop.
- *
  * @return bool
  */
@@ -3266,5 +3222,4 @@
 	 * @param BP_Groups_Group|bool $group The BP Groups_Group object if
 	 *                                    passed, boolean false if not passed.
-	 *
 	 * @return string HTML code for the button.
 	 */
@@ -3319,5 +3274,4 @@
 	 *
 	 * @param object|bool $group Single group object.
-	 *
 	 * @return mixed
 	 */
@@ -3325,23 +3279,23 @@
 		global $groups_template;
 
-		// Set group to current loop group if none passed
+		// Set group to current loop group if none passed.
 		if ( empty( $group ) ) {
 			$group =& $groups_template->group;
 		}
 
-		// Don't show button if not logged in or previously banned
+		// Don't show button if not logged in or previously banned.
 		if ( ! is_user_logged_in() || bp_group_is_user_banned( $group ) ) {
 			return false;
 		}
 
-		// Group creation was not completed or status is unknown
+		// Group creation was not completed or status is unknown.
 		if ( empty( $group->status ) ) {
 			return false;
 		}
 
-		// Already a member
+		// Already a member.
 		if ( ! empty( $group->is_member ) ) {
 
-			// Stop sole admins from abandoning their group
+			// Stop sole admins from abandoning their group.
 			$group_admins = groups_get_group_admins( $group->id );
 			if ( ( 1 == count( $group_admins ) ) && ( bp_loggedin_user_id() === (int) $group_admins[0]->user_id ) ) {
@@ -3349,5 +3303,5 @@
 			}
 
-			// Setup button attributes
+			// Setup button attributes.
 			$button = array(
 				'id'                => 'leave_group',
@@ -3363,8 +3317,8 @@
 			);
 
-		// Not a member
+		// Not a member.
 		} else {
 
-			// Show different buttons based on group status
+			// Show different buttons based on group status.
 			switch ( $group->status ) {
 				case 'hidden' :
@@ -3389,5 +3343,5 @@
 
 					// Member has outstanding invitation -
-					// show an "Accept Invitation" button
+					// show an "Accept Invitation" button.
 					if ( $group->is_invited ) {
 						$button = array(
@@ -3405,5 +3359,5 @@
 
 					// Member has requested membership but request is pending -
-					// show a "Request Sent" button
+					// show a "Request Sent" button.
 					} elseif ( $group->is_pending ) {
 						$button = array(
@@ -3421,5 +3375,5 @@
 
 					// Member has not requested membership yet -
-					// show a "Request Membership" button
+					// show a "Request Membership" button.
 					} else {
 						$button = array(
@@ -3515,8 +3469,8 @@
 	 */
 	function bp_get_group_create_nav_item() {
-		// Get the create a group button
+		// Get the create a group button.
 		$create_group_button = bp_get_group_create_button();
 
-		// Make sure the button is available
+		// Make sure the button is available.
 		if ( empty( $create_group_button ) ) {
 			return;
@@ -3541,14 +3495,15 @@
  * @since 2.2.0
  *
- * @uses   bp_group_create_nav_item() to output the create a Group nav item.
+ * @uses bp_group_create_nav_item() to output the create a Group nav item.
+ *
  * @return string HTML Output
  */
 function bp_group_backcompat_create_nav_item() {
-	// Bail if the Groups nav item is already used by bp-legacy
+	// Bail if the Groups nav item is already used by bp-legacy.
 	if ( has_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_nav', 999 ) ) {
 		return;
 	}
 
-	// Bail if the theme is not filtering the Groups directory title
+	// Bail if the theme is not filtering the Groups directory title.
 	if ( ! has_filter( 'bp_groups_directory_header' ) ) {
 		return;
@@ -3566,4 +3521,5 @@
  *
  * @global BP_Groups_Template $groups_template Groups template object.
+ *
  * @param object $group Group to get status message for. Optional; defaults to current group.
  */
@@ -3571,18 +3527,18 @@
 	global $groups_template;
 
-	// Group not passed so look for loop
+	// Group not passed so look for loop.
 	if ( empty( $group ) ) {
 		$group =& $groups_template->group;
 	}
 
-	// Group status is not set (maybe outside of group loop?)
+	// Group status is not set (maybe outside of group loop?).
 	if ( empty( $group->status ) ) {
 		$message = __( 'This group is not currently accessible.', 'buddypress' );
 
-	// Group has a status
+	// Group has a status.
 	} else {
 		switch( $group->status ) {
 
-			// Private group
+			// Private group.
 			case 'private' :
 				if ( ! bp_group_has_requested_membership( $group ) ) {
@@ -3602,5 +3558,5 @@
 				break;
 
-			// Hidden group
+			// Hidden group.
 			case 'hidden' :
 			default :
@@ -3656,4 +3612,5 @@
 	 *
 	 * @since 1.0.0
+	 *
 	 * @return type
 	 */
@@ -3688,5 +3645,4 @@
 	 *
 	 * @param int $user_id User ID to get group membership count.
-	 *
 	 * @return int
 	 */
@@ -3705,5 +3661,5 @@
 	}
 
-/** Group Members *************************************************************/
+/* Group Members *************************************************************/
 
 class BP_Groups_Group_Members_Template {
@@ -3726,5 +3682,5 @@
 	 *     An array of optional arguments.
 	 *     @type int      $group_id           ID of the group whose members are being
-	 *	                                      queried. Default: current group ID.
+	 *                                        queried. Default: current group ID.
 	 *     @type int      $page               Page of results to be queried. Default: 1.
 	 *     @type int      $per_page           Number of items to return per page of
@@ -3742,5 +3698,5 @@
 	public function __construct( $args = array() ) {
 
-		// Backward compatibility with old method of passing arguments
+		// Backward compatibility with old method of passing arguments.
 		if ( ! is_array( $args ) || func_num_args() > 1 ) {
 			_deprecated_argument( __METHOD__, '2.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
@@ -3787,5 +3743,5 @@
 		}
 
-		// Assemble the base URL for pagination
+		// Assemble the base URL for pagination.
 		$base_url = trailingslashit( bp_get_group_permalink( $current_group ) . bp_current_action() );
 		if ( bp_action_variable() ) {
@@ -3798,5 +3754,5 @@
 		$members_args['per_page'] = $this->pag_num;
 
-		// Get group members for this loop
+		// Get group members for this loop.
 		$this->members = groups_get_group_members( $members_args );
 
@@ -3807,5 +3763,5 @@
 		}
 
-		// Reset members array for subsequent looping
+		// Reset members array for subsequent looping.
 		$this->members = $this->members['members'];
 
@@ -3866,5 +3822,5 @@
 			do_action( 'loop_end', $this );
 
-			// Do some cleaning up after the loop
+			// Do some cleaning up after the loop.
 			$this->rewind_members();
 		}
@@ -3878,5 +3834,5 @@
 		$this->member      = $this->next_member();
 
-		// loop has just started
+		// Loop has just started.
 		if ( 0 == $this->current_member ) {
 
@@ -3977,5 +3933,5 @@
  * @since 1.0.0
  *
- * @param array|string $args {@see bp_core_fetch_avatar()}
+ * @param array|string $args {@see bp_core_fetch_avatar()}.
  */
 function bp_group_member_avatar( $args = '' ) {
@@ -3987,6 +3943,5 @@
 	 * @since 1.0.0
 	 *
-	 * @param array|string $args {@see bp_core_fetch_avatar()}
-	 *
+	 * @param array|string $args {@see bp_core_fetch_avatar()}.
 	 * @return string
 	 */
@@ -4017,7 +3972,6 @@
  * @since 1.0.0
  *
- * @param array|string $args {@see bp_core_fetch_avatar()}
- */
-
+ * @param array|string $args {@see bp_core_fetch_avatar()}.
+ */
 function bp_group_member_avatar_thumb( $args = '' ) {
 	echo bp_get_group_member_avatar_thumb( $args );
@@ -4028,6 +3982,5 @@
 	 * @since 1.0.0
 	 *
-	 * @param array|string $args {@see bp_core_fetch_avatar()}
-	 *
+	 * @param array|string $args {@see bp_core_fetch_avatar()}.
 	 * @return string
 	 */
@@ -4071,5 +4024,4 @@
 	 * @param int $width  Width of avatar to fetch.
 	 * @param int $height Height of avatar to fetch.
-	 *
 	 * @return string
 	 */
@@ -4399,6 +4351,4 @@
  *
  * @since 2.0.0
- *
- * @return string html output
  */
 function bp_groups_members_template_part() {
@@ -4437,6 +4387,4 @@
  *
  * @since 2.0.0
- *
- * @return string html output
  */
 function bp_groups_members_filter() {
@@ -4470,7 +4418,7 @@
 }
 
-/***************************************************************************
+/*
  * Group Creation Process Template Tags
- **/
+ */
 
 /**
@@ -4482,18 +4430,17 @@
  * @uses bp_get_option() To retrieve value of 'bp_restrict_group_creation'. Defaults to 0.
  * @uses bp_current_user_can() To determine if current user if super admin.
- *
  * @return bool True if user can create groups. False otherwise.
  */
 function bp_user_can_create_groups() {
 
-	// Super admin can always create groups
+	// Super admin can always create groups.
 	if ( bp_current_user_can( 'bp_moderate' ) ) {
 		return true;
 	}
 
-	// Get group creation option, default to 0 (allowed)
+	// Get group creation option, default to 0 (allowed).
 	$restricted = (int) bp_get_option( 'bp_restrict_group_creation', 0 );
 
-	// Allow by default
+	// Allow by default.
 	$can_create = true;
 
@@ -4581,5 +4528,5 @@
 function bp_is_group_creation_step( $step_slug ) {
 
-	// Make sure we are in the groups component
+	// Make sure we are in the groups component.
 	if ( ! bp_is_groups_component() || ! bp_is_current_action( 'create' ) ) {
 		return false;
@@ -4588,5 +4535,5 @@
 	$bp = buddypress();
 
-	// If this the first step, we can just accept and return true
+	// If this the first step, we can just accept and return true.
 	$keys = array_keys( $bp->groups->group_creation_steps );
 	if ( !bp_action_variable( 1 ) && array_shift( $keys ) == $step_slug ) {
@@ -4595,5 +4542,5 @@
 
 	// Before allowing a user to see a group creation step we must make sure
-	// previous steps are completed
+	// previous steps are completed.
 	if ( !bp_is_first_group_creation_step() ) {
 		if ( !bp_are_previous_group_creation_steps_complete( $step_slug ) ) {
@@ -4602,5 +4549,5 @@
 	}
 
-	// Check the current step against the step parameter
+	// Check the current step against the step parameter.
 	if ( bp_is_action_variable( $step_slug ) ) {
 		return true;
@@ -4637,5 +4584,5 @@
 	$bp = buddypress();
 
-	// If this is the first group creation step, return true
+	// If this is the first group creation step, return true.
 	$keys = array_keys( $bp->groups->group_creation_steps );
 	if ( array_shift( $keys ) == $step_slug ) {
@@ -4647,5 +4594,5 @@
 	$previous_steps = array();
 
-	// Get previous steps
+	// Get previous steps.
 	foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) {
 		if ( $slug === $step_slug ) {
@@ -4761,5 +4708,5 @@
  * @see bp_core_fetch_avatar() For more information on accepted arguments
  *
- * @param  array  $args See bp_core_fetch_avatar()
+ * @param array|string $args See bp_core_fetch_avatar().
  */
 function bp_new_group_avatar( $args = '' ) {
@@ -4773,5 +4720,5 @@
 	 * @see bp_core_fetch_avatar() For a description of arguments and return values.
 	 *
-	 * @param array $args  {
+	 * @param array|string $args {
 	 *     Arguments are listed here with an explanation of their defaults.
 	 *     For more information about the arguments, see {@link bp_core_fetch_avatar()}.
@@ -4788,5 +4735,5 @@
 	function bp_get_new_group_avatar( $args = '' ) {
 
-		// Parse arguments
+		// Parse arguments.
 		$r = bp_parse_args( $args, array(
 			'type'    => 'full',
@@ -4799,5 +4746,5 @@
 		), 'get_new_group_avatar' );
 
-		// Merge parsed arguments with object specific data
+		// Merge parsed arguments with object specific data.
 		$r = array_merge( $r, array(
 			'item_id'    => bp_get_current_group_id(),
@@ -4806,5 +4753,5 @@
 		) );
 
-		// Get the avatar
+		// Get the avatar.
 		$avatar = bp_core_fetch_avatar( $r );
 
@@ -4840,17 +4787,17 @@
 		$steps = array_keys( $bp->groups->group_creation_steps );
 
-		// Loop through steps
+		// Loop through steps.
 		foreach ( $steps as $slug ) {
 
-			// Break when the current step is found
+			// Break when the current step is found.
 			if ( bp_is_action_variable( $slug ) ) {
 				break;
 			}
 
-			// Add slug to previous steps
+			// Add slug to previous steps.
 			$previous_steps[] = $slug;
 		}
 
-		// Generate the URL for the previous step
+		// Generate the URL for the previous step.
 		$group_directory = bp_get_groups_directory_permalink();
 		$create_step     = 'create/step/';
@@ -4911,20 +4858,20 @@
  * @since 1.1.0
  *
- * @param  string $step Step to compare
- * @return bool         True if yes, False if no
+ * @param string $step Step to compare.
+ * @return bool True if yes, False if no
  */
 function bp_is_last_group_creation_step( $step = '' ) {
 
-	// Use current step, if no step passed
+	// Use current step, if no step passed.
 	if ( empty( $step ) ) {
 		$step = bp_get_groups_current_create_step();
 	}
 
-	// Get the last step
+	// Get the last step.
 	$bp     = buddypress();
 	$steps  = array_keys( $bp->groups->group_creation_steps );
 	$l_step = array_pop( $steps );
 
-	// Compare last step to step
+	// Compare last step to step.
 	$retval = ( $l_step === $step );
 
@@ -4946,20 +4893,20 @@
  * @since 1.1.0
  *
- * @param  string $step Step to compare
- * @return bool         True if yes, False if no
+ * @param string $step Step to compare.
+ * @return bool True if yes, False if no
  */
 function bp_is_first_group_creation_step( $step = '' ) {
 
-	// Use current step, if no step passed
+	// Use current step, if no step passed.
 	if ( empty( $step ) ) {
 		$step = bp_get_groups_current_create_step();
 	}
 
-	// Get the first step
+	// Get the first step.
 	$bp     = buddypress();
 	$steps  = array_keys( $bp->groups->group_creation_steps );
 	$f_step = array_shift( $steps );
 
-	// Compare first step to step
+	// Compare first step to step.
 	$retval = ( $f_step === $step );
 
@@ -4980,4 +4927,6 @@
  *
  * @since 1.0.0
+ *
+ * @param array $args Array of arguments for friends list output.
  */
 function bp_new_group_invite_friend_list( $args = array() ) {
@@ -4989,15 +4938,15 @@
 	 * @since 1.0.0
 	 *
-	 * @param  array $args
+	 * @param array $args Array of arguments for friends list output.
 	 * @return mixed HTML list of checkboxes, or false
 	 */
 	function bp_get_new_group_invite_friend_list( $args = array() ) {
 
-		// Bail if no friends component
+		// Bail if no friends component.
 		if ( ! bp_is_active( 'friends' ) ) {
 			return false;
 		}
 
-		// Parse arguments
+		// Parse arguments.
 		$r = wp_parse_args( $args, array(
 			'user_id'   => bp_loggedin_user_id(),
@@ -5006,5 +4955,5 @@
 		) );
 
-		// No group passed, so look for new or current group ID's
+		// No group passed, so look for new or current group ID's.
 		if ( empty( $r['group_id'] ) ) {
 			$bp            = buddypress();
@@ -5014,13 +4963,13 @@
 		}
 
-		// Setup empty items array
+		// Setup empty items array.
 		$items = array();
 
-		// Get user's friends who are not in this group already
+		// Get user's friends who are not in this group already.
 		$friends = friends_get_friends_invite_list( $r['user_id'], $r['group_id'] );
 
 		if ( ! empty( $friends ) ) {
 
-			// Get already invited users
+			// Get already invited users.
 			$invites = groups_get_invites_for_group( $r['user_id'], $r['group_id'] );
 
@@ -5132,6 +5081,5 @@
  * @since 1.1.0
  *
- * @param string $slug
- *
+ * @param string $slug Admin screen slug.
  * @return bool
  */
@@ -5180,6 +5128,8 @@
  *
  * @since 1.0.0
- * @param string $type thumb or full ?
+ *
  * @uses bp_get_group_current_avatar() to get the avatar of the current group.
+ *
+ * @param string $type Thumb or full.
  */
 function bp_group_current_avatar( $type = 'thumb' ) {
@@ -5191,5 +5141,5 @@
 	 * @since 2.0.0
 	 *
-	 * @param string $type thumb or full ?
+	 * @param string $type Thumb or full.
 	 * @return string $tab The current tab's slug.
 	 */
@@ -5220,6 +5170,5 @@
  * @since 1.1.0
  *
- * @param  int|bool $group_id
- *
+ * @param int|bool $group_id Group ID to check.
  * @return boolean
  */
@@ -5276,5 +5225,5 @@
 }
 
-/** Group Membership Requests *************************************************/
+/* Group Membership Requests *************************************************/
 
 class BP_Groups_Membership_Requests_Template {
@@ -5305,5 +5254,5 @@
 	public function __construct( $args = array() ) {
 
-		// Backward compatibility with old method of passing arguments
+		// Backward compatibility with old method of passing arguments.
 		if ( ! is_array( $args ) || func_num_args() > 1 ) {
 			_deprecated_argument( __METHOD__, '2.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
@@ -5338,5 +5287,5 @@
 			'page'     => $this->pag_page,
 
-			// These filters ensure we only get pending requests
+			// These filters ensure we only get pending requests.
 			'is_confirmed' => false,
 			'inviter_id'   => 0,
@@ -5346,13 +5295,13 @@
 		$this->request_count = count( $this->requests );
 
-		// Compatibility with legacy format of request data objects
+		// Compatibility with legacy format of request data objects.
 		foreach ( $this->requests as $rk => $rv ) {
 			// For legacy reasons, the 'id' property of each
 			// request must match the membership id, not the ID of
-			// the user (as it's returned by BP_Group_Member_Query)
+			// the user (as it's returned by BP_Group_Member_Query).
 			$this->requests[ $rk ]->user_id = $rv->ID;
 			$this->requests[ $rk ]->id      = $rv->membership_id;
 
-			// Miscellaneous values
+			// Miscellaneous values.
 			$this->requests[ $rk ]->group_id   = $r['group_id'];
 		}
@@ -5417,5 +5366,5 @@
 			 */
 			do_action( 'group_request_loop_end' );
-			// Do some cleaning up after the loop
+			// Do some cleaning up after the loop.
 			$this->rewind_requests();
 		}
@@ -5429,5 +5378,5 @@
 		$this->request     = $this->next_request();
 
-		// loop has just started
+		// Loop has just started.
 		if ( 0 == $this->current_request ) {
 
@@ -5664,5 +5613,5 @@
 	public function __construct( $args = array() ) {
 
-		// Backward compatibility with old method of passing arguments
+		// Backward compatibility with old method of passing arguments.
 		if ( ! is_array( $args ) || func_num_args() > 1 ) {
 			_deprecated_argument( __METHOD__, '2.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
@@ -5695,5 +5644,5 @@
 			'page'     => $this->pag_page,
 
-			// These filters ensure we get only pending invites
+			// These filters ensure we get only pending invites.
 			'is_confirmed' => false,
 			'inviter_id'   => $r['user_id'],
@@ -5706,5 +5655,5 @@
 
 		// If per_page is set to 0 (show all results), don't generate
-		// pag_links
+		// pag_links.
 		if ( ! empty( $this->pag_num ) ) {
 			$this->pag_links = paginate_links( array(
@@ -5841,5 +5790,5 @@
 	}
 
-	// Set the global (for use in BP_Groups_Invite_Template::the_invite())
+	// Set the global (for use in BP_Groups_Invite_Template::the_invite()).
 	if ( empty( $group_id ) ) {
 		$group_id = $r['group_id'];
@@ -6026,5 +5975,5 @@
 function bp_groups_activity_feed() {
 
-	// Bail if not viewing a single group or activity is not active
+	// Bail if not viewing a single group or activity is not active.
 	if ( ! bp_is_active( 'groups' ) || ! bp_is_active( 'activity' ) || ! bp_is_group() ) {
 		return;
@@ -6049,4 +5998,5 @@
 	 *
 	 * @since 1.5.0
+	 *
 	 * @return string
 	 */
@@ -6214,5 +6164,4 @@
  * @param string $query_args
  * @param bool $nonce
- *
  * @return string
  */
@@ -6228,5 +6177,4 @@
 	 * @param string $query_args
 	 * @param bool $nonce
-	 *
 	 * @return string
 	 */
@@ -6236,5 +6184,5 @@
 		$url           = '';
 
-		// Must be a group
+		// Must be a group.
 		if ( ! empty( $current_group->id ) ) {
 
@@ -6246,8 +6194,8 @@
 			}
 
-			// Add a slash at the end of our user url
+			// Add a slash at the end of our user url.
 			$url = trailingslashit( $url );
 
-			// Add possible query args
+			// Add possible query args.
 			if ( !empty( $query_args ) && is_array( $query_args ) ) {
 				$url = add_query_arg( $query_args, $url );
Index: /trunk/src/bp-groups/bp-groups-widgets.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-widgets.php	(revision 10372)
+++ /trunk/src/bp-groups/bp-groups-widgets.php	(revision 10373)
@@ -10,5 +10,7 @@
 defined( 'ABSPATH' ) || exit;
 
-/* Register widgets for groups component */
+/**
+ * Register widgets for groups component
+ */
 function groups_register_widgets() {
 	add_action('widgets_init', create_function('', 'return register_widget("BP_Groups_Widget");') );
@@ -16,7 +18,12 @@
 add_action( 'bp_register_widgets', 'groups_register_widgets' );
 
-/*** GROUPS WIDGET *****************/
-
+/**
+ * GROUPS WIDGET
+ */
 class BP_Groups_Widget extends WP_Widget {
+
+	/**
+	 * Working as a group, we get things done better.
+	 */
 	function __construct() {
 		$widget_ops = array(
@@ -41,4 +48,10 @@
 	}
 
+	/**
+	 * Extends our frontend output method.
+	 *
+	 * @param array $args     Array of arguments for the widget.
+	 * @param array $instance Widget instance data.
+	 */
 	function widget( $args, $instance ) {
 
@@ -146,4 +159,11 @@
 	}
 
+	/**
+	 * Extends our update method.
+	 *
+	 * @param array $new_instance New instance data.
+	 * @param array $old_instance Original instance data.
+	 * @return array
+	 */
 	function update( $new_instance, $old_instance ) {
 		$instance = $old_instance;
@@ -157,4 +177,10 @@
 	}
 
+	/**
+	 * Extends our form method.
+	 *
+	 * @param array $instance Current instance.
+	 * @return mixed
+	 */
 	function form( $instance ) {
 		$defaults = array(
Index: /trunk/src/bp-groups/classes/class-bp-group-extension.php
===================================================================
--- /trunk/src/bp-groups/classes/class-bp-group-extension.php	(revision 10372)
+++ /trunk/src/bp-groups/classes/class-bp-group-extension.php	(revision 10373)
@@ -36,6 +36,6 @@
  *     of your main extension tab. Defaults to 'groups/single/plugins.php'.
  *   - 'screens' A multi-dimensional array, described below.
- * 	 - 'access' Which users can visit the plugin's tab.
- * 	 - 'show_tab' Which users can see the plugin's navigation tab.
+ *   - 'access' Which users can visit the plugin's tab.
+ *   - 'show_tab' Which users can see the plugin's navigation tab.
  *
  * BP_Group_Extension uses the concept of "settings screens". There are three
@@ -63,11 +63,11 @@
  *   'screens' => array(
  *       'create' => array(
- *	     'slug' => 'foo',
- *	     'name' => 'Foo',
- *	     'position' => 55,
- *	     'screen_callback' => 'my_create_screen_callback',
- *	     'screen_save_callback' => 'my_create_screen_save_callback',
- *	 ),
- *	 'edit' => array( // ...
+ *       'slug' => 'foo',
+ *       'name' => 'Foo',
+ *       'position' => 55,
+ *       'screen_callback' => 'my_create_screen_callback',
+ *       'screen_save_callback' => 'my_create_screen_save_callback',
+ *   ),
+ *   'edit' => array( // ...
  *   ),
  * Only provide those arguments that you actually want to change from the
@@ -272,5 +272,5 @@
 	 * The content of the group tab.
 	 *
-	 * @param int|null $group_id
+	 * @param int|null $group_id ID of the group to display.
 	 */
 	public function display( $group_id = null ) {}
@@ -281,9 +281,11 @@
 	public function widget_display() {}
 
-	// *_screen() displays the settings form for the given context
-	// *_screen_save() processes data submitted via the settings form
-	// The settings_* methods are generic fallbacks, which can optionally
-	// be overridden by the more specific edit_*, create_*, and admin_*
-	// versions.
+	/*
+	 * *_screen() displays the settings form for the given context
+	 * *_screen_save() processes data submitted via the settings form
+	 * The settings_* methods are generic fallbacks, which can optionally
+	 * be overridden by the more specific edit_*, create_*, and admin_*
+	 * versions.
+	 */
 	public function settings_screen( $group_id = null ) {}
 	public function settings_screen_save( $group_id = null ) {}
@@ -354,5 +356,5 @@
 	 */
 	public function init( $args = array() ) {
-		// Store the raw arguments
+		// Store the raw arguments.
 		$this->params_raw = $args;
 
@@ -361,9 +363,9 @@
 		// compatibility with these plugins, we detect whether this is
 		// one of those legacy plugins, and parse any legacy arguments
-		// with those passed to init()
+		// with those passed to init().
 		$this->parse_legacy_properties();
 		$args = $this->parse_args_r( $args, $this->legacy_properties_converted );
 
-		// Parse with defaults
+		// Parse with defaults.
 		$this->params = $this->parse_args_r( $args, array(
 			'slug'              => $this->slug,
@@ -399,14 +401,14 @@
 	public function _register() {
 
-		// Detect and parse properties set by legacy extensions
+		// Detect and parse properties set by legacy extensions.
 		$this->parse_legacy_properties();
 
 		// Initialize, if necessary. This should only happen for
-		// legacy extensions that don't call parent::init() themselves
+		// legacy extensions that don't call parent::init() themselves.
 		if ( true !== $this->initialized ) {
 			$this->init();
 		}
 
-		// Set some config values, based on the parsed params
+		// Set some config values, based on the parsed params.
 		$this->group_id          = $this->get_group_id();
 		$this->slug              = $this->params['slug'];
@@ -418,15 +420,15 @@
 		$this->template_file     = $this->params['template_file'];
 
-		// Configure 'screens': create, admin, and edit contexts
+		// Configure 'screens': create, admin, and edit contexts.
 		$this->setup_screens();
 
-		// Configure access-related settings
+		// Configure access-related settings.
 		$this->setup_access_settings();
 
 		// Mirror configuration data so it's accessible to plugins
-		// that look for it in its old locations
+		// that look for it in its old locations.
 		$this->setup_legacy_properties();
 
-		// Hook the extension into BuddyPress
+		// Hook the extension into BuddyPress.
 		$this->setup_display_hooks();
 		$this->setup_create_hooks();
@@ -468,8 +470,8 @@
 	public static function get_group_id() {
 
-		// Usually this will work
+		// Usually this will work.
 		$group_id = bp_get_current_group_id();
 
-		// On the admin, get the group id out of the $_GET params
+		// On the admin, get the group id out of the $_GET params.
 		if ( empty( $group_id ) && is_admin() && ( isset( $_GET['page'] ) && ( 'bp-groups' === $_GET['page'] ) ) && ! empty( $_GET['gid'] ) ) {
 			$group_id = (int) $_GET['gid'];
@@ -477,5 +479,5 @@
 
 		// This fallback will only be hit when the create step is very
-		// early
+		// early.
 		if ( empty( $group_id ) && bp_get_new_group_id() ) {
 			$group_id = bp_get_new_group_id();
@@ -484,5 +486,5 @@
 		// On some setups, the group id has to be fetched out of the
 		// $_POST array
-		// @todo Figure out why this is happening during group creation
+		// @todo Figure out why this is happening during group creation.
 		if ( empty( $group_id ) && isset( $_POST['group_id'] ) ) {
 			$group_id = (int) $_POST['group_id'];
@@ -552,19 +554,19 @@
 	 */
 	protected function setup_access_settings() {
-		// Bail if no group ID is available
+		// Bail if no group ID is available.
 		if ( empty( $this->group_id ) ) {
 			return;
 		}
 
-		// Backward compatibility
+		// Backward compatibility.
 		if ( isset( $this->params['enable_nav_item'] ) ) {
 			$this->enable_nav_item = (bool) $this->params['enable_nav_item'];
 		}
 
-		// Tab Access
+		// Tab Access.
 		$this->user_can_visit = false;
 
 		// Backward compatibility for components that do not provide
-		// explicit 'access' parameter
+		// explicit 'access' parameter.
 		if ( empty( $this->params['access'] ) ) {
 			if ( false === $this->enable_nav_item ) {
@@ -576,8 +578,8 @@
 
 				if ( ! empty( $group->status ) && 'public' === $group->status ) {
-					// Tabs in public groups are accessible to anyone by default
+					// Tabs in public groups are accessible to anyone by default.
 					$this->params['access'] = 'anyone';
 				} else {
-					// All other groups have members-only as the default
+					// All other groups have members-only as the default.
 					$this->params['access'] = 'member';
 				}
@@ -585,5 +587,5 @@
 		}
 
-		// Parse multiple access conditions into an array
+		// Parse multiple access conditions into an array.
 		$access_conditions = $this->params['access'];
 		if ( ! is_array( $access_conditions ) ) {
@@ -592,5 +594,5 @@
 
 		// If the current user meets at least one condition, the
-		// get access
+		// get access.
 		foreach ( $access_conditions as $access_condition ) {
 			if ( $this->user_meets_access_condition( $access_condition ) ) {
@@ -600,14 +602,14 @@
 		}
 
-		// Tab Visibility
+		// Tab Visibility.
 		$this->user_can_see_nav_item = false;
 
 		// Backward compatibility for components that do not provide
-		// explicit 'show_tab' parameter
+		// explicit 'show_tab' parameter.
 		if ( empty( $this->params['show_tab'] ) ) {
 			if ( false === $this->params['enable_nav_item'] ) {
-				// enable_nav_item is only false if it's been
+				// The enable_nav_item index is only false if it's been
 				// defined explicitly as such in the
-				// constructor. So we always trust this value
+				// constructor. So we always trust this value.
 				$this->params['show_tab'] = 'noone';
 
@@ -616,5 +618,5 @@
 				// we assume this  is a legacy extension.
 				// Legacy behavior is that enable_nav_item=true +
-				// visibility=private implies members-only
+				// visibility=private implies members-only.
 				if ( 'public' !== $this->visibility ) {
 					$this->params['show_tab'] = 'member';
@@ -625,10 +627,10 @@
 			} else {
 				// No show_tab or enable_nav_item value is
-				// available, so match the value of 'access'
+				// available, so match the value of 'access'.
 				$this->params['show_tab'] = $this->params['access'];
 			}
 		}
 
-		// Parse multiple access conditions into an array
+		// Parse multiple access conditions into an array.
 		$access_conditions = $this->params['show_tab'];
 		if ( ! is_array( $access_conditions ) ) {
@@ -637,5 +639,5 @@
 
 		// If the current user meets at least one condition, the
-		// get access
+		// get access.
 		foreach ( $access_conditions as $access_condition ) {
 			if ( $this->user_meets_access_condition( $access_condition ) ) {
@@ -697,10 +699,10 @@
 	protected function setup_display_hooks() {
 
-		// Bail if not a group
+		// Bail if not a group.
 		if ( ! bp_is_group() ) {
 			return;
 		}
 
-		// Backward compatibility only
+		// Backward compatibility only.
 		if ( ( 'public' !== $this->visibility ) && ! buddypress()->groups->current_group->user_has_access ) {
 			return;
@@ -740,5 +742,5 @@
 			) );
 
-			// When we are viewing the extension display page, set the title and options title
+			// When we are viewing the extension display page, set the title and options title.
 			if ( bp_is_current_action( $this->slug ) ) {
 				add_filter( 'bp_group_user_has_access',   array( $this, 'group_access_protection' ), 10, 2 );
@@ -748,5 +750,5 @@
 		}
 
-		// Hook the group home widget
+		// Hook the group home widget.
 		if ( ! bp_current_action() && bp_is_current_action( 'home' ) ) {
 			add_action( $this->display_hook, array( &$this, 'widget_display' ) );
@@ -790,6 +792,5 @@
 	 * @since 2.1.0
 	 *
-	 * @param bool $user_can_see_nav_item
-	 *
+	 * @param bool $user_can_see_nav_item Whether or not the user can see the nav item.
 	 * @return bool
 	 */
@@ -807,6 +808,5 @@
 	 * @since 2.1.0
 	 *
-	 * @param bool $user_can_visit
-	 *
+	 * @param bool $user_can_visit Whether or not the user can visit the tab.
 	 * @return bool
 	 */
@@ -828,7 +828,6 @@
 	 * @since 2.1.0
 	 *
-	 * @param bool  $user_can_visit
-	 * @param array $no_access_args
-	 *
+	 * @param bool  $user_can_visit Whether or not the user can visit the tab.
+	 * @param array $no_access_args Array of args to help determine access.
 	 * @return bool
 	 */
@@ -864,5 +863,5 @@
 		$screen = $this->screens['create'];
 
-		// Insert the group creation step for the new group extension
+		// Insert the group creation step for the new group extension.
 		buddypress()->groups->group_creation_steps[ $screen['slug'] ] = array(
 			'name'     => $screen['name'],
@@ -875,5 +874,5 @@
 		// correct group creation step). Hooked in separate
 		// methods because current creation step info not yet
-		// available at this point
+		// available at this point.
 		add_action( 'groups_custom_create_steps', array( $this, 'maybe_create_screen' ) );
 		add_action( 'groups_create_group_step_save_' . $screen['slug'], array( $this, 'maybe_create_screen_save' ) );
@@ -894,5 +893,5 @@
 
 		// The create screen requires an additional nonce field
-		// due to a quirk in the way the templates are built
+		// due to a quirk in the way the templates are built.
 		wp_nonce_field( 'groups_create_save_' . bp_get_groups_current_create_step(), '_wpnonce', false );
 	}
@@ -920,10 +919,10 @@
 	 */
 	protected function setup_edit_hooks() {
-		// Bail if not in a group
+		// Bail if not in a group.
 		if ( ! bp_is_group() ) {
 			return;
 		}
 
-		// Bail if not an edit screen
+		// Bail if not an edit screen.
 		if ( ! $this->is_screen_enabled( 'edit' ) || ! bp_is_item_admin() ) {
 			return;
@@ -948,13 +947,13 @@
 		);
 
-		// Should we add a menu to the Group's WP Admin Bar
+		// Should we add a menu to the Group's WP Admin Bar.
 		if ( ! empty( $screen['show_in_admin_bar'] ) ) {
 			$subnav_args['show_in_admin_bar'] = true;
 		}
 
-		// Add the tab to the manage navigation
+		// Add the tab to the manage navigation.
 		bp_core_new_subnav_item( $subnav_args );
 
-		// Catch the edit screen and forward it to the plugin template
+		// Catch the edit screen and forward it to the plugin template.
 		if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) && bp_is_action_variable( $screen['slug'], 0 ) ) {
 			$this->call_edit_screen_save( $this->group_id );
@@ -963,5 +962,5 @@
 
 			// Determine the proper template and save for later
-			// loading
+			// loading.
 			if ( '' !== bp_locate_template( array( 'groups/single/home.php' ), false ) ) {
 				$this->edit_screen_template = '/groups/single/home';
@@ -973,5 +972,5 @@
 
 			// We load the template at bp_screens, to give all
-			// extensions a chance to load
+			// extensions a chance to load.
 			add_action( 'bp_screens', array( $this, 'call_edit_screen_template_loader' ) );
 		}
@@ -1015,5 +1014,5 @@
 
 		// When DOING_AJAX, the POST global will be populated, but we
-		// should assume it's a save
+		// should assume it's a save.
 		if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
 			return;
@@ -1023,14 +1022,14 @@
 
 		// Detect whether the screen_save_callback is performing a
-		// redirect, so that we don't do one of our own
+		// redirect, so that we don't do one of our own.
 		add_filter( 'wp_redirect', array( $this, 'detect_post_save_redirect' ) );
 
-		// Call the extension's save routine
+		// Call the extension's save routine.
 		call_user_func( $this->screens['edit']['screen_save_callback'], $this->group_id );
 
-		// Clean up detection filters
+		// Clean up detection filters.
 		remove_filter( 'wp_redirect', array( $this, 'detect_post_save_redirect' ) );
 
-		// Perform a redirect only if one has not already taken place
+		// Perform a redirect only if one has not already taken place.
 		if ( empty( $this->post_save_redirect ) ) {
 
@@ -1082,5 +1081,4 @@
 	 * @param string $screen The screen markup, captured in the output
 	 *                       buffer.
-	 *
 	 * @return string $screen The same markup, with a submit button added.
 	 */
@@ -1104,5 +1102,4 @@
 	 *
 	 * @param string $screen The markup to check.
-	 *
 	 * @return bool True if a Submit button is found, otherwise false.
 	 */
@@ -1118,6 +1115,5 @@
 	 * @since 2.1.0
 	 *
-	 * @param string $redirect
-	 *
+	 * @param string $redirect Redirect string.
 	 * @return string
 	 */
@@ -1142,11 +1138,11 @@
 		}
 
-		// Hook the admin screen markup function to the content hook
+		// Hook the admin screen markup function to the content hook.
 		add_action( 'bp_groups_admin_meta_box_content_' . $this->slug, array( $this, 'call_admin_screen' ) );
 
-		// Initialize the metabox
+		// Initialize the metabox.
 		add_action( 'bp_groups_admin_meta_boxes', array( $this, '_meta_box_display_callback' ) );
 
-		// Catch the metabox save
+		// Catch the metabox save.
 		add_action( 'bp_group_admin_edit_after', array( $this, 'call_admin_screen_save' ), 10 );
 	}
@@ -1232,5 +1228,4 @@
 	 *
 	 * @param string $context Screen context. 'create', 'edit', or 'admin'.
-	 *
 	 * @return bool True if the screen is enabled, otherwise false.
 	 */
@@ -1282,5 +1277,4 @@
 	 * @param string $type    Screen type. 'screen' or 'screen_save'. Default:
 	 *                        'screen'.
-	 *
 	 * @return callable A callable function handle.
 	 */
@@ -1288,5 +1282,5 @@
 		$callback = '';
 
-		// Try the context-specific callback first
+		// Try the context-specific callback first.
 		$method  = $context . '_' . $type;
 		$rmethod = $this->class_reflection->getMethod( $method );
@@ -1332,5 +1326,4 @@
 	 * @param array $a First set of arguments.
 	 * @param array $b Second set of arguments.
-	 *
 	 * @return array Parsed arguments.
 	 */
@@ -1376,5 +1369,4 @@
 	 *
 	 * @param string $key Property name.
-	 *
 	 * @return mixed The value if found, otherwise null.
 	 */
@@ -1401,5 +1393,4 @@
 	 *
 	 * @param string $key Property name.
-	 *
 	 * @return bool True if the value is set, otherwise false.
 	 */
@@ -1425,5 +1416,5 @@
 	 *
 	 * @param string $key Property name.
-	 * @param mixed $value Property value.
+	 * @param mixed  $value Property value.
 	 */
 	public function __set( $key, $value ) {
@@ -1450,5 +1441,5 @@
 				break;
 
-			// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'
+			// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'.
 			case 'admin_name' :
 				$this->screens['edit']['name'] = $value;
@@ -1527,5 +1518,5 @@
 	protected function parse_legacy_properties() {
 
-		// Only run this one time
+		// Only run this one time.
 		if ( ! empty( $this->legacy_properties_converted ) ) {
 			return;
@@ -1534,15 +1525,15 @@
 		$properties = $this->get_legacy_property_list();
 
-		// By-reference variable for convenience
+		// By-reference variable for convenience.
 		$lpc =& $this->legacy_properties_converted;
 
 		foreach ( $properties as $property ) {
 
-			// No legacy config exists for this key
+			// No legacy config exists for this key.
 			if ( ! isset( $this->{$property} ) ) {
 				continue;
 			}
 
-			// Grab the value and record it as appropriate
+			// Grab the value and record it as appropriate.
 			$value = $this->{$property};
 
@@ -1564,5 +1555,5 @@
 					break;
 
-				// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'
+				// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'.
 				case 'admin_name' :
 					$lpc['screens']['edit']['name'] = $value;
@@ -1610,5 +1601,5 @@
 	protected function setup_legacy_properties() {
 
-		// Only run this one time
+		// Only run this one time.
 		if ( ! empty( $this->legacy_properties ) ) {
 			return;
@@ -1637,5 +1628,5 @@
 					break;
 
-				// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'
+				// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'.
 				case 'admin_name' :
 					$lp['admin_name'] = $params['screens']['edit']['name'];
@@ -1663,8 +1654,8 @@
 
 				default :
-					// All other items get moved over
+					// All other items get moved over.
 					$lp[ $property ] = $params[ $property ];
 
-					// Also reapply to the object, for backpat
+					// Also reapply to the object, for backpat.
 					$this->{$property} = $params[ $property ];
 
@@ -1678,5 +1669,5 @@
  * Register a new Group Extension.
  *
- * @param string Name of the Extension class.
+ * @param string $group_extension_class Name of the Extension class.
  * @return false|null Returns false on failure, otherwise null.
  */
Index: /trunk/src/bp-groups/classes/class-bp-group-member-query.php
===================================================================
--- /trunk/src/bp-groups/classes/class-bp-group-member-query.php	(revision 10372)
+++ /trunk/src/bp-groups/classes/class-bp-group-member-query.php	(revision 10373)
@@ -58,13 +58,13 @@
 		// Take this early opportunity to set the default 'type' param
 		// to 'last_joined', which will ensure that BP_User_Query
-		// trusts our order and does not try to apply its own
+		// trusts our order and does not try to apply its own.
 		if ( empty( $this->query_vars_raw['type'] ) ) {
 			$this->query_vars_raw['type'] = 'last_joined';
 		}
 
-		// Set the sort order
+		// Set the sort order.
 		add_action( 'bp_pre_user_query', array( $this, 'set_orderby' ) );
 
-		// Set up our populate_extras method
+		// Set up our populate_extras method.
 		add_action( 'bp_user_query_populate_extras', array( $this, 'populate_group_member_extras' ), 10, 2 );
 	}
@@ -100,5 +100,5 @@
 
 		// If the group member query returned no users, bail with an
-		// array that will guarantee no matches for BP_User_Query
+		// array that will guarantee no matches for BP_User_Query.
 		if ( empty( $group_member_ids ) ) {
 			return array( 0 );
@@ -134,14 +134,14 @@
 		);
 
-		/** WHERE clauses *****************************************************/
-
-		// Group id
+		/* WHERE clauses *****************************************************/
+
+		// Group id.
 		$sql['where'][] = $wpdb->prepare( "group_id = %d", $this->query_vars['group_id'] );
 
-		// is_confirmed
+		// If is_confirmed.
 		$is_confirmed = ! empty( $this->query_vars['is_confirmed'] ) ? 1 : 0;
 		$sql['where'][] = $wpdb->prepare( "is_confirmed = %d", $is_confirmed );
 
-		// invite_sent
+		// If invite_sent.
 		if ( ! is_null( $this->query_vars['invite_sent'] ) ) {
 			$invite_sent = ! empty( $this->query_vars['invite_sent'] ) ? 1 : 0;
@@ -149,19 +149,19 @@
 		}
 
-		// inviter_id
+		// If inviter_id.
 		if ( ! is_null( $this->query_vars['inviter_id'] ) ) {
 			$inviter_id = $this->query_vars['inviter_id'];
 
-			// Empty: inviter_id = 0. (pass false, 0, or empty array)
+			// Empty: inviter_id = 0. (pass false, 0, or empty array).
 			if ( empty( $inviter_id ) ) {
 				$sql['where'][] = "inviter_id = 0";
 
-			// The string 'any' matches any non-zero value (inviter_id != 0)
+			// The string 'any' matches any non-zero value (inviter_id != 0).
 			} elseif ( 'any' === $inviter_id ) {
 				$sql['where'][] = "inviter_id != 0";
 
-			// Assume that a list of inviter IDs has been passed
+			// Assume that a list of inviter IDs has been passed.
 			} else {
-				// Parse and sanitize
+				// Parse and sanitize.
 				$inviter_ids = wp_parse_id_list( $inviter_id );
 				if ( ! empty( $inviter_ids ) ) {
@@ -180,5 +180,5 @@
 		}
 
-		// Sanitize: Only 'admin', 'mod', 'member', and 'banned' are valid
+		// Sanitize: Only 'admin', 'mod', 'member', and 'banned' are valid.
 		$allowed_roles = array( 'admin', 'mod', 'member', 'banned' );
 		foreach ( $roles as $role_key => $role_value ) {
@@ -192,5 +192,5 @@
 		// When querying for a set of roles containing 'member' (for
 		// which there is no dedicated is_ column), figure out a list
-		// of columns *not* to match
+		// of columns *not* to match.
 		$roles_sql = '';
 		if ( in_array( 'member', $roles ) ) {
@@ -205,5 +205,5 @@
 
 		// When querying for a set of roles *not* containing 'member',
-		// simply construct a list of is_* = 1 clauses
+		// simply construct a list of is_* = 1 clauses.
 		} else {
 			$role_columns = array();
@@ -226,5 +226,5 @@
 		// of 'type'. If the 'type' value is not 'last_joined' or
 		// 'first_joined', the order will be overridden in
-		// BP_Group_Member_Query::set_orderby()
+		// BP_Group_Member_Query::set_orderby().
 		$sql['orderby'] = "ORDER BY date_modified";
 		$sql['order']   = 'first_joined' === $this->query_vars['type'] ? 'ASC' : 'DESC';
@@ -272,10 +272,10 @@
 		if ( in_array( $query->query_vars['type'], array( 'last_joined', 'first_joined', 'group_activity' ) ) ) {
 
-			// Group Activity DESC
+			// Group Activity DESC.
 			if ( 'group_activity' == $query->query_vars['type'] ) {
 				$gm_ids = $this->get_gm_ids_ordered_by_activity( $query, $gm_ids );
 			}
 
-			// The first param in the FIELD() clause is the sort column id
+			// The first param in the FIELD() clause is the sort column id.
 			$gm_ids = array_merge( array( 'u.id' ), wp_parse_id_list( $gm_ids ) );
 			$gm_ids_sql = implode( ',', $gm_ids );
@@ -285,5 +285,5 @@
 
 		// Prevent this filter from running on future BP_User_Query
-		// instances on the same page
+		// instances on the same page.
 		remove_action( 'bp_pre_user_query', array( $this, 'set_orderby' ) );
 	}
@@ -293,5 +293,4 @@
 	 *
 	 * Additional data fetched:
-	 *
 	 *      - is_banned
 	 *      - date_modified
@@ -313,5 +312,5 @@
 		foreach ( (array) $extras as $extra ) {
 			if ( isset( $this->results[ $extra->user_id ] ) ) {
-				// user_id is provided for backward compatibility
+				// The user_id is provided for backward compatibility.
 				$this->results[ $extra->user_id ]->user_id       = (int) $extra->user_id;
 				$this->results[ $extra->user_id ]->is_admin      = (int) $extra->is_admin;
@@ -328,5 +327,5 @@
 		}
 
-		// Don't filter other BP_User_Query objects on the same page
+		// Don't filter other BP_User_Query objects on the same page.
 		remove_action( 'bp_user_query_populate_extras', array( $this, 'populate_group_member_extras' ), 10, 2 );
 	}
@@ -339,5 +338,4 @@
 	 * @param BP_User_Query $query  BP_User_Query object.
 	 * @param array         $gm_ids array of group member ids.
-	 *
 	 * @return array
 	 */
Index: /trunk/src/bp-groups/classes/class-bp-groups-group.php
===================================================================
--- /trunk/src/bp-groups/classes/class-bp-groups-group.php	(revision 10372)
+++ /trunk/src/bp-groups/classes/class-bp-groups-group.php	(revision 10373)
@@ -145,6 +145,6 @@
 	 * Constructor method.
 	 *
-	 * @param int|null $id Optional. If the ID of an existing group is provided,
-	 *                     the object will be pre-populated with info about that group.
+	 * @param int|null $id   Optional. If the ID of an existing group is provided,
+	 *                       the object will be pre-populated with info about that group.
 	 * @param array    $args {
 	 *     Array of optional arguments.
@@ -171,11 +171,11 @@
 		global $wpdb;
 
-		// Get BuddyPress
+		// Get BuddyPress.
 		$bp    = buddypress();
 
-		// Check cache for group data
+		// Check cache for group data.
 		$group = wp_cache_get( $this->id, 'bp_groups' );
 
-		// Cache missed, so query the DB
+		// Cache missed, so query the DB.
 		if ( false === $group ) {
 			$group = $wpdb->get_row( $wpdb->prepare( "SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $this->id ) );
@@ -184,5 +184,5 @@
 		}
 
-		// No group found so set the ID and bail
+		// No group found so set the ID and bail.
 		if ( empty( $group ) || is_wp_error( $group ) ) {
 			$this->id = 0;
@@ -190,5 +190,5 @@
 		}
 
-		// Group found so setup the object variables
+		// Group found so setup the object variables.
 		$this->id           = $group->id;
 		$this->creator_id   = $group->creator_id;
@@ -212,5 +212,5 @@
 			$admin_mods = $wpdb->get_results( apply_filters( 'bp_group_admin_mods_user_join_filter', $wpdb->prepare( "SELECT u.ID as user_id, u.user_login, u.user_email, u.user_nicename, m.is_admin, m.is_mod FROM {$wpdb->users} u, {$bp->groups->table_name_members} m WHERE u.ID = m.user_id AND m.group_id = %d AND ( m.is_admin = 1 OR m.is_mod = 1 )", $this->id ) ) );
 
-			// Add admins and moderators to their respective arrays
+			// Add admins and moderators to their respective arrays.
 			foreach ( (array) $admin_mods as $user ) {
 				if ( !empty( $user->is_admin ) ) {
@@ -222,9 +222,9 @@
 
 			// Set up some specific group vars from meta. Excluded
-			// from the bp_groups cache because it's cached independently
+			// from the bp_groups cache because it's cached independently.
 			$this->last_activity      = groups_get_groupmeta( $this->id, 'last_activity' );
 			$this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' );
 
-			// Set user-specific data
+			// Set user-specific data.
 			$user_id          = bp_loggedin_user_id();
 			$this->is_member  = BP_Groups_Member::check_is_member( $user_id, $this->id );
@@ -235,8 +235,8 @@
 			if ( ( 'private' === $this->status ) || ( 'hidden' === $this->status ) ) {
 
-				// Assume user does not have access to hidden/private groups
+				// Assume user does not have access to hidden/private groups.
 				$this->user_has_access = false;
 
-				// Group members or community moderators have access
+				// Group members or community moderators have access.
 				if ( ( $this->is_member && is_user_logged_in() ) || bp_current_user_can( 'bp_moderate' ) ) {
 					$this->user_has_access = true;
@@ -277,20 +277,20 @@
 		do_action_ref_array( 'groups_group_before_save', array( &$this ) );
 
-		// Groups need at least a name
+		// Groups need at least a name.
 		if ( empty( $this->name ) ) {
 			return false;
 		}
 
-		// Set slug with group title if not passed
+		// Set slug with group title if not passed.
 		if ( empty( $this->slug ) ) {
 			$this->slug = sanitize_title( $this->name );
 		}
 
-		// Sanity check
+		// Sanity check.
 		if ( empty( $this->slug ) ) {
 			return false;
 		}
 
-		// Check for slug conflicts if creating new group
+		// Check for slug conflicts if creating new group.
 		if ( empty( $this->id ) ) {
 			$this->slug = groups_check_slug( $this->slug );
@@ -370,15 +370,15 @@
 		global $wpdb;
 
-		// Delete groupmeta for the group
+		// Delete groupmeta for the group.
 		groups_delete_groupmeta( $this->id );
 
-		// Fetch the user IDs of all the members of the group
+		// Fetch the user IDs of all the members of the group.
 		$user_ids    = BP_Groups_Member::get_group_member_ids( $this->id );
 		$user_id_str = esc_sql( implode( ',', wp_parse_id_list( $user_ids ) ) );
 
-		// Modify group count usermeta for members
+		// Modify group count usermeta for members.
 		$wpdb->query( "UPDATE {$wpdb->usermeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_id_str} )" );
 
-		// Now delete all group member entries
+		// Now delete all group member entries.
 		BP_Groups_Member::delete_all( $this->id );
 
@@ -397,5 +397,5 @@
 		$bp = buddypress();
 
-		// Finally remove the group entry from the DB
+		// Finally remove the group entry from the DB.
 		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name} WHERE id = %d", $this->id ) ) )
 			return false;
@@ -412,5 +412,4 @@
 	 * @param string|bool $table_name Optional. Name of the table to check
 	 *                                against. Default: $bp->groups->table_name.
-	 *
 	 * @return string|null ID of the group, if one is found, else null.
 	 */
@@ -433,5 +432,4 @@
 	 *
 	 * @param string $slug See {@link BP_Groups_Group::group_exists()}.
-	 *
 	 * @return string|null See {@link BP_Groups_Group::group_exists()}.
 	 */
@@ -445,5 +443,4 @@
 	 * @param int $user_id ID of the inviting user.
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return array IDs of users who have been invited to the group by the
 	 *               user but have not yet accepted.
@@ -515,5 +512,4 @@
 	 *        sort).
 	 * @param string|bool $order   ASC or DESC. Default: false (default sort).
-	 *
 	 * @return array {
 	 *     @type array $groups Array of matched and paginated group objects.
@@ -552,5 +548,4 @@
 	 *
 	 * @param string $slug Slug to check.
-	 *
 	 * @return string|null The slug, if found. Otherwise null.
 	 */
@@ -567,5 +562,4 @@
 	 *
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return string|null The slug, if found. Otherwise null.
 	 */
@@ -582,5 +576,4 @@
 	 *
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return bool True if the group has members, otherwise false.
 	 */
@@ -602,5 +595,4 @@
 	 *
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return int|null The number of outstanding requests, or null if
 	 *                  none are found.
@@ -649,5 +641,5 @@
 	 *      parameter format.
 	 *
-	 * @param array {
+	 * @param array $args {
 	 *     Array of parameters. All items are optional.
 	 *     @type string       $type              Optional. Shorthand for certain orderby/
@@ -692,5 +684,5 @@
 		global $wpdb;
 
-		// Backward compatibility with old method of passing arguments
+		// Backward compatibility with old method of passing arguments.
 		if ( ! is_array( $args ) || func_num_args() > 1 ) {
 			_deprecated_argument( __METHOD__, '1.7', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
@@ -783,5 +775,5 @@
 		}
 
-		/** Order/orderby ********************************************/
+		/* Order/orderby ********************************************/
 
 		$order   = $r['order'];
@@ -789,5 +781,5 @@
 
 		// If a 'type' parameter was passed, parse it and overwrite
-		// 'order' and 'orderby' params passed to the function
+		// 'order' and 'orderby' params passed to the function.
 		if (  ! empty( $r['type'] ) ) {
 
@@ -804,5 +796,5 @@
 			// If an invalid type is passed, $order_orderby will be
 			// an array with empty values. In this case, we stick
-			// with the default values of $order and $orderby
+			// with the default values of $order and $orderby.
 			if ( ! empty( $order_orderby['order'] ) ) {
 				$order = $order_orderby['order'];
@@ -814,5 +806,5 @@
 		}
 
-		// Sanitize 'order'
+		// Sanitize 'order'.
 		$order = bp_esc_sql_order( $order );
 
@@ -828,5 +820,5 @@
 		$orderby = apply_filters( 'bp_groups_get_orderby_converted_by_term', self::convert_orderby_to_order_by_term( $orderby ), $orderby, $r['type'] );
 
-		// Random order is a special case
+		// Random order is a special case.
 		if ( 'rand()' === $orderby ) {
 			$sql[] = "ORDER BY rand()";
@@ -870,20 +862,20 @@
 
 		// Temporary implementation of meta_query for total count
-		// See #5099
+		// See #5099.
 		if ( ! empty( $meta_query_sql['where'] ) ) {
-			// Join the groupmeta table
+			// Join the groupmeta table.
 			$total_sql['select'] .= ", ". substr( $meta_query_sql['join'], 0, -2 );
 
-			// Modify the meta_query clause from paged_sql for our syntax
+			// Modify the meta_query clause from paged_sql for our syntax.
 			$meta_query_clause = preg_replace( '/^\s*AND/', '', $meta_query_sql['where'] );
 			$total_sql['where'][] = $meta_query_clause;
 		}
 
-		// Already escaped in the paginated results block
+		// Already escaped in the paginated results block.
 		if ( ! empty( $include ) ) {
 			$total_sql['where'][] = "g.id IN ({$include})";
 		}
 
-		// Already escaped in the paginated results block
+		// Already escaped in the paginated results block.
 		if ( ! empty( $exclude ) ) {
 			$total_sql['where'][] = "g.id NOT IN ({$exclude})";
@@ -916,10 +908,10 @@
 		}
 
-		// Populate some extra information instead of querying each time in the loop
+		// Populate some extra information instead of querying each time in the loop.
 		if ( !empty( $r['populate_extras'] ) ) {
 			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, $r['type'] );
 		}
 
-		// Grab all groupmeta
+		// Grab all groupmeta.
 		if ( ! empty( $r['update_meta_cache'] ) ) {
 			bp_groups_update_meta_cache( $group_ids );
@@ -944,5 +936,4 @@
 	 * @param array $meta_query An array of meta_query filters. See the
 	 *                          documentation for {@link WP_Meta_Query} for details.
-	 *
 	 * @return array $sql_array 'join' and 'where' clauses.
 	 */
@@ -959,5 +950,5 @@
 
 			// WP_Meta_Query expects the table name at
-			// $wpdb->group
+			// $wpdb->group.
 			$wpdb->groupmeta = buddypress()->groups->table_name_groupmeta;
 
@@ -971,5 +962,5 @@
 			// @todo It may be better in the long run to refactor
 			// the more general query syntax to accord better with
-			// BP/WP convention
+			// BP/WP convention.
 			preg_match_all( '/JOIN (.+?) ON/', $meta_sql['join'], $matches_a );
 			preg_match_all( '/ON \((.+?)\)/', $meta_sql['join'], $matches_b );
@@ -992,6 +983,6 @@
 	 *
 	 * @return array {
-	 *	@type string $order   SQL-friendly order string.
-	 *	@type string $orderby SQL-friendly orderby column name.
+	 *     @type string $order   SQL-friendly order string.
+	 *     @type string $orderby SQL-friendly orderby column name.
 	 * }
 	 */
@@ -1044,5 +1035,4 @@
 	 * @param string|array|bool $exclude         Optional. Array or comma-separated list of group
 	 *                                           IDs to exclude from results.
-	 *
 	 * @return array {
 	 *     @type array $groups Array of group objects returned by the
@@ -1105,5 +1095,4 @@
 	 *
 	 * @param string $orderby Orderby term as passed to get().
-	 *
 	 * @return string $order_by_term SQL-friendly orderby term.
 	 */
@@ -1150,5 +1139,4 @@
 	 * @param string|array|bool $exclude         Optional. Array or comma-separated list of group
 	 *                                           IDs to exclude from results.
-	 *
 	 * @return array {
 	 *     @type array $groups Array of group objects returned by the
@@ -1229,5 +1217,5 @@
 		$pag_sql = $hidden_sql = $exclude_sql = '';
 
-		// Multibyte compliance
+		// Multibyte compliance.
 		if ( function_exists( 'mb_strlen' ) ) {
 			if ( mb_strlen( $letter, 'UTF-8' ) > 1 || is_numeric( $letter ) || !$letter ) {
@@ -1287,5 +1275,4 @@
 	 * @param string|array|bool $exclude         Optional. Array or comma-separated list of group
 	 *                                           IDs to exclude from results.
-	 *
 	 * @return array {
 	 *     @type array $groups Array of group objects returned by the
@@ -1345,5 +1332,4 @@
 	 *
 	 * Data fetched:
-	 *
 	 *     - Logged-in user's status within each group (is_member,
 	 *       is_confirmed, is_pending, is_banned)
@@ -1353,5 +1339,4 @@
 	 *                                   $paged_groups.
 	 * @param string|bool  $type         Not used.
-	 *
 	 * @return array $paged_groups
 	 */
@@ -1364,8 +1349,8 @@
 		$bp = buddypress();
 
-		// Sanitize group IDs
+		// Sanitize group IDs.
 		$group_ids = implode( ',', wp_parse_id_list( $group_ids ) );
 
-		// Fetch the logged-in user's status within each group
+		// Fetch the logged-in user's status within each group.
 		if ( is_user_logged_in() ) {
 			$user_status_results = $wpdb->get_results( $wpdb->prepare( "SELECT group_id, is_confirmed, invite_sent FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id IN ( {$group_ids} ) AND is_banned = 0", bp_loggedin_user_id() ) );
@@ -1374,5 +1359,5 @@
 		}
 
-		// Reindex
+		// Reindex.
 		$user_status = array();
 		foreach ( $user_status_results as $user_status_result ) {
@@ -1386,13 +1371,13 @@
 			if ( isset( $user_status[ $gid ] ) ) {
 
-				// is_confirmed means the user is a member
+				// The is_confirmed means the user is a member.
 				if ( $user_status[ $gid ]->is_confirmed ) {
 					$is_member = '1';
 
-				// invite_sent means the user has been invited
+				// The invite_sent means the user has been invited.
 				} elseif ( $user_status[ $gid ]->invite_sent ) {
 					$is_invited = '1';
 
-				// User has sent request, but has not been confirmed
+				// User has sent request, but has not been confirmed.
 				} else {
 					$is_pending = '1';
@@ -1428,5 +1413,4 @@
 	 *
 	 * @param int $group_id ID of the group whose invitations are being deleted.
-	 *
 	 * @return int|null Number of rows records deleted on success, null on
 	 *                  failure.
@@ -1465,5 +1449,4 @@
 	 * @param string $type Optional. If 'unreplied', count will be limited to
 	 *                     those topics that have received no replies.
-	 *
 	 * @return int Forum topic count.
 	 */
@@ -1479,5 +1462,5 @@
 		 * Filters the portion of the SQL related to global count of forum topics in public groups.
 		 *
-		 * https://buddypress.trac.wordpress.org/ticket/4306.
+		 * See https://buddypress.trac.wordpress.org/ticket/4306.
 		 *
 		 * @since 1.6.0
@@ -1488,5 +1471,5 @@
 		$extra_sql = apply_filters( 'get_global_forum_topic_count_extra_sql', $bp->groups->filter_sql, $type );
 
-		// Make sure the $extra_sql begins with an AND
+		// Make sure the $extra_sql begins with an AND.
 		if ( 'AND' != substr( trim( strtoupper( $extra_sql ) ), 0, 3 ) )
 			$extra_sql = ' AND ' . $extra_sql;
@@ -1499,5 +1482,4 @@
 	 *
 	 * @param int $group_id Group ID.
-	 *
 	 * @return int Count of confirmed members for the group.
 	 */
@@ -1518,5 +1500,4 @@
 	 *                                  'hidden', or 'all'. Default: 'public'.
 	 * @param string|bool $search_terms Provided search terms.
-	 *
 	 * @return int The topic count
 	 */
Index: /trunk/src/bp-groups/classes/class-bp-groups-member-suggestions.php
===================================================================
--- /trunk/src/bp-groups/classes/class-bp-groups-member-suggestions.php	(revision 10372)
+++ /trunk/src/bp-groups/classes/class-bp-groups-member-suggestions.php	(revision 10373)
@@ -94,5 +94,5 @@
 	public function get_suggestions() {
 		$user_query = array(
-			'count_total'     => '',  // Prevents total count
+			'count_total'     => '',  // Prevents total count.
 			'populate_extras' => false,
 			'type'            => 'alphabetical',
@@ -117,5 +117,5 @@
 		} else {
 			$group_query = array(
-				'count_total'     => '',  // Prevents total count
+				'count_total'     => '',  // Prevents total count.
 				'populate_extras' => false,
 				'type'            => 'alphabetical',
Index: /trunk/src/bp-groups/classes/class-bp-groups-member.php
===================================================================
--- /trunk/src/bp-groups/classes/class-bp-groups-member.php	(revision 10372)
+++ /trunk/src/bp-groups/classes/class-bp-groups-member.php	(revision 10373)
@@ -131,5 +131,5 @@
 	public function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
 
-		// User and group are not empty, and ID is
+		// User and group are not empty, and ID is.
 		if ( !empty( $user_id ) && !empty( $group_id ) && empty( $id ) ) {
 			$this->user_id  = $user_id;
@@ -141,5 +141,5 @@
 		}
 
-		// ID is not empty
+		// ID is not empty.
 		if ( !empty( $id ) ) {
 			$this->id = $id;
@@ -226,5 +226,5 @@
 			$sql = $wpdb->prepare( "UPDATE {$bp->groups->table_name_members} SET inviter_id = %d, is_admin = %d, is_mod = %d, is_banned = %d, user_title = %s, date_modified = %s, is_confirmed = %d, comments = %s, invite_sent = %d WHERE id = %d", $this->inviter_id, $this->is_admin, $this->is_mod, $this->is_banned, $this->user_title, $this->date_modified, $this->is_confirmed, $this->comments, $this->invite_sent, $this->id );
 		} else {
-			// Ensure that user is not already a member of the group before inserting
+			// Ensure that user is not already a member of the group before inserting.
 			if ( $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 LIMIT 1", $this->user_id, $this->group_id ) ) ) {
 				return false;
@@ -239,8 +239,8 @@
 		$this->id = $wpdb->insert_id;
 
-		// Update the user's group count
+		// Update the user's group count.
 		self::refresh_total_group_count_for_user( $this->user_id );
 
-		// Update the group's member count
+		// Update the group's member count.
 		self::refresh_total_member_count_for_group( $this->group_id );
 
@@ -263,5 +263,4 @@
 	 *
 	 * @param string $status The new status. 'mod' or 'admin'.
-	 *
 	 * @return bool True on success, false on failure.
 	 */
@@ -364,8 +363,8 @@
 			return false;
 
-		// Update the user's group count
+		// Update the user's group count.
 		self::refresh_total_group_count_for_user( $this->user_id );
 
-		// Update the group's member count
+		// Update the group's member count.
 		self::refresh_total_member_count_for_group( $this->group_id );
 
@@ -390,5 +389,4 @@
 	 *
 	 * @param int $user_id ID of the user.
-	 *
 	 * @return bool True on success, false on failure.
 	 */
@@ -403,5 +401,4 @@
 	 *
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return bool True on success, false on failure.
 	 */
@@ -415,5 +412,4 @@
 	 * @param int $user_id  ID of the user.
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return True on success, false on failure.
 	 */
@@ -434,8 +430,8 @@
 		$remove = $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $user_id, $group_id ) );
 
-		// Update the user's group count
+		// Update the user's group count.
 		self::refresh_total_group_count_for_user( $user_id );
 
-		// Update the group's member count
+		// Update the group's member count.
 		self::refresh_total_member_count_for_group( $group_id );
 
@@ -475,5 +471,5 @@
 		$bp = buddypress();
 
-		// If the user is logged in and viewing their own groups, we can show hidden and private groups
+		// If the user is logged in and viewing their own groups, we can show hidden and private groups.
 		if ( $user_id != bp_loggedin_user_id() ) {
 			$group_sql = $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0{$pag_sql}", $user_id );
@@ -540,5 +536,4 @@
 	 * @param string|bool $filter  Optional. Limit results to groups whose name or
 	 *                             description field matches search terms.
-	 *
 	 * @return array {
 	 *     @type array $groups Array of groups returned by paginated query.
@@ -574,48 +569,4 @@
 	/**
 	 * Get the IDs of the groups of which a specified user is a moderator.
-	 *
-	 * @param int         $user_id ID of the user.
-	 * @param int|bool    $limit   Optional. Max number of results to return.
-	 *                             Default: false (no limit).
-	 * @param int|bool    $page    Optional. Page offset of results to return.
-	 *                             Default: false (no limit).
-	 * @param string|bool $filter  Optional. Limit results to groups whose name or
-	 *                             description field matches search terms.
-	 *
-	 * @return array {
-	 *     @type array $groups Array of groups returned by paginated query.
-	 *     @type int   $total  Count of groups matching query.
-	 * }
-	 */
-	public static function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) {
-		global $wpdb;
-
-		$user_id_sql = $pag_sql = $hidden_sql = $filter_sql = '';
-
-		$user_id_sql = $wpdb->prepare( 'm.user_id = %d', $user_id );
-
-		if ( !empty( $limit ) && !empty( $page ) )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-
-		if ( !empty( $filter ) ) {
-			$search_terms_like = '%' . bp_esc_like( $filter ) . '%';
-			$filter_sql = $wpdb->prepare( " AND ( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
-		}
-
-		if ( $user_id != bp_loggedin_user_id() )
-			$hidden_sql = " AND g.status != 'hidden'";
-
-		$bp = buddypress();
-
-		$paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'{$hidden_sql}{$filter_sql} AND {$user_id_sql} AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY m.date_modified ASC {$pag_sql}" );
-		$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND {$user_id_sql} AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY date_modified ASC" );
-
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
-
-	/**
-	 * Get the groups of which a specified user is banned from.
-	 *
-	 * @since 2.4
 	 *
 	 * @param int         $user_id ID of the user.
@@ -631,4 +582,47 @@
 	 * }
 	 */
+	public static function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) {
+		global $wpdb;
+
+		$user_id_sql = $pag_sql = $hidden_sql = $filter_sql = '';
+
+		$user_id_sql = $wpdb->prepare( 'm.user_id = %d', $user_id );
+
+		if ( !empty( $limit ) && !empty( $page ) )
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+
+		if ( !empty( $filter ) ) {
+			$search_terms_like = '%' . bp_esc_like( $filter ) . '%';
+			$filter_sql = $wpdb->prepare( " AND ( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
+		}
+
+		if ( $user_id != bp_loggedin_user_id() )
+			$hidden_sql = " AND g.status != 'hidden'";
+
+		$bp = buddypress();
+
+		$paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'{$hidden_sql}{$filter_sql} AND {$user_id_sql} AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY m.date_modified ASC {$pag_sql}" );
+		$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND {$user_id_sql} AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY date_modified ASC" );
+
+		return array( 'groups' => $paged_groups, 'total' => $total_groups );
+	}
+
+	/**
+	 * Get the groups of which a specified user is banned from.
+	 *
+	 * @since 2.4
+	 *
+	 * @param int         $user_id ID of the user.
+	 * @param int|bool    $limit   Optional. Max number of results to return.
+	 *                             Default: false (no limit).
+	 * @param int|bool    $page    Optional. Page offset of results to return.
+	 *                             Default: false (no limit).
+	 * @param string|bool $filter  Optional. Limit results to groups whose name or
+	 *                             description field matches search terms.
+	 * @return array {
+	 *     @type array $groups Array of groups returned by paginated query.
+	 *     @type int   $total  Count of groups matching query.
+	 * }
+	 */
 	public static function get_is_banned_of( $user_id, $limit = false, $page = false, $filter = false ) {
 		global $wpdb;
@@ -662,5 +656,4 @@
 	 *
 	 * @param int $user_id Optional. Default: ID of the displayed user.
-	 *
 	 * @return int Group count.
 	 */
@@ -690,5 +683,4 @@
 	 * @param string|array|bool $exclude Optional. Array or comma-separated list
 	 *                                   of group IDs to exclude from results.
-	 *
 	 * @return array {
 	 *     @type array $groups Array of groups returned by paginated query.
@@ -721,5 +713,4 @@
 	 *
 	 * @param int $user_id The user ID.
-	 *
 	 * @return int
 	 */
@@ -746,5 +737,4 @@
 	 * @param string $type     If 'sent', results are limited to those invitations
 	 *                         that have actually been sent (non-draft). Default: 'sent'.
-	 *
 	 * @return int|null The ID of the invitation if found, otherwise null.
 	 */
@@ -771,5 +761,4 @@
 	 * @param  int $user_id  ID of the user.
 	 * @param  int $group_id ID of the group.
-	 *
 	 * @return int Number of records deleted.
 	 */
@@ -799,5 +788,4 @@
 	 * @param int $user_id  ID of the user.
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return int Number of records deleted.
 	 */
@@ -818,5 +806,4 @@
 	 * @param int $user_id  ID of the user.
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return mixed
 	 */
@@ -837,5 +824,4 @@
 	 * @param int $user_id  ID of the user.
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return mixed
 	 */
@@ -856,5 +842,4 @@
 	 * @param int $user_id  ID of the user.
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return mixed
 	 */
@@ -875,5 +860,4 @@
 	 * @param int $user_id  ID of the user.
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return mixed
 	 */
@@ -896,5 +880,4 @@
 	 * @param int $user_id  ID of the user.
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return int|null ID of the group if the user is the creator,
 	 *                  otherwise false.
@@ -916,5 +899,4 @@
 	 * @param int $user_id  ID of the user.
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return int|null ID of the membership if found, otherwise false.
 	 */
@@ -935,5 +917,4 @@
 	 * @param int $user_id      ID of the user.
 	 * @param int $total_groups Max number of group IDs to return. Default: 5.
-	 *
 	 * @return array Group IDs.
 	 */
@@ -943,5 +924,5 @@
 		$bp = buddypress();
 
-		// If the user is logged in and viewing their random groups, we can show hidden and private groups
+		// If the user is logged in and viewing their random groups, we can show hidden and private groups.
 		if ( bp_is_my_profile() ) {
 			return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand() LIMIT %d", $user_id, $total_groups ) );
@@ -955,5 +936,4 @@
 	 *
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return array IDs of all group members.
 	 */
@@ -970,5 +950,4 @@
 	 *
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return array Info about group admins (user_id + date_modified).
 	 */
@@ -992,5 +971,4 @@
 	 *
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return array Info about group mods (user_id + date_modified).
 	 */
@@ -1007,5 +985,4 @@
 	 *
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return array IDs of users with outstanding membership requests.
 	 */
@@ -1023,11 +1000,10 @@
 	 * @deprecated 1.8.0
 	 *
-	 * @param $group_id
-	 * @param $limit
-	 * @param $page
-	 * @param $exclude_admins_mods
-	 * @param $exclude_banned
-	 * @param $exclude
-	 *
+	 * @param int        $group_id            ID of the group being queried for.
+	 * @param bool/int   $limit               Max amount to return.
+	 * @param bool/int   $page                Pagination value.
+	 * @param bool       $exclude_admins_mods Whether or not to exclude admins and moderators.
+	 * @param bool       $exclude_banned      Whether or not to exclude banned members.
+	 * @param bool/array $exclude             Array of user IDs to exclude.
 	 * @return mixed
 	 */
@@ -1091,5 +1067,5 @@
 		}
 
-		// Fetch whether or not the user is a friend
+		// Fetch whether or not the user is a friend.
 		foreach ( (array) $members as $user )
 			$user_ids[] = $user->user_id;
@@ -1115,5 +1091,4 @@
 	 *
 	 * @param int $group_id ID of the group.
-	 *
 	 * @return int Number of records deleted.
 	 */
@@ -1132,5 +1107,4 @@
 	 *
 	 * @param int $user_id ID of the user.
-	 *
 	 * @return mixed
 	 */
@@ -1140,10 +1114,10 @@
 		$bp = buddypress();
 
-		// Get all the group ids for the current user's groups and update counts
+		// Get all the group ids for the current user's groups and update counts.
 		$group_ids = BP_Groups_Member::get_group_ids( $user_id );
 		foreach ( $group_ids['groups'] as $group_id ) {
 			groups_update_groupmeta( $group_id, 'total_member_count', groups_get_total_member_count( $group_id ) - 1 );
 
-			// If current user is the creator of a group and is the sole admin, delete that group to avoid counts going out-of-sync
+			// If current user is the creator of a group and is the sole admin, delete that group to avoid counts going out-of-sync.
 			if ( groups_is_user_admin( $user_id, $group_id ) && count( groups_get_group_admins( $group_id ) ) < 2 && groups_is_user_creator( $user_id, $group_id ) )
 				groups_delete_group( $group_id );
